Browse Source

REPORT-6956 设计器适配10.0配置写法

master
kerry 7 years ago
parent
commit
c2bf3d6507
  1. 33
      designer/src/com/fr/design/actions/report/ReportWebAttrAction.java
  2. 29
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  3. 31
      designer/src/com/fr/design/actions/server/StyleListAction.java
  4. 40
      designer/src/com/fr/design/actions/server/WidgetManagerAction.java
  5. 34
      designer/src/com/fr/design/webattr/PageToolBarPane.java
  6. 37
      designer/src/com/fr/design/webattr/ViewToolBarPane.java
  7. 27
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  8. 47
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  9. 31
      designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java
  10. 43
      designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java
  11. 70
      designer_base/src/com/fr/design/actions/server/GlobalTableDataAction.java
  12. 35
      designer_base/src/com/fr/design/actions/server/ProcedureListAction.java
  13. 41
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

33
designer/src/com/fr/design/actions/report/ReportWebAttrAction.java

@ -7,6 +7,7 @@ import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -16,6 +17,9 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWebAttrPane;
import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import java.awt.event.ActionEvent;
@ -56,15 +60,26 @@ public class ReportWebAttrAction extends JWorkBookAction {
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportWebAttr(reportWebAttrPane.update());
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
jwb.fireTargetModified();
Configurations.update(new Worker() {
@Override
public void run() {
wbTpl.setReportWebAttr(reportWebAttrPane.update());
final ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
jwb.fireTargetModified();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});

29
designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -7,6 +7,7 @@ import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -15,6 +16,9 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.EditReportServerParameterPane;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -51,13 +55,24 @@ public class ServerConfigManagerAction extends UpdateAction {
editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
editReportServerParameterPane.update(configManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
Configurations.update(new Worker() {
@Override
public void run() {
editReportServerParameterPane.update(configManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
editReportServerParameterDialog.setVisible(true);

31
designer/src/com/fr/design/actions/server/StyleListAction.java

@ -4,6 +4,8 @@ import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.config.ServerConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -12,6 +14,8 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -40,14 +44,25 @@ public class StyleListAction extends UpdateAction {
styleListDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
styleListPane.update(ConfigManager.getProviderInstance());
//marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(ConfigManager.getProviderInstance());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
Configurations.update(new Worker() {
@Override
public void run() {
styleListPane.update(ConfigManager.getProviderInstance());
//marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(ConfigManager.getProviderInstance());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
}
});
}
});

40
designer/src/com/fr/design/actions/server/WidgetManagerAction.java

@ -3,6 +3,7 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -11,9 +12,12 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.WidgetManagerPane;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.form.ui.WidgetManager;
import com.fr.form.ui.WidgetManagerProvider;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -43,21 +47,31 @@ public class WidgetManagerAction extends UpdateAction {
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame,new DialogActionAdapter() {
@Override
public void doOk() {
widgetManagerPane.update(widgetManager);
Configurations.update(new Worker() {
@Override
public void run() {
widgetManagerPane.update(widgetManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(widgetManager);
//marks: 由于这个面板还改变权限相关的操作,所以这个时候还要操作权限配置
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(widgetManager);
//marks: 由于这个面板还改变权限相关的操作,所以这个时候还要操作权限配置
// currentEnv.writeResource(FRContext.getPrivilegeManager());
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.widgetConfigChanged();
}
designerFrame.getSelectedJTemplate().refreshToolArea();
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.widgetConfigChanged();
}
designerFrame.getSelectedJTemplate().refreshToolArea();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{WidgetInfoConfig.class};
}
});
}
});

34
designer/src/com/fr/design/webattr/PageToolBarPane.java

@ -1,6 +1,7 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -16,7 +17,10 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.report.web.WebPage;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -142,11 +146,10 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public WebPage updateBean() {
WebPage webPage = new WebPage();
if (this.isUseToolBarCheckBox.isSelected()) {
webPage.setToolBarManagers(this.toolBarManagers);
if (isUseToolBarCheckBox.isSelected()) {
webPage.setToolBarManagers(toolBarManagers);
}else {
webPage.setToolBarManagers(new ToolBarManager[0]);
webPage.setToolBarManagers(new ToolBarManager[0]);
}
for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i);
@ -174,12 +177,23 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebPage(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebPage(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
serverPageDialog.setVisible(true);

37
designer/src/com/fr/design/webattr/ViewToolBarPane.java

@ -1,6 +1,7 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -15,7 +16,10 @@ import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.report.web.WebView;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
import java.awt.*;
@ -113,14 +117,14 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override
public WebView updateBean() {
WebView webView = new WebView();
if (this.isUseToolBarCheckBox.isSelected()) {
webView.setToolBarManagers(this.toolBarManagers);
if (isUseToolBarCheckBox.isSelected()) {
webView.setToolBarManagers(toolBarManagers);
} else {
webView.setToolBarManagers(new ToolBarManager[0]);
}
webView.setSortFuncCheck(this.sortCheckBox.isSelected());
webView.setConditionFuncCheck(this.conditonFilterBox.isSelected());
webView.setListFuncCheck(this.listFilterBox.isSelected());
webView.setSortFuncCheck(sortCheckBox.isSelected());
webView.setConditionFuncCheck(conditonFilterBox.isSelected());
webView.setListFuncCheck(listFilterBox.isSelected());
for (int i = 0; i < eventPane.update().size(); i++) {
Listener listener = eventPane.update().get(i);
webView.addListener(listener);
@ -143,12 +147,23 @@ public class ViewToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebView(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebAttr reportWebAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebView(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
serverPageDialog.setVisible(true);

27
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -2,6 +2,7 @@ package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.config.Configuration;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -20,7 +21,10 @@ import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebContent;
import com.fr.report.web.WebWrite;
import com.fr.stable.Constants;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.web.attr.ReportWebAttr;
import com.fr.web.attr.ReportWebConfig;
import javax.swing.*;
@ -260,12 +264,23 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override
public void doOk() {
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean());
Configurations.update(new Worker() {
@Override
public void run() {
ReportWebAttr reportWebAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class));
if (reportWebAttr == null) {
reportWebAttr = new ReportWebAttr();
ConfigManager.getProviderInstance().putGlobalAttribute(ReportWebAttr.class, reportWebAttr);
}
reportWebAttr.setWebWrite(serverPageToolBarPane.updateBean());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ReportWebConfig.class};
}
});
}
});
serverPageDialog.setVisible(true);

47
designer_base/src/com/fr/design/actions/server/ConnectionListAction.java

@ -3,6 +3,7 @@ package com.fr.design.actions.server;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ModifiedTable;
import com.fr.config.Configuration;
import com.fr.data.impl.Connection;
import com.fr.dav.LocalEnv;
import com.fr.design.actions.UpdateAction;
@ -14,10 +15,13 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -74,20 +78,41 @@ public class ConnectionListAction extends UpdateAction {
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
writeFile(datasourceManager);
Configurations.update(new Worker() {
@Override
public void run() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
writeFile(datasourceManager);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
Configurations.update(new Worker() {
@Override
public void run() {
datasourceManager.synchronizedWithServer();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
}
});
databaseListDialog.setVisible(true);

31
designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java

@ -6,16 +6,20 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FunctionManagerPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.FunctionConfig;
import com.fr.file.FunctionManager;
import com.fr.file.FunctionManagerProvider;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -45,14 +49,25 @@ public class FunctionManagerAction extends UpdateAction {
final FunctionManagerProvider functionManager = FunctionManager.getProviderInstance();
functionManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
functionManagerPane.update(functionManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(functionManager);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
Configurations.update(new Worker() {
@Override
public void run() {
functionManagerPane.update(functionManager);
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(functionManager);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{FunctionConfig.class};
}
});
}
});
functionManagerPane.populate(functionManager);
functionManagerDialog.setVisible(true);

43
designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java

@ -7,6 +7,8 @@ import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.config.ServerConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -17,6 +19,8 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.parameter.ParameterManagerPane;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -50,20 +54,31 @@ public class GlobalParameterAction extends UpdateAction {
parameterManagerPane.populate(configManager);
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
//apply new parameter list.
parameterManagerPane.update(configManager);
//marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.parameterChanged();
}
parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename());
Configurations.update(new Worker() {
@Override
public void run() {
//apply new parameter list.
parameterManagerPane.update(configManager);
//marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(configManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) {
model.parameterChanged();
}
parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerConfig.class};
}
});
}
});
parameterManagerDialog.setModal(true);

70
designer_base/src/com/fr/design/actions/server/GlobalTableDataAction.java

@ -4,6 +4,7 @@
package com.fr.design.actions.server;
import com.fr.base.*;
import com.fr.config.Configuration;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
@ -18,7 +19,10 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.TableDataConfig;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -68,8 +72,18 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
populate(datasourceManager);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
protected void renameConnection(final String oldName, final String newName) {
Configurations.update(new Worker() {
@Override
public void run() {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{DatasourceManager.class};
}
});
}
};
final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null);
@ -78,26 +92,48 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
@Override
public void doOk() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
Configurations.update(new Worker() {
@Override
public void run() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
globalTableDataPane.update(datasourceManager);
if (!doWithDatasourceManager(datasourceManager, backupManager, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
writeFile(datasourceManager);
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
DesignTableDataManager.clearGlobalDs();
globalTableDataPane.update(datasourceManager);
if (!doWithDatasourceManager(datasourceManager, backupManager, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{TableDataConfig.class};
}
});
writeFile(datasourceManager);
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
Configurations.update(new Worker() {
@Override
public void run() {
datasourceManager.synchronizedWithServer();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{TableDataConfig.class
};
}
});
}
});
globalTableDataDialog.setVisible(true);

35
designer_base/src/com/fr/design/actions/server/ProcedureListAction.java

@ -2,6 +2,7 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
@ -13,7 +14,10 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.ProcedureConfig;
import com.fr.general.Inter;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.awt.event.ActionEvent;
@ -42,16 +46,27 @@ public class ProcedureListAction extends UpdateAction {
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame,null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(datasourceManager);
// marks:保存数据
try {
FRContext.getCurrentEnv().writeResource(datasourceManager);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
Configurations.update(new Worker() {
@Override
public void run() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(datasourceManager);
// marks:保存数据
try {
FRContext.getCurrentEnv().writeResource(datasourceManager);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ProcedureConfig.class};
}
});
}
});
databaseListDialog.setVisible(true);

41
designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -1,6 +1,7 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
@ -8,10 +9,13 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.ConnectionConfig;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*;
import java.awt.event.ItemEvent;
@ -96,17 +100,38 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false);
return;
}
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
ConnectionListAction.writeFile(datasourceManager);
Configurations.update(new Worker() {
@Override
public void run() {
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
ConnectionListAction.writeFile(datasourceManager);
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
Configurations.update(new Worker() {
@Override
public void run() {
datasourceManager.synchronizedWithServer();
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ConnectionConfig.class};
}
});
}
});
connectionListDialog.setVisible(true);

Loading…
Cancel
Save