Browse Source

无JIRA任务, 冲突修正

master
neil 8 years ago
parent
commit
3282a9d70e
  1. 62
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  2. 9
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  3. 58
      designer_base/src/com/fr/env/RemoteEnv.java
  4. 6
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

62
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -2,6 +2,7 @@ package com.fr.design.actions.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -28,9 +29,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
/** /**
* 选项对话框 * 选项对话框
@ -73,14 +72,16 @@ public class PreferencePane extends BasicPane {
private static final String DISPLAY_MINUS = "-"; private static final String DISPLAY_MINUS = "-";
private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG};
private static java.util.List<String> LANGUAGE = new ArrayList<>(); private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"),
static { getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE),
Map<Locale, String> map = Inter.getSupportLocaleMap(); getLocaledLanguage("English_Language", Locale.ENGLISH),
LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default")); getLocaledLanguage("Japanese_Language", Locale.JAPAN),
for(Locale locale : map.keySet()){ getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE),
LANGUAGE.add(getLocaledLanguage(map.get(locale), locale)); getLocaledLanguage("Korea_Language",Locale.KOREA),
}
}; };
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private boolean languageChanged; // 是否修改了设计器语言设置
//设置是否支持undo //设置是否支持undo
private UICheckBox supportUndoCheckBox; private UICheckBox supportUndoCheckBox;
@ -358,7 +359,7 @@ public class PreferencePane extends BasicPane {
JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language")); JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language"));
generalPane.add(languageAndDashBoard_pane); generalPane.add(languageAndDashBoard_pane);
languageAndDashBoard_pane.add(LanguagePane); languageAndDashBoard_pane.add(LanguagePane);
languageComboBox = new UIComboBox(LANGUAGE.toArray()); languageComboBox = new UIComboBox(LANGUAGE);
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文 languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文
ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language")); ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language"));
languageLabel.addActionListener(new ActionListener() { languageLabel.addActionListener(new ActionListener() {
@ -529,7 +530,8 @@ public class PreferencePane extends BasicPane {
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage())); this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]);
designerEnvLanguageIndex = designerEnvManager.getLanguage();
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
@ -616,12 +618,46 @@ public class PreferencePane extends BasicPane {
private int getLanguageInt() { private int getLanguageInt() {
int l = 0; int l = 0;
String lang = (String) this.languageComboBox.getSelectedItem(); String lang = (String) this.languageComboBox.getSelectedItem();
for (int i = 0; i < LANGUAGE.size(); i++) { for (int i = 0; i < LANGUAGE.length; i++) {
if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) { if (ComparatorUtils.equals(lang, LANGUAGE[i])) {
l = i; l = i;
break; break;
} }
} }
return l; return l;
} }
// 如果语言设置改变了,则显示重启对话框
public void showRestartDialog() {
if (!languageChanged) {
return;
}
int rv = JOptionPane.showOptionDialog(
null,
Inter.getLocText("FR-Designer_Language_Change_Successful"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")},
null
);
if (rv == JOptionPane.OK_OPTION) {
RestartHelper.restart();
}
}
@Override
public BasicDialog showWindow(Window window) {
return showWindow(window, new DialogActionAdapter() {
@Override
public void doOk() {
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) {
languageChanged = true;
} else {
languageChanged = false;
}
}
});
}
} }

9
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -38,6 +38,7 @@ import java.awt.dnd.DnDConstants;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -275,13 +276,15 @@ public class TableDataTreePane extends BasicTableDataTreePane {
* @param srcName 数据集来源(比如报表块就是报表块的名称) * @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集 * @param tableDataSource 数据集
*/ */
public void addTableData(String srcName, TableDataSource tableDataSource) { public Map<String, String> addTableData(String srcName, TableDataSource tableDataSource) {
Map<String, String> tdNameMap = new HashMap<>();
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook(); TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator(); Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next(); String tdName = (String) tdIterator.next();
String oldName = tdName;
TableData td = tableDataSource.getTableData(tdName); TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName; tdName = srcName + tdName;
@ -292,8 +295,12 @@ public class TableDataTreePane extends BasicTableDataTreePane {
tdName += i; tdName += i;
} }
tds.putTableData(tdName, td); tds.putTableData(tdName, td);
if (!ComparatorUtils.equals(oldName, tdName)) {
tdNameMap.put(oldName, tdName);
}
} }
tc.parameterChanged(); tc.parameterChanged();
dataTree.refresh(); dataTree.refresh();
return Collections.unmodifiableMap(tdNameMap);
} }
} }

58
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -2114,6 +2114,7 @@ public class RemoteEnv implements Env {
StableUtils.mkdirs(target); StableUtils.mkdirs(target);
File cacheDir = null; File cacheDir = null;
File zip = null; File zip = null;
OutputStream out = null;
try { try {
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
@ -2122,16 +2123,15 @@ public class RemoteEnv implements Env {
para.put("currentUsername", this.getUser()); para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para); HttpClient client = createHttpMethod(para);
InputStream input = client.getResponseStream(); InputStream input = client.getResponseStream();//拿到服务端传过来的整个共享文件夹的压缩文件的文件流
zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip");
cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE);
StableUtils.deleteFile(cacheDir); StableUtils.deleteFile(cacheDir);
StableUtils.mkdirs(cacheDir); StableUtils.mkdirs(cacheDir);
StableUtils.makesureFileExist(zip); StableUtils.makesureFileExist(zip);
FileOutputStream out = new FileOutputStream(zip); out = new FileOutputStream(zip);
IOUtils.copyBinaryTo(input, out); IOUtils.copyBinaryTo(input, out);//放到本地缓存目录下
out.flush();
out.close();
IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录 IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录
if (cacheDir.exists() && cacheDir.isDirectory()) { if (cacheDir.exists() && cacheDir.isDirectory()) {
return cacheDir.listFiles(new FilenameFilter() { return cacheDir.listFiles(new FilenameFilter() {
@ -2144,6 +2144,10 @@ public class RemoteEnv implements Env {
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} finally { } finally {
if (out != null) {
out.flush();
out.close();
}
StableUtils.deleteFile(zip); StableUtils.deleteFile(zip);
} }
return new File[0]; return new File[0];
@ -2151,26 +2155,34 @@ public class RemoteEnv implements Env {
@Override @Override
public boolean installREUFile(File reuFile) { public boolean installREUFile(File reuFile) {
// if (reuFile == null) { if (reuFile == null) {
// return false;
// }
// try {
// HashMap<String, String> para = new HashMap<String, String>();
// para.put("op", "fr_remote_design");
// para.put("cmd", "design_install_reufile");
// para.put("current_uid", this.createUserID());
// para.put("currentUsername", this.getUser());
// para.put("reuFileName", reuFile.getName());
//
// HttpClient client = createHttpMethod(para);
// client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(reuFile)));
// InputStream input = execute4InputStream(client);
// return ComparatorUtils.equals(stream2String(input), "true");
// } catch (Exception e) {
// return false;
// }
return false; return false;
} }
File tempFile = new File(CacheManager.getProviderInstance().getCacheDirectory(), "temp_remote");
IOUtils.unzip(reuFile, tempFile.getAbsolutePath());
String shareXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_MODULE);
String helpXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_HELP);
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_install_reufile");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
para.put("reuFileName", reuFile.getName());
HttpClient client = createHttpMethod(para);
client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(new File(shareXMLName))));
InputStream input = execute4InputStream(client);
client.release();
para.put("isComplete", "true");
HttpClient client1 = createHttpMethod(para);
client1.setContent(IOUtils.inputStream2Bytes(new FileInputStream(new File(helpXMLName))));
InputStream input1 = execute4InputStream(client1);
return ComparatorUtils.equals(stream2String(input), "true") && ComparatorUtils.equals(stream2String(input1), "true");
} catch (Exception e) {
return false;
}
}
@Override @Override
public boolean removeREUFilesByName(String fileName) { public boolean removeREUFilesByName(String fileName) {

6
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -10,18 +10,15 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.designer.properties.WidgetPropertyTable;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import java.awt.*; import java.awt.*;
@ -38,7 +35,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
private EventPropertyTable eventTable; private EventPropertyTable eventTable;
private List<AbstractPropertyTable> widgetPropertyTables; private List<AbstractPropertyTable> widgetPropertyTables;
private FormDesigner designer; private FormDesigner designer;
private ComponentTree componentTree;
private JPanel wsp; private JPanel wsp;
private MobileWidgetTable mobileWidgetTable; private MobileWidgetTable mobileWidgetTable;
private MobileBodyWidgetTable mobileBodyWidgetTable; private MobileBodyWidgetTable mobileBodyWidgetTable;
@ -122,8 +118,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
clearDockingView(); clearDockingView();
return; return;
} }
componentTree = new ComponentTree(designer);
widgetPropertyTables = new ArrayList<AbstractPropertyTable>(); widgetPropertyTables = new ArrayList<AbstractPropertyTable>();
propertyTable = new WidgetPropertyTable(designer); propertyTable = new WidgetPropertyTable(designer);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable)); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable));

Loading…
Cancel
Save