Browse Source

Merge pull request #1601 in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit 'caeeffcf674e3be80b2a2a69e433424c83f15f71':
  fix 漏交
  MOBILE-26198 && MOBILE-26189
  REPORT-29118 && REPORT-29117
feature/big-screen
Hades 5 years ago
parent
commit
ece216b229
  1. 8
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  2. 67
      designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java
  3. 3
      designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java
  4. 137
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java
  5. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  6. 169
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java
  7. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java
  8. 8
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

8
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java

@ -360,6 +360,14 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
popup.setSelectedValue(map); popup.setSelectedValue(map);
} }
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
this.popup.setEnabled(enabled);
this.editor.setEnabled(enabled);
this.arrowButton.setEnabled(enabled);
}
/** /**
* 简单的测试demo * 简单的测试demo
* @param args * @param args

67
designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java

@ -1,7 +1,10 @@
package com.fr.design.os.impl; package com.fr.design.os.impl;
import com.fr.design.actions.help.AboutDialog;
import com.fr.design.actions.help.AboutPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSBasedAction;
@ -21,25 +24,55 @@ public class MacOsAddListenerAction implements OSBasedAction {
public void execute(final Object... objects) { public void execute(final Object... objects) {
try { try {
Class app = Class.forName("com.apple.eawt.Application"); Class app = Class.forName("com.apple.eawt.Application");
Class handler = Class.forName("com.apple.eawt.QuitHandler"); Class quitHandler = Class.forName("com.apple.eawt.QuitHandler");
Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction());
new InvocationHandler() { Class aboutHandler = Class.forName("com.apple.eawt.AboutHandler");
@Override Object aboutInstance = getProxy(aboutHandler, "handleAbout", new AboutAction());
public Object invoke(Object proxy, Method method, Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", quitInstance)
Object[] args) throws Throwable { .call("setAboutHandler", aboutInstance);
if ("handleQuitRequestWith".equals(method.getName())) {
if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) {
DesignerContext.getDesignerFrame().exit();
} else {
DesignerExiter.getInstance().execute();
}
}
return null;
}
});
Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
private Object getProxy(Class clazz, final String methodName, final Action action) {
return Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {
if (ComparatorUtils.equals(methodName, method.getName())) {
action.execute();
}
return null;
}
});
}
interface Action {
void execute();
}
private class QuitAction implements Action {
@Override
public void execute() {
if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) {
DesignerContext.getDesignerFrame().exit();
} else {
DesignerExiter.getInstance().execute();
}
}
}
private class AboutAction implements Action {
@Override
public void execute() {
AboutPane aboutPane = new AboutPane();
AboutDialog aboutDialog = new AboutDialog(DesignerContext.getDesignerFrame(), aboutPane);
aboutDialog.setVisible(true);
}
}
} }

3
designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java

@ -6,6 +6,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI;
import com.fr.design.designer.properties.mobile.MobileStylePropertyUI; import com.fr.design.designer.properties.mobile.MobileStylePropertyUI;
@ -179,7 +180,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
if (selection != null && xCreator != null) { if (selection != null && xCreator != null) {
embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders();
if(!designer.getDesignerMode().isFormParameterEditor()) { if(!designer.getDesignerMode().isFormParameterEditor()) {
if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) {
embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator));
} }
if (xCreator.supportMobileStyle()) { if (xCreator.supportMobileStyle()) {

137
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java

@ -1,40 +1,14 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import com.fr.form.main.Form;
import com.fr.form.ui.FormWidgetHelper;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.mobile.MobileBookMark;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Iterator;
import java.util.List;
/** /**
* @author hades * @author hades
@ -44,8 +18,7 @@ import java.util.List;
public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
private XCreator xCreator; private XCreator xCreator;
private UICheckBox useBookMarkCheck; private MobileAdvanceInnerPane innerPane;
private UITextField bookMarkNameField;
public MobileAdvanceDefinePane(XCreator xCreator) { public MobileAdvanceDefinePane(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
@ -54,71 +27,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
@Override @Override
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.innerPane = new MobileAdvanceInnerPane(xCreator);
this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, innerPane);
this.bookMarkNameField = new UITextField() {
@Override
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
attributeChange();
}
}
});
}
}
};
JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{useBookMarkCheck}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
this.useBookMarkCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean selected = MobileAdvanceDefinePane.this.useBookMarkCheck.isSelected();
Widget widget = MobileAdvanceDefinePane.this.xCreator.toData();
MobileBookMark bookMark = widget.getMobileBookMark();
bookMarkNamePane.setVisible(selected);
if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) {
String name = widget.getWidgetName();
MobileAdvanceDefinePane.this.bookMarkNameField.setText(name);
bookMark.setBookMarkName(name);
}
}
});
bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark());
contentPane.add(useBookMarkPane, BorderLayout.NORTH);
contentPane.add(bookMarkNamePane, BorderLayout.CENTER);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, contentPane);
JPanel wrapPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel wrapPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
wrapPane.add(uiExpandablePane, BorderLayout.NORTH); wrapPane.add(uiExpandablePane, BorderLayout.NORTH);
this.add(wrapPane, BorderLayout.NORTH); this.add(wrapPane, BorderLayout.NORTH);
initData();
} }
private void initData() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
String bookMarkName = bookMark.getBookMarkName();
if (StringUtils.isEmpty(bookMarkName)) {
String widgetName = xCreator.toData().getWidgetName();
this.bookMarkNameField.setText(widgetName);
bookMark.setBookMarkName(widgetName);
} else {
this.bookMarkNameField.setText(bookMarkName);
}
}
private void bindListeners2Widgets() { private void bindListeners2Widgets() {
reInitAllListeners(); reInitAllListeners();
@ -147,53 +62,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
@Override @Override
public void populate(FormDesigner designer) { public void populate(FormDesigner designer) {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); this.innerPane.populate();
this.bookMarkNameField.setText(bookMark.getBookMarkName());
if (bookMark.isFrozen()) {
this.useBookMarkCheck.setSelected(false);
this.useBookMarkCheck.setEnabled(false);
} else {
this.useBookMarkCheck.setSelected(bookMark.isUseBookMark());
}
this.bindListeners2Widgets(); this.bindListeners2Widgets();
} }
@Override @Override
public void update() { public void update() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); this.innerPane.update();
bookMark.setUseBookMark(this.useBookMarkCheck.isSelected());
String newBookMarkName = this.bookMarkNameField.getText();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) {
return;
}
if (!isExist(newBookMarkName)) {
bookMark.setBookMarkName(newBookMarkName);
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"),
JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
this.bookMarkNameField.setText(bookMark.getBookMarkName());
}
}
private boolean isExist(String name) {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
Widget widget = form.getWidgetByName(value);
if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) {
return true;
}
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) {
return true;
}
}
return false;
} }
} }

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -15,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor;
import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane;
@ -33,6 +34,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
private MobileComponentMarginPane marginPane; private MobileComponentMarginPane marginPane;
private MobileComponentLayoutIntervalPane intervalPane; private MobileComponentLayoutIntervalPane intervalPane;
private MobileBookMarkUsePane mobileBookMarkUsePane; private MobileBookMarkUsePane mobileBookMarkUsePane;
private MobileAdvanceInnerPane mobileAdvanceInnerPane;
public TabMobileWidgetDefinePane(XCreator xCreator) { public TabMobileWidgetDefinePane(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
@ -70,9 +72,12 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG);
if (FormDesignerUtils.isAppRelayout(designer)) { if (FormDesignerUtils.isAppRelayout(designer)) {
mobileBookMarkUsePane = new MobileBookMarkUsePane(); mobileBookMarkUsePane = new MobileBookMarkUsePane();
innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.SOUTH); mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator);
innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER);
innerAdvancePane.add(mobileAdvanceInnerPane, BorderLayout.SOUTH);
} }
innerAdvancePane.add(marginPane, BorderLayout.CENTER); innerAdvancePane.add(marginPane, BorderLayout.NORTH);
UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane);
UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane);
//高级 //高级
@ -100,6 +105,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
if (mobileBookMarkUsePane != null) { if (mobileBookMarkUsePane != null) {
mobileBookMarkUsePane.populate(xCreator); mobileBookMarkUsePane.populate(xCreator);
} }
if (mobileAdvanceInnerPane != null) {
mobileAdvanceInnerPane.populate();
}
} }
@Override @Override
@ -116,5 +124,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
if (mobileBookMarkUsePane != null) { if (mobileBookMarkUsePane != null) {
mobileBookMarkUsePane.update(xCreator); mobileBookMarkUsePane.update(xCreator);
} }
if (mobileAdvanceInnerPane != null) {
this.mobileAdvanceInnerPane.update();
}
} }
} }

169
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java

@ -0,0 +1,169 @@
package com.fr.design.widget.ui.designer.mobile.component;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.main.Form;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.mobile.MobileBookMark;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.List;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/4/17
*/
public class MobileAdvanceInnerPane extends BasicPane {
private XCreator xCreator;
private UICheckBox useBookMarkCheck;
private UITextField bookMarkNameField;
public MobileAdvanceInnerPane(XCreator xCreator) {
this.xCreator = xCreator;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initComponent();
}
private void initComponent() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false);
this.bookMarkNameField = new UITextField() {
@Override
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
attributeChange();
}
}
});
}
}
};
JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{useBookMarkCheck}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
this.useBookMarkCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean selected = MobileAdvanceInnerPane.this.useBookMarkCheck.isSelected();
Widget widget = MobileAdvanceInnerPane.this.xCreator.toData();
MobileBookMark bookMark = widget.getMobileBookMark();
bookMarkNamePane.setVisible(selected);
if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) {
String name = widget.getWidgetName();
MobileAdvanceInnerPane.this.bookMarkNameField.setText(name);
bookMark.setBookMarkName(name);
}
}
});
bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark());
contentPane.add(useBookMarkPane, BorderLayout.NORTH);
contentPane.add(bookMarkNamePane, BorderLayout.CENTER);
this.add(contentPane);
initData();
}
private void initData() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
String bookMarkName = bookMark.getBookMarkName();
if (StringUtils.isEmpty(bookMarkName)) {
String widgetName = xCreator.toData().getWidgetName();
this.bookMarkNameField.setText(widgetName);
bookMark.setBookMarkName(widgetName);
} else {
this.bookMarkNameField.setText(bookMarkName);
}
}
public void populate() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
this.bookMarkNameField.setText(bookMark.getBookMarkName());
if (bookMark.isFrozen()) {
this.useBookMarkCheck.setSelected(false);
this.useBookMarkCheck.setEnabled(false);
} else {
this.useBookMarkCheck.setSelected(bookMark.isUseBookMark());
}
}
public void update() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
bookMark.setUseBookMark(this.useBookMarkCheck.isSelected());
String newBookMarkName = this.bookMarkNameField.getText();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) {
return;
}
if (!isExist(newBookMarkName)) {
bookMark.setBookMarkName(newBookMarkName);
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"),
JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
this.bookMarkNameField.setText(bookMark.getBookMarkName());
}
}
private boolean isExist(String name) {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
Widget widget = form.getWidgetByName(value);
if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) {
return true;
}
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) {
return true;
}
}
return false;
}
@Override
protected String title4PopupWindow() {
return "MobileAdvanceInnerPane";
}
}

19
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java

@ -11,9 +11,12 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.main.Form;
import com.fr.form.ui.FormWidgetHelper; import com.fr.form.ui.FormWidgetHelper;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -97,6 +100,22 @@ public class MobileComponentFrozenPane extends BasicPane {
map.put(value, false); map.put(value, false);
} }
uiComboCheckBox.setSelectedValues(map); uiComboCheckBox.setSelectedValues(map);
if (ArrayUtils.isEmpty(uiComboCheckBox.getSelectedValues()) || !uiComboCheckBox.isEnabled()) {
uiComboCheckBox.setEnabled(!shouldFrozen());
}
}
private boolean shouldFrozen() {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
boolean frozen = false;
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
frozen = frozen || boundsWidget.getWidget().getMobileBookMark().isUseBookMark();
}
return frozen;
} }
@Override @Override

8
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -16,11 +16,11 @@ import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.DesignerPort; import com.fr.design.utils.DesignerPort;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics; import com.fr.record.analyzer.Metrics;
import com.fr.stable.ArrayUtils;
import com.fr.stable.BuildContext; import com.fr.stable.BuildContext;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -35,8 +35,6 @@ import com.fr.start.server.FineEmbedServer;
import com.fr.value.NotNullLazyValue; import com.fr.value.NotNullLazyValue;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import java.io.File; import java.io.File;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -71,7 +69,9 @@ public class DesignerStartup extends Activator {
if (DesignUtils.isStarted()) { if (DesignUtils.isStarted()) {
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
final String[] args = startupArgsValue.getValue().get(); final String[] args = startupArgsValue.getValue().get();
DesignUtils.clientSend(args); if (ArrayUtils.isNotEmpty(args)) {
DesignUtils.clientSend(args);
}
FineLoggerFactory.getLogger().info("The Designer Has Been Started"); FineLoggerFactory.getLogger().info("The Designer Has Been Started");
if (args.length == 0) { if (args.length == 0) {
TipDialog dialog = new TipDialog(null, TipDialog dialog = new TipDialog(null,

Loading…
Cancel
Save