Browse Source

无JIRA任务 配置文件克隆

master
RichieJi 7 years ago
parent
commit
5c0f49b7fa
  1. 13
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  2. 2
      designer/src/com/fr/design/actions/server/StyleListAction.java
  3. 13
      designer/src/com/fr/design/actions/server/WidgetManagerAction.java
  4. 2
      designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java
  5. 2
      designer_base/src/com/fr/design/actions/server/GlobalParameterAction.java
  6. 3
      designer_base/src/com/fr/design/actions/server/GlobalTableDataAction.java
  7. 72
      designer_base/src/com/fr/design/actions/server/ProcedureListAction.java
  8. 3
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

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

@ -26,7 +26,7 @@ import java.awt.event.ActionEvent;
public class ServerConfigManagerAction extends UpdateAction { public class ServerConfigManagerAction extends UpdateAction {
public ServerConfigManagerAction() { public ServerConfigManagerAction() {
this.setMenuKeySet(SERVER_CONFIG_MANAGER); this.setMenuKeySet(SERVER_CONFIG_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/edit.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/edit.png"));
this.setSearchText(new EditReportServerParameterPane().getAllComponents()); this.setSearchText(new EditReportServerParameterPane().getAllComponents());
@ -34,24 +34,25 @@ public class ServerConfigManagerAction extends UpdateAction {
/** /**
* 动作 * 动作
*
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final ServerConfig config = ServerConfig.getInstance(); final ServerConfig config = ServerConfig.getInstance();
final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() { final EditReportServerParameterPane editReportServerParameterPane = new EditReportServerParameterPane() {
@Override @Override
public void complete() { public void complete() {
populate((ServerConfig)config.clone()); populate(config.copy());
} }
}; };
final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindow( final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindow(
DesignerContext.getDesignerFrame() DesignerContext.getDesignerFrame()
); );
editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() { editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
@ -70,7 +71,7 @@ public class ServerConfigManagerAction extends UpdateAction {
} }
@Override @Override
public void update() { public void update() {
this.setEnabled(true); this.setEnabled(true);
} }

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

@ -55,7 +55,7 @@ public class StyleListAction extends UpdateAction {
} }
}); });
styleListPane.populate((ServerConfig) ServerConfig.getInstance().clone()); styleListPane.populate(ServerConfig.getInstance().copy());
styleListDialog.setVisible(true); styleListDialog.setVisible(true);
} }

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

@ -21,13 +21,14 @@ import java.awt.event.ActionEvent;
public class WidgetManagerAction extends UpdateAction { public class WidgetManagerAction extends UpdateAction {
public WidgetManagerAction() { public WidgetManagerAction() {
this.setMenuKeySet(WIDGET_MANAGER); this.setMenuKeySet(WIDGET_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/modified.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/modified.png"));
} }
/** /**
* 动作 * 动作
*
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -35,14 +36,14 @@ public class WidgetManagerAction extends UpdateAction {
final WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance(); final WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() { final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() {
@Override @Override
public void complete() { public void complete() {
populate((WidgetInfoConfig)widgetManager.clone()); populate(widgetManager.copy());
} }
}; };
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame,new DialogActionAdapter() { BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame, new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
@ -66,7 +67,7 @@ public class WidgetManagerAction extends UpdateAction {
} }
@Override @Override
public void update() { public void update() {
this.setEnabled(true); this.setEnabled(true);
} }

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

@ -59,7 +59,7 @@ public class FunctionManagerAction extends UpdateAction {
} }
}); });
functionManagerPane.populate((FunctionConfig) functionManager.clone()); functionManagerPane.populate(functionManager.copy());
functionManagerDialog.setVisible(true); functionManagerDialog.setVisible(true);
} }

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

@ -47,7 +47,7 @@ public class GlobalParameterAction extends UpdateAction {
//marks:读取服务器配置信息 //marks:读取服务器配置信息
final ServerConfig configManager = ServerConfig.getInstance(); final ServerConfig configManager = ServerConfig.getInstance();
parameterManagerPane.populate((ServerConfig) configManager.clone()); parameterManagerPane.populate(configManager.copy());
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() { parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.update(new Worker() {

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

@ -61,6 +61,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
/** /**
* 动作 * 动作
*
* @param evt 事件 * @param evt 事件
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -68,7 +69,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
final TableDataConfig tableDataConfig = TableDataConfig.getInstance(); final TableDataConfig tableDataConfig = TableDataConfig.getInstance();
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() { public void complete() {
populate((TableDataConfig) tableDataConfig.clone()); populate(tableDataConfig.copy());
} }
protected void renameConnection(final String oldName, final String newName) { protected void renameConnection(final String oldName, final String newName) {

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

@ -1,7 +1,6 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -20,50 +19,49 @@ import com.fr.transaction.Worker;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class ProcedureListAction extends UpdateAction { public class ProcedureListAction extends UpdateAction {
public ProcedureListAction() { public ProcedureListAction() {
this.setName(Inter.getLocText("Datasource-Stored_Procedure") + "(P)" + "..."); this.setName(Inter.getLocText("Datasource-Stored_Procedure") + "(P)" + "...");
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/store_procedure.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/store_procedure.png"));
} }
/** /**
* 事件触发操作 * 事件触发操作
* *
* @param evt 事件 * @param evt 事件
*
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final ProcedureConfig procedureConfig = ProcedureConfig.getInstance(); final ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() { final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() {
public void complete() { public void complete() {
populate((ProcedureConfig)procedureConfig.clone()); populate(procedureConfig.copy());
} }
}; };
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame,null); BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() { databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
DesignTableDataManager.clearGlobalDs(); DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(procedureConfig); databaseManagerPane.update(procedureConfig);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public Class<? extends Configuration>[] targets() {
return new Class[]{ProcedureConfig.class}; return new Class[]{ProcedureConfig.class};
} }
}); });
} }
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);
} }
public void update() { public void update() {
this.setEnabled(true); this.setEnabled(true);
} }
} }

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

@ -89,7 +89,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
protected void editItems() { protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane(); final ConnectionListPane connectionListPane = new ConnectionListPane();
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
connectionListPane.populate((ConnectionConfig) connectionConfig.clone()); ConnectionConfig cloned = connectionConfig.copy();
connectionListPane.populate(cloned);
final BasicDialog connectionListDialog = connectionListPane.showLargeWindow( final BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null); SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null);
connectionListDialog.addDialogActionListener(new DialogActionAdapter() { connectionListDialog.addDialogActionListener(new DialogActionAdapter() {

Loading…
Cancel
Save