You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.5 KiB
69 lines
2.5 KiB
9 years ago
|
package com.fr.design.actions.server;
|
||
|
|
||
|
import com.fr.base.BaseUtils;
|
||
7 years ago
|
import com.fr.config.Configuration;
|
||
9 years ago
|
import com.fr.design.DesignModelAdapter;
|
||
|
import com.fr.design.actions.UpdateAction;
|
||
|
import com.fr.design.data.DesignTableDataManager;
|
||
|
import com.fr.design.data.datapane.TableDataTreePane;
|
||
|
import com.fr.design.data.tabledata.tabledatapane.ProcedureManagerPane;
|
||
|
import com.fr.design.dialog.BasicDialog;
|
||
|
import com.fr.design.dialog.DialogActionAdapter;
|
||
|
import com.fr.design.mainframe.DesignerContext;
|
||
|
import com.fr.design.mainframe.DesignerFrame;
|
||
7 years ago
|
import com.fr.file.ProcedureConfig;
|
||
9 years ago
|
import com.fr.general.Inter;
|
||
7 years ago
|
import com.fr.transaction.Configurations;
|
||
|
import com.fr.transaction.Worker;
|
||
9 years ago
|
|
||
|
import java.awt.event.ActionEvent;
|
||
|
|
||
|
public class ProcedureListAction extends UpdateAction {
|
||
7 years ago
|
public ProcedureListAction() {
|
||
|
this.setName(Inter.getLocText("Datasource-Stored_Procedure") + "(P)" + "...");
|
||
|
this.setMnemonic('P');
|
||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/store_procedure.png"));
|
||
|
}
|
||
9 years ago
|
|
||
|
/**
|
||
|
* 事件触发操作
|
||
|
*
|
||
|
* @param evt 事件
|
||
|
*/
|
||
7 years ago
|
public void actionPerformed(ActionEvent evt) {
|
||
|
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
|
||
9 years ago
|
|
||
7 years ago
|
final ProcedureConfig procedureConfig = ProcedureConfig.getInstance();
|
||
|
final ProcedureManagerPane databaseManagerPane = new ProcedureManagerPane() {
|
||
|
public void complete() {
|
||
7 years ago
|
|
||
|
ProcedureConfig mirror = procedureConfig.mirror();
|
||
|
populate(mirror);
|
||
7 years ago
|
}
|
||
|
};
|
||
|
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
|
||
|
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
|
||
|
public void doOk() {
|
||
|
Configurations.update(new Worker() {
|
||
|
@Override
|
||
|
public void run() {
|
||
|
DesignTableDataManager.clearGlobalDs();
|
||
|
databaseManagerPane.update(procedureConfig);
|
||
|
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
@Override
|
||
|
public Class<? extends Configuration>[] targets() {
|
||
|
return new Class[]{ProcedureConfig.class};
|
||
|
}
|
||
|
});
|
||
7 years ago
|
|
||
7 years ago
|
}
|
||
|
});
|
||
|
databaseListDialog.setVisible(true);
|
||
|
}
|
||
9 years ago
|
|
||
7 years ago
|
public void update() {
|
||
|
this.setEnabled(true);
|
||
|
}
|
||
9 years ago
|
}
|