Search in sources :

Example 1 with DataNodeEditor

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout) DbEntityTabbedView(org.apache.cayenne.modeler.editor.dbentity.DbEntityTabbedView) CollapseTreeAction(org.apache.cayenne.modeler.action.CollapseTreeAction) DataNodeEditor(org.apache.cayenne.modeler.editor.datanode.DataNodeEditor) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) ProjectTreeView(org.apache.cayenne.modeler.ProjectTreeView) BorderLayout(java.awt.BorderLayout) JSplitPane(javax.swing.JSplitPane) Component(java.awt.Component) FilterAction(org.apache.cayenne.modeler.action.FilterAction)

Aggregations

BorderLayout (java.awt.BorderLayout)1 CardLayout (java.awt.CardLayout)1 Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JSplitPane (javax.swing.JSplitPane)1 JToolBar (javax.swing.JToolBar)1 ProjectTreeView (org.apache.cayenne.modeler.ProjectTreeView)1 CollapseTreeAction (org.apache.cayenne.modeler.action.CollapseTreeAction)1 FilterAction (org.apache.cayenne.modeler.action.FilterAction)1 DataNodeEditor (org.apache.cayenne.modeler.editor.datanode.DataNodeEditor)1 DbEntityTabbedView (org.apache.cayenne.modeler.editor.dbentity.DbEntityTabbedView)1