|
|
@ -237,7 +237,17 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
createAddMenuDef(); |
|
|
|
createAddMenuDef(); |
|
|
|
// 创建插件监听
|
|
|
|
// 创建插件监听
|
|
|
|
createPluginListener(); |
|
|
|
createPluginListener(); |
|
|
|
|
|
|
|
createToolbarDef(); |
|
|
|
|
|
|
|
UIToolbar toolBar = ToolBarDef.createJToolBar(); |
|
|
|
|
|
|
|
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); |
|
|
|
|
|
|
|
toolBar.setBorderPainted(true); |
|
|
|
|
|
|
|
toolbarDef.updateToolBar(toolBar); |
|
|
|
|
|
|
|
TreeSearchToolbarPane searchLayerdPane = new TreeSearchToolbarPane(toolBar); |
|
|
|
|
|
|
|
searchLayerdPane.setPreferredSize(new Dimension(this.getWidth(), 23)); |
|
|
|
|
|
|
|
return searchLayerdPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void createToolbarDef() { |
|
|
|
editAction = new EditAction(); |
|
|
|
editAction = new EditAction(); |
|
|
|
copyAction = new CopyAction(); |
|
|
|
copyAction = new CopyAction(); |
|
|
|
pasteAction = new PasteAction(); |
|
|
|
pasteAction = new PasteAction(); |
|
|
@ -249,20 +259,15 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
switchAction = new SwitchAction(); |
|
|
|
switchAction = new SwitchAction(); |
|
|
|
|
|
|
|
|
|
|
|
toolbarDef = new ToolBarDef(); |
|
|
|
toolbarDef = new ToolBarDef(); |
|
|
|
toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction, esdAction, esdOffAction, switchAction); |
|
|
|
toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction); |
|
|
|
initExtraAction(); |
|
|
|
ShortCut[] extraShortCut = initExtraAction(); |
|
|
|
UIToolbar toolBar = ToolBarDef.createJToolBar(); |
|
|
|
for (ShortCut shortCut: extraShortCut) { |
|
|
|
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); |
|
|
|
toolbarDef.addShortCut(shortCut); |
|
|
|
toolBar.setBorderPainted(true); |
|
|
|
} |
|
|
|
toolbarDef.updateToolBar(toolBar); |
|
|
|
toolbarDef.addShortCut(SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction, esdAction, esdOffAction, switchAction); |
|
|
|
|
|
|
|
|
|
|
|
TreeSearchToolbarPane searchLayerdPane = new TreeSearchToolbarPane(toolBar); |
|
|
|
|
|
|
|
searchLayerdPane.setPreferredSize(new Dimension(this.getWidth(), 23)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return searchLayerdPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initExtraAction() { |
|
|
|
private ShortCut[] initExtraAction() { |
|
|
|
Set<TableDataTreeToolBarActionProvider> toolBarActionProviders = ExtraDesignClassManager.getInstance().getArray(TableDataTreeToolBarActionProvider.XML_TAG); |
|
|
|
Set<TableDataTreeToolBarActionProvider> toolBarActionProviders = ExtraDesignClassManager.getInstance().getArray(TableDataTreeToolBarActionProvider.XML_TAG); |
|
|
|
for (TableDataTreeToolBarActionProvider handler : toolBarActionProviders) { |
|
|
|
for (TableDataTreeToolBarActionProvider handler : toolBarActionProviders) { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -271,7 +276,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
toolbarDef.addShortCut(extraActions.toArray(new ShortCut[0])); |
|
|
|
return extraActions.toArray(new ShortCut[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -348,7 +353,9 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
public void on(PluginEvent event) { |
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
addMenuDef.clearShortCuts(); |
|
|
|
addMenuDef.clearShortCuts(); |
|
|
|
|
|
|
|
toolbarDef.clearShortCuts(); |
|
|
|
createAddMenuDef(); |
|
|
|
createAddMenuDef(); |
|
|
|
|
|
|
|
createToolbarDef(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, new PluginFilter() { |
|
|
|
}, new PluginFilter() { |
|
|
|
|
|
|
|
|
|
|
|