Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~kerry/design_10.0 into release/10.0

feature/big-screen
kerry 5 years ago
parent
commit
0df83fd312
  1. 95
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 12
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  3. 3
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  4. 1
      designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java
  5. 4
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  6. 53
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java
  7. 2
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

95
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,10 +1,9 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -30,12 +29,14 @@ import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.update.push.DesignerPushUpdateManager;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
@ -50,6 +51,8 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Window;
@ -60,6 +63,7 @@ import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.net.URI;
import java.util.Locale;
import java.util.Map;
@ -107,6 +111,7 @@ public class PreferencePane extends BasicPane {
private static final String DISPLAY_EQUALS = "+";
private static final String MINUS = "MINUS";
private static final String DISPLAY_MINUS = "-";
private static final String PRIVACY_POLICY = "design.privacy";
private static final Level[] LOG = {Level.FATAL, Level.ERROR, Level.WARN, Level.INFO, Level.DEBUG};
@ -149,6 +154,7 @@ public class PreferencePane extends BasicPane {
private UICheckBox useIntervalCheckBox;
private IntegerEditor saveIntervalEditor;
private UILabel remindVcsLabel;
private UILabel linkLabel;
@ -190,25 +196,44 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace);
JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Develop_Tools"));
openDebugComboBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));
debuggerPane.add(openDebugComboBox, BorderLayout.CENTER);
advancePane.add(debuggerPane);
JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
useOptimizedUPMCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
upmSelectorPane.add(useOptimizedUPMCheckbox);
advancePane.add(upmSelectorPane);
JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Manager"));
useUniverseDBMCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
dbmSelectorPane.add(useUniverseDBMCheckbox);
advancePane.add(dbmSelectorPane);
// JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Develop_Tools"));
// openDebugComboBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));
// debuggerPane.add(openDebugComboBox, BorderLayout.CENTER);
// advancePane.add(debuggerPane);
//
// JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
// useOptimizedUPMCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
// upmSelectorPane.add(useOptimizedUPMCheckbox);
// advancePane.add(upmSelectorPane);
//
// JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Manager"));
// useUniverseDBMCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
// dbmSelectorPane.add(useUniverseDBMCheckbox);
// advancePane.add(dbmSelectorPane);
JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Product_Improve"));
joinProductImproveCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImproveCheckBox);
linkLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Privacy_Policy"));
linkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
linkLabel.setForeground(UIConstants.NORMAL_BLUE);
linkLabel.addMouseListener(new MouseAdapter(){
@Override
public void mouseClicked(MouseEvent e) {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind(PRIVACY_POLICY)));
} catch (Exception e1) {
FineLoggerFactory.getLogger().error(e1.getMessage(), e1);
}
}
});
double p = TableLayout.PREFERRED;
double rowSize[] = {p};
double columnSize[] = {p, p};
Component[][] components = {
{joinProductImproveCheckBox, linkLabel},
};
JPanel choosePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
improvePane.add(choosePane);
if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) {
autoPushUpdateCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox);
@ -648,10 +673,10 @@ public class PreferencePane extends BasicPane {
this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort()));
openDebugComboBox.setSelected(designerEnvManager.isOpenDebug());
useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
// openDebugComboBox.setSelected(designerEnvManager.isOpenDebug());
// useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
//
// useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit());
@ -716,7 +741,7 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setJettyServerPort(portEditor.getValue().intValue());
designerEnvManager.setOpenDebug(openDebugComboBox.isSelected());
// designerEnvManager.setOpenDebug(openDebugComboBox.isSelected());
designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected());
designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue());
@ -747,18 +772,18 @@ public class PreferencePane extends BasicPane {
}
});
Configurations.update(new Worker() {
@Override
public void run() {
ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[] {ServerPreferenceConfig.class};
}
});
// Configurations.update(new Worker() {
// @Override
// public void run() {
// ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
// ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected());
// }
//
// @Override
// public Class<? extends Configuration>[] targets() {
// return new Class[] {ServerPreferenceConfig.class};
// }
// });
}

12
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -269,11 +269,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
if (size == index + 1 && index > 0) {
//如果删除的是后一个Tab,则定位到前一个
MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1);
JTemplate selectedFile = MutilTempalteTabPane.getInstance().getSelectedFile();
if (!isCurrentEditingFile(selectedFile.getPath())) {
//如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样
DesignerContext.getDesignerFrame().activateJTemplate(selectedFile);
}
}
}
}
@ -282,6 +277,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
if (openFileCount == 0) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate();
}
JTemplate selectedFile = MutilTempalteTabPane.getInstance().getSelectedFile();
if (!isCurrentEditingFile(selectedFile.getPath())) {
//如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样
DesignerContext.getDesignerFrame().activateJTemplate(selectedFile);
}
MutilTempalteTabPane.getInstance().repaint();
}

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

@ -156,6 +156,9 @@ public class MutilTempalteTabPane extends JComponent {
}
public JTemplate getSelectedFile() {
if (openedTemplate.size() == selectedIndex) {
selectedIndex = Math.max(--selectedIndex, 0);
}
return openedTemplate.get(selectedIndex);
}

1
designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java

@ -12,6 +12,7 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JDialog;

4
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -362,10 +362,10 @@ public class UpdateMainDialog extends UIDialog {
add(jarVersionInfoPane, BorderLayout.NORTH);
//海外版本不显示更新信息
if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)){
if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) {
add(jarUpdateInfoPane, BorderLayout.CENTER);
add(updateActionPane, BorderLayout.SOUTH);
}else {
} else {
add(updateActionPane, BorderLayout.CENTER);
}

53
designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java

@ -0,0 +1,53 @@
package com.fr.design.mainframe.messagecollect.solid;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import java.util.HashMap;
import java.util.Map;
/**
* 设计器固化信息回传类
* Created by alex sung on 2019/8/22.
*/
public class SolidCollector {
private static final String CONTENT_URL = "/v10/collect/solid";
private static final String DELETE_URL = "/v10/collect/solid/delete";
/**
* 回传文件给云中心并删除服务端本地文件
*/
public void sendToCloudCenterAndDeleteFile() {
try {
String content = requestContent();
if(StringUtils.isNotEmpty(content)){
String url = "";
Map<String, Object> params = new HashMap<>();
params.put("content", requestContent());
HttpToolbox.post(url, params);
String deleteUrl = WorkContext.getCurrent().getPath() + DELETE_URL;
HttpToolbox.post(deleteUrl, new HashMap<String, Object>());
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
/**
* 获取服务端固化文件内容
* @return 回传内容
*/
public String requestContent() {
String content = null;
try {
String url = WorkContext.getCurrent().getPath() + CONTENT_URL;
content = HttpToolbox.get(url);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return content;
}
}

2
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -427,7 +427,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
dealSelectColRow(add, cellselection);
} else {
ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
String allColumnRow = columnRow.toString();
String allColumnRow = newValue.toString();
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}

Loading…
Cancel
Save