* commit 'bc36de71e74ee794eaef650b7f265f5f51f0ad2f': (62 commits) 冲突 rt 冲突修正 冲突 冲突 1 1 冲突 rt 代码质量 灰化已实现~效果还不错哈~ 1 1 韩文设计器按钮撑开. 提示框简化,更简洁了 1. 重写了自己的model来在set属性值之前进行判断并给出弹窗提示; 2. 继承DoubleEditor来实现兼容弹窗显示效果的控件,复原之前基础控件的所有更改。 dev->master 基础控件类抽取需要的代码单独作一个方法,在子类中重写 重载输入框的光标事件方法,不管是光标移出还是按下回车(enter),会立即触发表单移动端高度属性的setter方法,并给出弹窗提示。 class重命名 ...master
@ -1,33 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
||||
<classpathentry kind="src" path="src"/> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> |
||||
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/> |
||||
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/> |
||||
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/activation.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/commons-el.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/commons-logging.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/jasper-compiler.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/jasper-runtime.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/javax.servlet.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/jaxrpc.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/mail.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/mx4j-remote.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/mx4j-tools.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/mx4j.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jetty.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jmx.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/saaj.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/xercesImpl.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/xml-apis.jar"/> |
||||
<classpathentry kind="lib" path="/lib/jetty/xmlParserAPIs.jar"/> |
||||
<classpathentry kind="lib" path="/lib/3rd.jar"/> |
||||
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/> |
||||
<classpathentry kind="lib" path="/lib/junit.jar"/> |
||||
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/> |
||||
<classpathentry kind="lib" path="/lib/olap4j-1.1.0.jar"/> |
||||
<classpathentry combineaccessrules="false" kind="src" path="/base-file"/> |
||||
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-core-8.0.jar"/> |
||||
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-third-8.0.jar"/> |
||||
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/jetty/org.mortbay.jetty.jar"/> |
||||
<classpathentry kind="output" path="bin"/> |
||||
</classpath> |
||||
|
@ -0,0 +1,74 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class BBSAction extends UpdateAction |
||||
{ |
||||
|
||||
|
||||
public BBSAction() |
||||
{ |
||||
this.setMenuKeySet(BBS); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs.png")); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 动作 |
||||
* @param e 事件 |
||||
*/ |
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
} |
||||
public static final MenuKeySet BBS = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'B'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_BBS"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,72 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class BugAction extends UpdateAction |
||||
{ |
||||
|
||||
public BugAction() |
||||
{ this.setMenuKeySet(BUG); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bug.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.bugs"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet BUG = new MenuKeySet() { |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_BUG"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public char getMnemonic() |
||||
{ |
||||
|
||||
return 'U'; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class NeedAction extends UpdateAction |
||||
{ |
||||
|
||||
public NeedAction() |
||||
{ |
||||
this.setMenuKeySet(NEED); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/need.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.needs"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet NEED = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'N'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_NEED"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,69 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class QuestionAction extends UpdateAction |
||||
{ |
||||
|
||||
public QuestionAction() |
||||
{ this.setMenuKeySet(QUESTIONS); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/questions.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.questions"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet QUESTIONS = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'Q'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_QUESTIONS"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class SignAction extends UpdateAction |
||||
{ |
||||
|
||||
public SignAction() |
||||
{ |
||||
this.setMenuKeySet(SIGN); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/signature.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.aut"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet SIGN = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'S'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_SIGN"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class UpAction extends UpdateAction |
||||
{ |
||||
|
||||
public UpAction() |
||||
{ |
||||
this.setMenuKeySet(UPDATE); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.update"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet UPDATE = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'U'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_UPDATE"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import java.awt.Desktop; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.net.URISyntaxException; |
||||
|
||||
import javax.swing.JOptionPane; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
import com.fr.general.SiteCenter; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class VideoAction extends UpdateAction |
||||
{ |
||||
|
||||
public VideoAction() |
||||
{ |
||||
this.setMenuKeySet(VIDEO); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/video.png")); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) |
||||
{ |
||||
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.video"); |
||||
if (StringUtils.isEmpty(url)) { |
||||
FRContext.getLogger().info("The URL is empty!"); |
||||
return; |
||||
} |
||||
try { |
||||
Desktop.getDesktop().browse(new URI(url)); |
||||
} catch (IOException exp) { |
||||
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (URISyntaxException exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
} catch (Exception exp) { |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
||||
} |
||||
|
||||
} |
||||
public static final MenuKeySet VIDEO = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'V'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Designer_COMMUNITY_VIDEO"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.stable.fun.Level; |
||||
|
||||
/** |
||||
* Coder: zack |
||||
* Date: 2016/5/12 |
||||
* Time: 10:37 |
||||
*/ |
||||
public interface WidgetDesignHandler extends Level { |
||||
String XML_TAG = "WidgetDesignHandler"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 传递控件共有属性 |
||||
* |
||||
* @param oldWidget 老控件 |
||||
* @param newWidget 新控件 |
||||
*/ |
||||
void transferWidgetProperties(Widget oldWidget, Widget newWidget); |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.WidgetDesignHandler; |
||||
|
||||
/** |
||||
* Coder: zack |
||||
* Date: 2016/5/12 |
||||
* Time: 10:41 |
||||
*/ |
||||
public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler { |
||||
} |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 522 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 403 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,6 @@
|
||||
package com.fr.design; |
||||
|
||||
public class mingche |
||||
{ |
||||
|
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.fr.design.designer.beans.adapters.layout; |
||||
|
||||
import com.fr.design.beans.GroupModel; |
||||
import com.fr.design.designer.creator.XLayoutContainer; |
||||
import com.fr.design.designer.creator.XWFitLayout; |
||||
import com.fr.design.designer.properties.BodyMobileLayoutPropertiesGroupModel; |
||||
|
||||
public class FRBodyFitLayoutAdapter extends FRFitLayoutAdapter { |
||||
|
||||
public FRBodyFitLayoutAdapter(XLayoutContainer container) { |
||||
super(container); |
||||
} |
||||
/** |
||||
* 返回布局自身属性,方便一些特有设置在layout刷新时处理 |
||||
*/ |
||||
@Override |
||||
public GroupModel getLayoutProperties() { |
||||
XWFitLayout xfl = (XWFitLayout) container; |
||||
return new BodyMobileLayoutPropertiesGroupModel(xfl); |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.designer.creator; |
||||
|
||||
import com.fr.design.designer.beans.LayoutAdapter; |
||||
import com.fr.design.designer.beans.adapters.layout.FRBodyFitLayoutAdapter; |
||||
import com.fr.form.ui.container.WFitLayout; |
||||
import java.awt.Dimension; |
||||
|
||||
public class XWBodyFitLayout extends XWFitLayout { |
||||
public XWBodyFitLayout() { |
||||
this(new WFitLayout(), new Dimension()); |
||||
} |
||||
|
||||
public XWBodyFitLayout(WFitLayout widget, Dimension initSize) { |
||||
super(widget, initSize); |
||||
} |
||||
@Override |
||||
public LayoutAdapter getLayoutAdapter() { |
||||
return new FRBodyFitLayoutAdapter(this); |
||||
} |
||||
} |
@ -0,0 +1,83 @@
|
||||
package com.fr.design.designer.properties; |
||||
|
||||
import java.awt.event.MouseEvent; |
||||
import java.util.ArrayList; |
||||
|
||||
import javax.swing.JTable; |
||||
import javax.swing.table.TableColumn; |
||||
import javax.swing.table.TableModel; |
||||
|
||||
import com.fr.design.beans.GroupModel; |
||||
import com.fr.design.designer.creator.*; |
||||
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||
import com.fr.design.gui.itable.PropertyGroup; |
||||
import com.fr.design.designer.beans.LayoutAdapter; |
||||
|
||||
|
||||
public class BodyAppRelayoutTable extends AbstractPropertyTable { |
||||
|
||||
private XWBodyFitLayout xwBodyFitLayout; |
||||
|
||||
public BodyAppRelayoutTable(XWBodyFitLayout xwBodyFitLayout) { |
||||
super(); |
||||
setDesigner(xwBodyFitLayout); |
||||
} |
||||
|
||||
public static ArrayList<PropertyGroup> getCreatorPropertyGroup(XCreator source) { |
||||
ArrayList<PropertyGroup> groups = new ArrayList<PropertyGroup>(); |
||||
if (source instanceof XLayoutContainer) { |
||||
LayoutAdapter layoutAdapter = ((XLayoutContainer)source).getLayoutAdapter(); |
||||
if(layoutAdapter != null){ |
||||
GroupModel m = layoutAdapter.getLayoutProperties(); |
||||
if (m != null) { |
||||
groups.add(new PropertyGroup(m)); |
||||
} |
||||
} |
||||
} |
||||
return groups; |
||||
} |
||||
|
||||
/** |
||||
* 初始化属性表组 |
||||
* @param source 控件 |
||||
*/ |
||||
public void initPropertyGroups(Object source) { |
||||
|
||||
groups = getCreatorPropertyGroup(xwBodyFitLayout); |
||||
|
||||
TableModel model = new BeanTableModel(); |
||||
setModel(model); |
||||
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); |
||||
TableColumn tc = this.getColumn(this.getColumnName(0)); |
||||
tc.setPreferredWidth(30); |
||||
this.repaint(); |
||||
} |
||||
|
||||
private void setDesigner(XWBodyFitLayout xwBodyFitLayout) { |
||||
this.xwBodyFitLayout = xwBodyFitLayout; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 单元格tooltip |
||||
* 属性名悬浮提示 |
||||
* |
||||
* @param 鼠标点击事件 |
||||
* @return 单元格tooltip |
||||
*/ |
||||
public String getToolTipText(MouseEvent event) { |
||||
int row = BodyAppRelayoutTable.super.rowAtPoint(event.getPoint()); |
||||
int column = BodyAppRelayoutTable.super.columnAtPoint(event.getPoint()); |
||||
if(row != -1 && column == 0){ |
||||
return String.valueOf(this.getValueAt(row, column)); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 待说明 |
||||
*/ |
||||
public void firePropertyEdit() { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,111 @@
|
||||
package com.fr.design.designer.properties; |
||||
|
||||
import com.fr.design.beans.GroupModel; |
||||
import com.fr.form.ui.container.WFitLayout; |
||||
import com.fr.design.designer.creator.XWFitLayout; |
||||
import com.fr.design.gui.icheckbox.UICheckBox; |
||||
import com.fr.design.mainframe.widget.editors.BooleanEditor; |
||||
import com.fr.design.mainframe.widget.editors.PropertyCellEditor; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.table.TableCellEditor; |
||||
import javax.swing.table.TableCellRenderer; |
||||
import java.awt.*; |
||||
|
||||
public class BodyMobileLayoutPropertiesGroupModel implements GroupModel { |
||||
private PropertyCellEditor reLayoutEditor; |
||||
private CheckBoxCellRenderer reLayoutrenderer; |
||||
private WFitLayout layout; |
||||
private XWFitLayout xfl; |
||||
|
||||
public BodyMobileLayoutPropertiesGroupModel(XWFitLayout xfl) { |
||||
this.xfl = xfl; |
||||
this.layout = xfl.toData(); |
||||
reLayoutrenderer = new CheckBoxCellRenderer(); |
||||
reLayoutEditor = new PropertyCellEditor(new BooleanEditor()); |
||||
} |
||||
|
||||
@Override |
||||
public String getGroupName() { |
||||
return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"); |
||||
} |
||||
|
||||
@Override |
||||
public int getRowCount() { |
||||
return 1; |
||||
} |
||||
|
||||
@Override |
||||
public TableCellRenderer getRenderer(int row) { |
||||
return reLayoutrenderer; |
||||
} |
||||
|
||||
@Override |
||||
public TableCellEditor getEditor(int row) { |
||||
return reLayoutEditor; |
||||
} |
||||
|
||||
@Override |
||||
public Object getValue(int row, int column) { |
||||
if (column == 0) { |
||||
return Inter.getLocText("FR-Designer-App_ReLayout"); |
||||
}else { |
||||
return layout.getAppRelayout(); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public boolean setValue(Object value, int row, int column) { |
||||
int state = 0; |
||||
boolean appRelayoutState = true; |
||||
if(value instanceof Integer) { |
||||
state = (Integer)value; |
||||
}else if (value instanceof Boolean) { |
||||
appRelayoutState = (boolean)value; |
||||
} |
||||
if (column == 0 || state < 0) { |
||||
return false; |
||||
} else { |
||||
layout.setAppRelayout(appRelayoutState); |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 是否可编辑 |
||||
* @param row 行 |
||||
* @return 否 |
||||
*/ |
||||
@Override |
||||
public boolean isEditable(int row) { |
||||
return true; |
||||
} |
||||
|
||||
private class CheckBoxCellRenderer extends UICheckBox implements TableCellRenderer { |
||||
|
||||
|
||||
public CheckBoxCellRenderer() { |
||||
super(); |
||||
setOpaque(true); |
||||
|
||||
} |
||||
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
||||
if (value instanceof Boolean) { |
||||
setSelected(((Boolean) value).booleanValue()); |
||||
setEnabled(table.isCellEditable(row, column)); |
||||
if (isSelected) { |
||||
setBackground(table.getSelectionBackground()); |
||||
setForeground(table.getSelectionForeground()); |
||||
} else { |
||||
setForeground(table.getForeground()); |
||||
setBackground(table.getBackground()); |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
return this; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fr.design.designer.properties.mobile; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.designer.creator.XWBodyFitLayout; |
||||
import com.fr.design.designer.properties.BodyAppRelayoutTable; |
||||
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; |
||||
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||
import com.fr.general.Inter; |
||||
|
||||
/** |
||||
* Created by Administrator on 2016/5/16/0016. |
||||
*/ |
||||
public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider { |
||||
|
||||
private XCreator xCreator; |
||||
|
||||
public BodyMobilePropertyUI(XWBodyFitLayout xWBodyFitLayout) { |
||||
this.xCreator = xWBodyFitLayout; |
||||
} |
||||
|
||||
@Override |
||||
public AbstractPropertyTable createWidgetAttrTable() { |
||||
return new BodyAppRelayoutTable((XWBodyFitLayout) xCreator); |
||||
} |
||||
|
||||
@Override |
||||
public String tableTitle() { |
||||
return Inter.getLocText("FR-Designer_Mobile-Attr"); |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.designer.properties.mobile; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.border.Border; |
||||
import javax.swing.border.EmptyBorder; |
||||
import javax.swing.plaf.UIResource; |
||||
import javax.swing.table.TableCellRenderer; |
||||
import java.awt.*; |
||||
|
||||
public class BooleanRender extends JCheckBox implements TableCellRenderer, UIResource { |
||||
private static final Border noFocusBorder = new EmptyBorder(1, 0, 0, 0); |
||||
|
||||
public BooleanRender() { |
||||
super(); |
||||
setHorizontalAlignment(JLabel.LEFT); |
||||
setBorderPainted(true); |
||||
} |
||||
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, |
||||
boolean isSelected, boolean hasFocus, int row, int column) { |
||||
if (isSelected) { |
||||
setForeground(table.getSelectionForeground()); |
||||
super.setBackground(table.getSelectionBackground()); |
||||
} |
||||
else { |
||||
setForeground(table.getForeground()); |
||||
setBackground(table.getBackground()); |
||||
} |
||||
setSelected((value != null && ((Boolean)value).booleanValue())); |
||||
|
||||
if (hasFocus) { |
||||
setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); |
||||
} else { |
||||
setBorder(noFocusBorder); |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
} |
@ -0,0 +1,59 @@
|
||||
package com.fr.design.gui.xtable; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.designer.creator.CRPropertyDescriptor; |
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.mainframe.FormDesigner; |
||||
import com.fr.general.Inter; |
||||
import java.lang.reflect.Method; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.report.stable.FormConstants; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
public class ReportAppPropertyGroupModel extends PropertyGroupModel { |
||||
|
||||
private static final double MAX_HEIGHT = 0.8; |
||||
|
||||
public ReportAppPropertyGroupModel(String name, XCreator creator, CRPropertyDescriptor[] propArray, |
||||
FormDesigner designer) { |
||||
super(name, creator, propArray, designer); |
||||
} |
||||
|
||||
@Override |
||||
public boolean setValue(Object value, int row, int column) { |
||||
double state = 0; |
||||
if (column == 0) { |
||||
return false; |
||||
} |
||||
if (value instanceof Double) { |
||||
state = (Double) value; |
||||
} |
||||
|
||||
try { |
||||
Method m = properties[row].getWriteMethod(); |
||||
if (state > MAX_HEIGHT) { |
||||
//弹窗提示
|
||||
JOptionPane.showMessageDialog(null, |
||||
Inter.getLocText("FR-Designer_Mobile-Warning"), |
||||
Inter.getLocText("FR-Designer_Tooltips"), |
||||
JOptionPane.PLAIN_MESSAGE); |
||||
return false; |
||||
} |
||||
m.invoke(dealCreatorData(), value); |
||||
//属性名称为控件名时,单独处理下
|
||||
if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){ |
||||
creator.resetCreatorName(value.toString()); |
||||
} |
||||
properties[row].firePropertyChanged(); |
||||
return true; |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
private Object dealCreatorData() { |
||||
return creator.getPropertyDescriptorCreator().toData(); |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.design.mainframe.widget.editors; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.KeyAdapter; |
||||
import java.awt.event.KeyEvent; |
||||
import java.awt.event.KeyListener; |
||||
import java.text.ParseException; |
||||
|
||||
public class RefinedDoubleEditor extends DoubleEditor { |
||||
|
||||
private JFormattedTextField textField; |
||||
|
||||
public RefinedDoubleEditor() { |
||||
super(); |
||||
textField = (JFormattedTextField) super.getCustomEditor(); |
||||
} |
||||
|
||||
@Override |
||||
public KeyListener createKeyListener() { |
||||
return new KeyAdapter() { |
||||
|
||||
public void keyReleased(KeyEvent e) { |
||||
try { |
||||
textField.commitEdit(); |
||||
return; |
||||
} catch (ParseException e1) { |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
} |