use of org.apache.cayenne.modeler.editor.datanode.DataNodeEditor in project cayenne by apache.
the class EditorView method initView.
private void initView() {
setBorder(BorderFactory.createEmptyBorder(1, 0, 0, 1));
// init widgets
actionManager.getAction(CollapseTreeAction.class).setAlwaysOn(true);
actionManager.getAction(FilterAction.class).setAlwaysOn(true);
actionManager.getAction(FilterAction.class).resetDialog();
JToolBar barPanel = new JToolBar();
barPanel.setFloatable(false);
barPanel.setMinimumSize(new Dimension(75, 30));
barPanel.setBorder(BorderFactory.createEmptyBorder());
barPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
JButton collapseButton = getAction(CollapseTreeAction.class).buildButton(1);
JButton filterButton = getAction(FilterAction.class).buildButton(3);
filterButton.setPreferredSize(new Dimension(30, 30));
collapseButton.setPreferredSize(new Dimension(30, 30));
barPanel.add(filterButton);
barPanel.add(collapseButton);
treePanel = new ProjectTreeView(eventController);
treePanel.setMinimumSize(new Dimension(75, 180));
JPanel treeNavigatePanel = new JPanel();
treeNavigatePanel.setMinimumSize(new Dimension(75, 220));
treeNavigatePanel.setLayout(new BorderLayout());
treeNavigatePanel.add(treePanel, BorderLayout.CENTER);
detailPanel = new JPanel();
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
splitPane.setDividerSize(2);
splitPane.setBorder(BorderFactory.createEmptyBorder());
leftPanel = new JPanel(new BorderLayout());
// assemble...
detailLayout = new CardLayout();
detailPanel.setLayout(detailLayout);
// some but not all panels must be wrapped in a scroll pane
// those that are not wrapped usually have there own scrollers
// in subpanels...
detailPanel.add(new JPanel(), EMPTY_VIEW);
dataDomainView = new DataDomainTabbedView(eventController);
detailPanel.add(dataDomainView, DOMAIN_VIEW);
DataNodeEditor nodeController = new DataNodeEditor(eventController);
detailPanel.add(nodeController.getView(), NODE_VIEW);
dataNodeView = nodeController.getTabComponent();
dataMapView = new DataMapTabbedView(eventController);
detailPanel.add(dataMapView, DATA_MAP_VIEW);
procedureView = new ProcedureTabbedView(eventController);
detailPanel.add(procedureView, PROCEDURE_VIEW);
selectQueryView = new SelectQueryTabbedView(eventController);
detailPanel.add(selectQueryView, SELECT_QUERY_VIEW);
sqlTemplateView = new SQLTemplateTabbedView(eventController);
detailPanel.add(sqlTemplateView, SQL_TEMPLATE_VIEW);
Component procedureQueryView = new ProcedureQueryView(eventController);
detailPanel.add(new JScrollPane(procedureQueryView), PROCEDURE_QUERY_VIEW);
ejbqlQueryView = new EjbqlTabbedView(eventController);
detailPanel.add(ejbqlQueryView, EJBQL_QUERY_VIEW);
embeddableView = new EmbeddableTabbedView(eventController);
detailPanel.add(embeddableView, EMBEDDABLE_VIEW);
objDetailView = new ObjEntityTabbedView(eventController);
detailPanel.add(objDetailView, OBJ_VIEW);
dbDetailView = new DbEntityTabbedView(eventController);
detailPanel.add(dbDetailView, DB_VIEW);
leftPanel.add(barPanel, BorderLayout.NORTH);
leftPanel.setBorder(BorderFactory.createEmptyBorder());
JScrollPane scrollPane = new JScrollPane(treeNavigatePanel);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
leftPanel.add(scrollPane, BorderLayout.CENTER);
splitPane.setLeftComponent(leftPanel);
splitPane.setRightComponent(detailPanel);
setLayout(new BorderLayout());
add(splitPane, BorderLayout.CENTER);
}
Aggregations