Browse Source

REPORT-9953 & REPORT-10231

research/10.0
Mata.Li 6 years ago
parent
commit
2412d0d264
  1. 6
      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. 6
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java
  6. 26
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

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

@ -93,7 +93,13 @@ public class SwitchExistEnv extends MenuDef {
Workspace workspace;
try {
workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
boolean checkValid = true;
if (workspace == null) {
checkValid = false;
}else {
checkValid = selectedEnv.checkValid();
}
if (!checkValid) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Switch_Workspace_Failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
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();
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;
import com.fr.base.EnvException;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
@ -7,6 +9,8 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.workspace.connect.WorkspaceConnection;
import java.io.File;
/**
* Created by juhaoyu on 2018/6/15.
*/
@ -69,4 +73,14 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
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);
return object;
}
@Override
public boolean checkValid(){
return true;
}
}

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

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

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

Loading…
Cancel
Save