Browse Source

数据集分组的接口

master
zack 9 years ago
parent
commit
102e0cdf83
  1. 16
      designer_base/src/com/fr/design/DesignModelAdapter.java
  2. 12
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  3. 33
      designer_base/src/com/fr/design/data/datapane/TableDataTree.java
  4. 36
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  5. 38
      designer_base/src/com/fr/design/fun/TableDataSourceManagerProcessor.java
  6. 15
      designer_base/src/com/fr/design/fun/impl/AbstractTDSourceManagerProcessor.java

16
designer_base/src/com/fr/design/DesignModelAdapter.java

@ -1,9 +1,5 @@
package com.fr.design;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.fr.base.Parameter;
import com.fr.base.io.IOFile;
import com.fr.data.TableDataSource;
@ -13,6 +9,10 @@ import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.stable.js.WidgetName;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 当前的设计器模式
*
@ -29,6 +29,14 @@ public abstract class DesignModelAdapter<T extends IOFile, S extends JTemplatePr
setCurrentModelAdapter(this);
}
public S getjTemplate() {
return jTemplate;
}
public void setjTemplate(S jTemplate) {
this.jTemplate = jTemplate;
}
public T getBook() {
return (T) ((JTemplate) jTemplate).getTarget();
}

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

@ -126,6 +126,16 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private DesignerEnvProcessor envProcessor;
private TableDataSourceManagerProcessor tableDataSourceManagerProcessor;
public TableDataSourceManagerProcessor getTableDataSourceManagerProcessor() {
return tableDataSourceManagerProcessor;
}
public void setTableDataSourceOPProcessor(Level level, PluginSimplify simplify) {
validAPILevel(level, TableDataSourceManagerProcessor.CURRENT_LEVEL, simplify.getPluginName());
tableDataSourceManagerProcessor = (TableDataSourceManagerProcessor) level;
}
public DesignerEnvProcessor getEnvProcessor() {
return envProcessor;
@ -797,6 +807,8 @@ 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)) {
setTableDataSourceOPProcessor(impl, simplify);
}
} catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage());

33
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.general.NameObject;
import com.fr.design.DesignModelAdapter;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.ilable.UILabel;
@ -9,6 +9,7 @@ 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;
@ -241,4 +242,34 @@ 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){
}
}

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

@ -6,6 +6,7 @@ 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;
@ -18,6 +19,7 @@ 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;
@ -27,10 +29,7 @@ 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.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.menu.*;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
@ -92,7 +91,7 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
private TableDataTreePane() {
this.setLayout(new BorderLayout(4, 0));
this.setBorder(null);
dataTree = new TableDataTree();
initTableDataTree();
ToolTipManager.sharedInstance().registerComponent(dataTree);
ToolTipManager.sharedInstance().setDismissDelay(3000);
ToolTipManager.sharedInstance().setInitialDelay(0);
@ -108,13 +107,21 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
createAddMenuDef();
}
});
ToolBarDef toolbarDef = new ToolBarDef();
editAction = new EditAction();
removeAction = new RemoveAction();
previewTableDataAction = new PreviewTableDataAction();
connectionTableAction = new ConnectionTableAction();
ToolBarDef toolbarDef = new ToolBarDef();
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.addShortCut(addMenuDef, SeparatorDef.DEFAULT, editAction, removeAction, SeparatorDef.DEFAULT, previewTableDataAction, connectionTableAction);
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
@ -147,6 +154,14 @@ 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();
}
private KeyAdapter getTableTreeNodeListener() {
return new KeyAdapter() {
@ -278,7 +293,12 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
* 刷新
*/
public void refreshDockingView() {
populate(new TableDataSourceOP(tc));
TableDataSourceOP tableDataSourceOP = null;
TableDataSourceManagerProcessor opProcessor = ExtraDesignClassManager.getInstance().getTableDataSourceManagerProcessor();
if (opProcessor != null) {
tableDataSourceOP = opProcessor.createTableDataSourceOP(tc);
}
populate(tableDataSourceOP == null ? new TableDataSourceOP(tc) : tableDataSourceOP);
this.checkButtonEnabled();
}

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

@ -0,0 +1,38 @@
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);
}

15
designer_base/src/com/fr/design/fun/impl/AbstractTDSourceManagerProcessor.java

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