Browse Source

Merge pull request #302 in DESIGN/design from ~MATA.LI/designrel:release/10.0 to release/10.0

* commit '95581eae868c3f2187c789363baaba8ebbb9abb9':
  REPORT-9953 &  REPORT-10231
  REPORT-9953 &  REPORT-10231
research/10.0
Mata.Li 6 years ago
parent
commit
e95a67b415
  1. 3
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 2
      designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java
  3. 14
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  4. 7
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java
  6. 2
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  7. 26
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

3
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -93,7 +93,8 @@ public class SwitchExistEnv extends MenuDef {
Workspace workspace; Workspace workspace;
try { try {
workspace = DesignerWorkspaceGenerator.generate(selectedEnv); workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) { boolean checkValid = workspace == null ? false : selectedEnv.checkValid();
if (!checkValid) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Switch_Workspace_Failed"), JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Switch_Workspace_Failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon")); null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return; return;

2
designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java vendored

@ -11,4 +11,6 @@ public interface DesignerWorkspaceInfo extends XMLable {
String getPath(); String getPath();
WorkspaceConnection getConnection(); WorkspaceConnection getConnection();
boolean checkValid();
} }

14
designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java vendored

@ -1,5 +1,7 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.base.EnvException;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -7,6 +9,8 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnection;
import java.io.File;
/** /**
* Created by juhaoyu on 2018/6/15. * Created by juhaoyu on 2018/6/15.
*/ */
@ -69,4 +73,14 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
return object; return object;
} }
@Override
public boolean checkValid(){
File file = new File(this.path);
if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF")) {
return false;
}
return true;
}
} }

7
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -86,4 +86,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
object.connection = (WorkspaceConnection) StableUtils.cloneObject(this.connection); object.connection = (WorkspaceConnection) StableUtils.cloneObject(this.connection);
return object; return object;
} }
@Override
public boolean checkValid(){
return true;
}
} }

3
designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

@ -147,7 +147,8 @@ public class TemplatePane extends JPanel implements MouseListener {
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedName); DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedName);
try { try {
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) { boolean checkValid = workspace == null ? false : selectedEnv.checkValid();
if (!checkValid) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Switch_Workspace_Failed"), JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Switch_Workspace_Failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon")); null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false; return false;

2
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -234,7 +234,7 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单 // 添加帮助菜单
menuList.add(createHelpMenuDef()); menuList.add(createHelpMenuDef());
if (GeneralContext.getLocale() == Locale.CHINA || GeneralContext.getLocale() == Locale.TAIWAN) { if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) {
// 添加社区菜单 // 添加社区菜单
addCommunityMenuDef(menuList); addCommunityMenuDef(menuList);
} }

26
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -87,6 +87,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
unavailableTipLabel.setText("<html>" + tipText + "<html>"); unavailableTipLabel.setText("<html>" + tipText + "<html>");
unavailableTipLabel.setForeground(Color.gray); unavailableTipLabel.setForeground(Color.gray);
panel.add(unavailableTipLabel, BorderLayout.NORTH); panel.add(unavailableTipLabel, BorderLayout.NORTH);
allowFullCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Allow_Full_Screen"));
panel.add(allowFullCheckBox);
return panel; return panel;
} }
@ -150,19 +152,20 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
public void populate(FormDesigner designer) { public void populate(FormDesigner designer) {
this.designer = designer; this.designer = designer;
BaseChartEditor chartEditor = (BaseChartEditor)xCreator.toData();
boolean allowFullScreen = chartEditor.getMobileAttr().isAllowFullScreen();
this.allowFullCheckBox.setSelected(allowFullScreen);
this.bindListeners2Widgets();
this.addAttributeChangeListener(changeListener);
if (!isAppRelayout() || isInAbsoluteLayout()) { if (!isAppRelayout() || isInAbsoluteLayout()) {
return; return;
} }
BaseChartEditor chartEditor = (BaseChartEditor)xCreator.toData();
ChartMobileFitAttrStateProvider zoomOutAttr = chartEditor.getMobileAttr().getZoomOutAttr(); ChartMobileFitAttrStateProvider zoomOutAttr = chartEditor.getMobileAttr().getZoomOutAttr();
this.zoomOutComboBox.setSelectedItem(new Item(zoomOutAttr.description(), zoomOutAttr)); this.zoomOutComboBox.setSelectedItem(new Item(zoomOutAttr.description(), zoomOutAttr));
updateTipLabel(); updateTipLabel();
boolean allowFullScreen = chartEditor.getMobileAttr().isAllowFullScreen();
this.allowFullCheckBox.setSelected(allowFullScreen);
// 数据 populate 完成后,再设置监听
this.bindListeners2Widgets();
this.zoomOutComboBox.addItemListener(new ItemListener() { this.zoomOutComboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
@ -171,21 +174,24 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
return; return;
} }
updateTipLabel(); updateTipLabel();
ChartMobileFitAttrState selectedAttr = (ChartMobileFitAttrState)((Item)e.getItem()).getValue(); ChartMobileFitAttrState selectedAttr = (ChartMobileFitAttrState) ((Item) e.getItem()).getValue();
if (selectedAttr.getState() != ChartMobileFitAttrState.AUTO.getState()) { if (selectedAttr.getState() != ChartMobileFitAttrState.AUTO.getState()) {
} }
} }
}); });
this.addAttributeChangeListener(changeListener);
} }
@Override @Override
public void update() { public void update() {
ChartMobileAttrProvider mobileAttr = ((BaseChartEditor)xCreator.toData()).getMobileAttr(); ChartMobileAttrProvider mobileAttr = ((BaseChartEditor)xCreator.toData()).getMobileAttr();
mobileAttr.setZoomInAttr(ChartMobileFitAttrState.PROPORTION); if(zoomOutComboBox != null) {
mobileAttr.setZoomOutAttr((ChartMobileFitAttrState)((Item)zoomOutComboBox.getSelectedItem()).getValue()); mobileAttr.setZoomInAttr(ChartMobileFitAttrState.PROPORTION);
mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setZoomOutAttr((ChartMobileFitAttrState) ((Item) zoomOutComboBox.getSelectedItem()).getValue());
mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected());
}else {
mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected());
}
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
} }
} }

Loading…
Cancel
Save