Browse Source

修改接口

master
zack 9 years ago
parent
commit
a7cd005363
  1. 12
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  2. 18
      designer_base/src/com/fr/design/data/datapane/TableDataSourceOP.java
  3. 36
      designer_base/src/com/fr/design/data/datapane/TableDataTree.java
  4. 92
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  5. 38
      designer_base/src/com/fr/design/fun/TableDataSourceManagerProcessor.java
  6. 22
      designer_base/src/com/fr/design/fun/TableDataTreePaneProcessor.java
  7. 4
      designer_base/src/com/fr/design/fun/impl/AbstractTDTreePaneProcessor.java
  8. 20
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java

12
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -126,15 +126,15 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private DesignerEnvProcessor envProcessor;
private TableDataSourceManagerProcessor tableDataSourceManagerProcessor;
private TableDataTreePaneProcessor tableDataTreePaneProcessor;
public TableDataSourceManagerProcessor getTableDataSourceManagerProcessor() {
return tableDataSourceManagerProcessor;
public TableDataTreePaneProcessor getTableDataTreePaneProcessor() {
return tableDataTreePaneProcessor;
}
public void setTableDataSourceOPProcessor(Level level, PluginSimplify simplify) {
validAPILevel(level, TableDataSourceManagerProcessor.CURRENT_LEVEL, simplify.getPluginName());
tableDataSourceManagerProcessor = (TableDataSourceManagerProcessor) level;
validAPILevel(level, TableDataTreePaneProcessor.CURRENT_LEVEL, simplify.getPluginName());
tableDataTreePaneProcessor = (TableDataTreePaneProcessor) level;
}
public DesignerEnvProcessor getEnvProcessor() {
@ -807,7 +807,7 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addSupportDesignApps(impl, simplify);
} else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) {
setEnvProcessor(impl, simplify);
} else if (tagName.equals(TableDataSourceManagerProcessor.XML_TAG)) {
} else if (tagName.equals(TableDataTreePaneProcessor.XML_TAG)) {
setTableDataSourceOPProcessor(impl, simplify);
}
} catch (PluginInvalidLevelException e) {

18
designer_base/src/com/fr/design/data/datapane/TableDataSourceOP.java

@ -1,26 +1,22 @@
package com.fr.design.data.datapane;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.fr.general.NameObject;
import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.impl.storeproc.StoreProcedureConstants;
import com.fr.design.DesignModelAdapter;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.wrapper.StoreProcedureDataWrapper;
import com.fr.design.data.tabledata.wrapper.StoreProcedureNameWrapper;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.UserObjectOP;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import java.util.*;
import java.util.Map.Entry;
/**
* 数据集树的操作
@ -34,7 +30,7 @@ public class TableDataSourceOP implements UserObjectOP<TableDataWrapper> {
public static final int STORE_PRECEDURE_DATA = 2;
public static int dataMode = -1;
private DesignModelAdapter<?, ?> tc;
protected DesignModelAdapter<?, ?> tc;
public TableDataSourceOP(DesignModelAdapter<?, ?> tc) {

36
designer_base/src/com/fr/design/data/datapane/TableDataTree.java

@ -1,7 +1,7 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.general.NameObject;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.ilable.UILabel;
@ -9,7 +9,6 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.UserObjectRefreshJTree;
import com.fr.design.icon.IconPathConstants;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
@ -32,9 +31,8 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
this.setCellRenderer(tableDataTreeCellRenderer);
this.setEditable(false);
}
// CellRenderer
private DefaultTreeCellRenderer tableDataTreeCellRenderer = new DefaultTreeCellRenderer() {
protected DefaultTreeCellRenderer tableDataTreeCellRenderer = new DefaultTreeCellRenderer() {
private static final long serialVersionUID = 1L;
@Override
@ -242,34 +240,4 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
treeModel.reload(root);
}
/**
* @param nameOfNewNode 新添加的节点名字
* @param insertMode 添加的节点的类型模板服务器 存储过程分组
* @param tc
*/
public void insertNewNodeToSelectedNode(String nameOfNewNode, int insertMode, DesignModelAdapter<?, ?> tc){
}
/**
* 删除选中节点
* @param nodeName 节点名称
* @param removeMode 删除模式
* @param tc tc
*/
public void removeSelectedNode(String nodeName, int removeMode, DesignModelAdapter<?, ?> tc) {
}
/**
* 更新节点
* @param newName 新名称
* @param oldName 原名称
* @param updateMode 更新模式
* @param tc tc
*/
public void updateNameOfSelectedNode(String newName, String oldName, int updateMode, DesignModelAdapter<?, ?> tc){
}
}

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

@ -6,7 +6,6 @@ import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.ResponseDataSourceChange;
@ -19,7 +18,6 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.TableDataSourceManagerProcessor;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField;
@ -29,7 +27,10 @@ import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DockingView;
import com.fr.design.menu.*;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
@ -51,9 +52,9 @@ import java.util.Map;
public class TableDataTreePane extends DockingView implements ResponseDataSourceChange {
private static final int PROCEDURE_NAME_INDEX = 4;
private static final int TEMPLATE_TABLE_DATA = 0;
private static final int SERVER_TABLE_DATA = 1;
protected static final int PROCEDURE_NAME_INDEX = 4;
protected static final int TEMPLATE_TABLE_DATA = 0;
protected static final int SERVER_TABLE_DATA = 1;
private static final long serialVersionUID = -12168467370000617L;
private static TableDataTreePane singleton = new TableDataTreePane();
private String type = "";
@ -76,8 +77,8 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
return singleton;
}
private static TableDataTree dataTree;
private TableDataSourceOP op;
protected static TableDataTree dataTree;
protected TableDataSourceOP op;
private MenuDef addMenuDef;
private EditAction editAction;
@ -91,7 +92,7 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
private TableDataTreePane() {
this.setLayout(new BorderLayout(4, 0));
this.setBorder(null);
initTableDataTree();
dataTree = new TableDataTree();
ToolTipManager.sharedInstance().registerComponent(dataTree);
ToolTipManager.sharedInstance().setDismissDelay(3000);
ToolTipManager.sharedInstance().setInitialDelay(0);
@ -107,21 +108,13 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
createAddMenuDef();
}
});
ToolBarDef toolbarDef = new ToolBarDef();
editAction = new EditAction();
removeAction = new RemoveAction();
previewTableDataAction = new PreviewTableDataAction();
connectionTableAction = new ConnectionTableAction();
ShortCut[] shortCuts = null;
TableDataSourceManagerProcessor opProcessor = ExtraDesignClassManager.getInstance().getTableDataSourceManagerProcessor();
if (opProcessor != null) {
shortCuts = opProcessor.getShortCuts(dataTree);
} else {
shortCuts = new ShortCut[]{addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction};
}
toolbarDef.addShortCut(shortCuts);
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction);
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
@ -154,12 +147,52 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
checkButtonEnabled();
}
private void initTableDataTree() {
TableDataSourceManagerProcessor opProcessor = ExtraDesignClassManager.getInstance().getTableDataSourceManagerProcessor();
if (opProcessor != null) {
dataTree = opProcessor.createUserObjectJtree();
}
dataTree = new TableDataTree();
public MenuDef getAddMenuDef() {
return addMenuDef;
}
public void setAddMenuDef(MenuDef addMenuDef) {
this.addMenuDef = addMenuDef;
}
public EditAction getEditAction() {
return editAction;
}
public void setEditAction(EditAction editAction) {
this.editAction = editAction;
}
public RemoveAction getRemoveAction() {
return removeAction;
}
public void setRemoveAction(RemoveAction removeAction) {
this.removeAction = removeAction;
}
public DesignModelAdapter<?, ?> getTc() {
return tc;
}
public void setTc(DesignModelAdapter<?, ?> tc) {
this.tc = tc;
}
public PreviewTableDataAction getPreviewTableDataAction() {
return previewTableDataAction;
}
public void setPreviewTableDataAction(PreviewTableDataAction previewTableDataAction) {
this.previewTableDataAction = previewTableDataAction;
}
public ConnectionTableAction getConnectionTableAction() {
return connectionTableAction;
}
public void setConnectionTableAction(ConnectionTableAction connectionTableAction) {
this.connectionTableAction = connectionTableAction;
}
private KeyAdapter getTableTreeNodeListener() {
@ -246,7 +279,7 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
dataTree.refresh();
}
private void checkButtonEnabled() {
protected void checkButtonEnabled() {
// august:BUG 9344
addMenuDef.setEnabled(true);
connectionTableAction.setEnabled(FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot());
@ -293,12 +326,7 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
* 刷新
*/
public void refreshDockingView() {
TableDataSourceOP tableDataSourceOP = null;
TableDataSourceManagerProcessor opProcessor = ExtraDesignClassManager.getInstance().getTableDataSourceManagerProcessor();
if (opProcessor != null) {
tableDataSourceOP = opProcessor.createTableDataSourceOP(tc);
}
populate(tableDataSourceOP == null ? new TableDataSourceOP(tc) : tableDataSourceOP);
populate(new TableDataSourceOP(tc));
this.checkButtonEnabled();
}

38
designer_base/src/com/fr/design/fun/TableDataSourceManagerProcessor.java

@ -1,38 +0,0 @@
package com.fr.design.fun;
import com.fr.design.DesignModelAdapter;
import com.fr.design.data.datapane.TableDataSourceOP;
import com.fr.design.data.datapane.TableDataTree;
import com.fr.design.menu.ShortCut;
import com.fr.stable.fun.Level;
/**
* 自定义的模板服务器数据集的树样式接口 el:分组样式
* Coder: zack
* Date: 2016/4/18
* Time: 9:04
*/
public interface TableDataSourceManagerProcessor extends Level {
String XML_TAG = "TableDataSourceManagerProcessor";
int CURRENT_LEVEL = 1;
/**
* 创建数据集的树操作
* @param tc 设计模式
* @return 数据集树操作
*/
TableDataSourceOP createTableDataSourceOP(DesignModelAdapter<?, ?> tc);
/**
* 创建相应的tabledatatree
* @return tabledatatree
*/
TableDataTree createUserObjectJtree();
/**
* 返回面板新增的action(el:GroupAction)
* @return (shortcut)action数组
*/
ShortCut[] getShortCuts(TableDataTree dataTree);
}

22
designer_base/src/com/fr/design/fun/TableDataTreePaneProcessor.java

@ -0,0 +1,22 @@
package com.fr.design.fun;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.stable.fun.Level;
/**
* 自定义的模板服务器数据集的树样式接口 el:分组样式
* Coder: zack
* Date: 2016/4/18
* Time: 9:04
*/
public interface TableDataTreePaneProcessor extends Level {
String XML_TAG = "TableDataTreePaneProcessor";
int CURRENT_LEVEL = 1;
/**
* 创建数据集面板
* @return 数据集面板
*/
TableDataTreePane createTableDataTreePane();
}

4
designer_base/src/com/fr/design/fun/impl/AbstractTDSourceManagerProcessor.java → designer_base/src/com/fr/design/fun/impl/AbstractTDTreePaneProcessor.java

@ -1,13 +1,13 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.TableDataSourceManagerProcessor;
import com.fr.design.fun.TableDataTreePaneProcessor;
/**
* Coder: zack
* Date: 2016/4/18
* Time: 10:30
*/
public abstract class AbstractTDSourceManagerProcessor implements TableDataSourceManagerProcessor {
public abstract class AbstractTDTreePaneProcessor implements TableDataTreePaneProcessor {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;

20
designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java

@ -1,11 +1,15 @@
package com.fr.design.mainframe;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.fun.TableDataTreePaneProcessor;
import com.fr.design.gui.icontainer.UIResizableContainer;
import com.fr.stable.Constants;
import javax.swing.*;
public class WestRegionContainerPane extends UIResizableContainer {
private static WestRegionContainerPane THIS;
@ -16,15 +20,23 @@ public class WestRegionContainerPane extends UIResizableContainer {
*/
public static final WestRegionContainerPane getInstance() {
if (THIS == null) {
THIS = new WestRegionContainerPane();
TableDataTreePane tableDataTreePane = null;
TableDataTreePaneProcessor treePaneProcessor = ExtraDesignClassManager.getInstance().getTableDataTreePaneProcessor();
if (treePaneProcessor != null) {
tableDataTreePane = treePaneProcessor.createTableDataTreePane();
} else {
tableDataTreePane = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
THIS = new WestRegionContainerPane(tableDataTreePane);
THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY());
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth());
}
return THIS;
}
public WestRegionContainerPane() {
super(DesignerFrameFileDealerPane.getInstance(), TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()), Constants.RIGHT);
public WestRegionContainerPane(JComponent pane) {
super(DesignerFrameFileDealerPane.getInstance(), pane, Constants.RIGHT);
setContainerWidth(165);
}
}
Loading…
Cancel
Save