Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~wim.zhai/design into release/10.0

research/10.0
Wim.Zhai 6 years ago
parent
commit
fac5e41f0f
  1. 16
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 3
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  3. 33
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  4. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/OneListTableModel.java
  5. 2
      designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java
  6. 14
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  7. 7
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java
  9. 3
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java
  10. 2
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  11. 2
      designer-base/src/main/java/com/fr/file/FileFILE.java
  12. 26
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  13. 2
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  14. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

16
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -559,7 +559,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
DesignerEnvManager.getEnvManager().setCurEnvName(envName);
DesignUtils.refreshDesignerFrame();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
if(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate() != null) {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
}
DesignTableDataManager.fireDSChanged(new HashMap<String, String>());
}
});
@ -1292,22 +1294,26 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
// 用于兼容10.0之前的版本
int value = Integer.parseInt(tmpVal);
switch (value) {
//原来0、1都是中文
case 0:
setLanguage(Locale.SIMPLIFIED_CHINESE);
break;
case 1:
setLanguage(Locale.US);
setLanguage(Locale.SIMPLIFIED_CHINESE);
break;
case 2:
setLanguage(Locale.JAPAN);
setLanguage(Locale.US);
break;
case 3:
setLanguage(Locale.TRADITIONAL_CHINESE);
setLanguage(Locale.JAPAN);
break;
case 4:
setLanguage(Locale.KOREA);
setLanguage(Locale.TRADITIONAL_CHINESE);
break;
case 5:
setLanguage(Locale.KOREA);
break;
case 6:
setLanguage(new Locale("pt", "PT"));
break;
default:

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

@ -93,7 +93,8 @@ public class SwitchExistEnv extends MenuDef {
Workspace workspace;
try {
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"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return;

33
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -9,7 +9,6 @@ import com.fr.design.utils.DesignUtils;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.AbstractWebletCreator;
@ -82,27 +81,27 @@ public final class WebPreviewUtils {
String path = currentTemplate.getPath();
if (path.startsWith(ProjectConstants.REPORTLETS_NAME)) {
path = path.substring(ProjectConstants.REPORTLETS_NAME.length() + 1);
}
java.util.List<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
java.util.List<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
// 暂时屏蔽cptx直接访问
if (path.endsWith(FileExtension.CPTX.getSuffix())) {
path = path.substring(0, path.length() - 1);
parameterNameList.add(AbstractWebletCreator.FORMAT);
parameterValueList.add(AbstractWebletCreator.X);
}
// 暂时屏蔽cptx直接访问
if (path.endsWith(FileExtension.CPTX.getSuffix())) {
path = path.substring(0, path.length() - 1);
parameterNameList.add(AbstractWebletCreator.FORMAT);
parameterValueList.add(AbstractWebletCreator.X);
}
parameterNameList.add(actionType);
parameterValueList.add(path);
if (map != null) {
for (String key : map.keySet()) {
parameterNameList.add(key);
parameterValueList.add(GeneralUtils.objectToString(map.get(key)));
}
parameterNameList.add(actionType);
parameterValueList.add(path);
if (map != null) {
for (String key : map.keySet()) {
parameterNameList.add(key);
parameterValueList.add(GeneralUtils.objectToString(map.get(key)));
}
DesignUtils.visitEnvServerByParameters(baseRoute, parameterNameList.toArray(new String[parameterNameList.size()]), parameterValueList.toArray(new String[parameterValueList.size()]));
}
DesignUtils.visitEnvServerByParameters(baseRoute, parameterNameList.toArray(new String[parameterNameList.size()]), parameterValueList.toArray(new String[parameterValueList.size()]));
} else {
int selVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Web_Preview_Message"),
com.fr.design.i18n.Toolkit.i18nText("Preview_ToolTips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/OneListTableModel.java

@ -75,7 +75,7 @@ public abstract class OneListTableModel<T> extends UITableModelAdapter<T> {
if(!"js".equalsIgnoreCase(fileType)) {
return ;
}
String temp = file.getPath().substring(1);
String temp = file.getPath();
addRow((T) temp);
fireTableDataChanged();
}
@ -101,7 +101,7 @@ public abstract class OneListTableModel<T> extends UITableModelAdapter<T> {
if(!"css".equalsIgnoreCase(fileType)) {
return ;
}
String temp = file.getPath().substring(1);
String temp = file.getPath();
addRow((T) temp);
fireTableDataChanged();
}

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;
}
}

2
designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java

@ -155,7 +155,7 @@ public abstract class WidgetOption implements Serializable {
Button.class);
public static final WidgetOption FREEBUTTON = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Widget_Type_Free_Button"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Widget_Type_Button"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16.png"),
FreeButton.class);
public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass(

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);
try {
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"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
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());
if (GeneralContext.getLocale() == Locale.CHINA || GeneralContext.getLocale() == Locale.TAIWAN) {
if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) {
// 添加社区菜单
addCommunityMenuDef(menuList);
}

2
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -4,7 +4,7 @@ import com.fr.base.io.XMLEncryptUtils;
import com.fr.design.gui.itree.filetree.FileComparator;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.general.ComparatorUtils;
import com.fr.general.SessionLocalManager;
import com.fr.web.session.SessionLocalManager;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;

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(); // 触发设计器保存按钮亮起来
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -4,7 +4,7 @@ import com.fr.base.io.IOFile;
import com.fr.base.io.XMLReadHelper;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.general.SessionLocalManager;
import com.fr.web.session.SessionLocalManager;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;

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

@ -35,6 +35,7 @@ public class DesignerStartup extends Activator {
final Designer designer = new Designer(args);
startSub(DesignerWorkspaceProvider.class);
registerEnvListener();
//启动env
startSub(EnvBasedModule.class);
@ -48,7 +49,6 @@ public class DesignerStartup extends Activator {
}
}
ExecutorService service = Executors.newSingleThreadExecutor();
registerEnvListener();
service.submit(new Runnable() {
@Override
public void run() {

Loading…
Cancel
Save