Browse Source

Merge pull request #41 in BA/design from ~ZACK/design:dev to dev

* commit 'fcbb71a23eaae1f1fcf1f9bac06ba5c03781a410':
  命名规范
  属性保持private
  修改接口
  数据集分组的接口
master
eason 9 years ago
parent
commit
c0044f342d
  1. 16
      designer_base/src/com/fr/design/DesignModelAdapter.java
  2. 12
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  3. 24
      designer_base/src/com/fr/design/data/datapane/TableDataSourceOP.java
  4. 8
      designer_base/src/com/fr/design/data/datapane/TableDataTree.java
  5. 80
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  6. 22
      designer_base/src/com/fr/design/fun/TableDataTreePaneProcessor.java
  7. 15
      designer_base/src/com/fr/design/fun/impl/AbstractTDTreePaneProcessor.java
  8. 20
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.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 TableDataTreePaneProcessor tableDataTreePaneProcessor;
public TableDataTreePaneProcessor getTableDataTreePaneProcessor() {
return tableDataTreePaneProcessor;
}
public void setTableDataSourceOPProcessor(Level level, PluginSimplify simplify) {
validAPILevel(level, TableDataTreePaneProcessor.CURRENT_LEVEL, simplify.getPluginName());
tableDataTreePaneProcessor = (TableDataTreePaneProcessor) 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(TableDataTreePaneProcessor.XML_TAG)) {
setTableDataSourceOPProcessor(impl, simplify);
}
} catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage());

24
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;
/**
* 数据集树的操作
@ -41,6 +37,14 @@ public class TableDataSourceOP implements UserObjectOP<TableDataWrapper> {
this.tc = tc;
}
public DesignModelAdapter<?, ?> getDesignModelAdapter() {
return tc;
}
public void setDesignModelAdapter(DesignModelAdapter<?, ?> tc) {
this.tc = tc;
}
/**
* 初始化数据集的list
*

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

@ -31,7 +31,6 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
this.setCellRenderer(tableDataTreeCellRenderer);
this.setEditable(false);
}
// CellRenderer
private DefaultTreeCellRenderer tableDataTreeCellRenderer = new DefaultTreeCellRenderer() {
private static final long serialVersionUID = 1L;
@ -82,6 +81,13 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
}
};
public DefaultTreeCellRenderer getTableDataTreeCellRenderer() {
return tableDataTreeCellRenderer;
}
public void setTableDataTreeCellRenderer(DefaultTreeCellRenderer tableDataTreeCellRenderer) {
this.tableDataTreeCellRenderer = tableDataTreeCellRenderer;
}
protected void refreshTreeNode(ExpandMutableTreeNode eTreeNode, String childName) {
if (interceptRefresh(eTreeNode)) {

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

@ -52,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 = "";
@ -77,7 +77,7 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
return singleton;
}
private static TableDataTree dataTree;
private TableDataTree dataTree;
private TableDataSourceOP op;
private MenuDef addMenuDef;
@ -147,6 +147,74 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
checkButtonEnabled();
}
public void setDataTree(TableDataTree dataTree) {
this.dataTree = dataTree;
}
public TableDataSourceOP getOp() {
return op;
}
public void setOp(TableDataSourceOP op) {
this.op = op;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
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() {
return new KeyAdapter() {
@ -227,11 +295,11 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
/**
* 刷新
*/
public static void refresh() {
public void refresh() {
dataTree.refresh();
}
private void checkButtonEnabled() {
protected void checkButtonEnabled() {
// august:BUG 9344
addMenuDef.setEnabled(true);
connectionTableAction.setEnabled(FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot());

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();
}

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

@ -0,0 +1,15 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.TableDataTreePaneProcessor;
/**
* Coder: zack
* Date: 2016/4/18
* Time: 10:30
*/
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