List of usage examples for javax.swing JToolBar setComponentOrientation
public void setComponentOrientation(ComponentOrientation o)
From source file:org.apache.cayenne.modeler.editor.EditorView.java
private void initView() { // init widgets JButton collapseButton = getAction(CollapseTreeAction.class).buildButton(); collapseButton.setPreferredSize(new Dimension(30, 20)); JButton filterButton = getAction(FilterAction.class).buildButton(); filterButton.setPreferredSize(new Dimension(30, 20)); actionManager.getAction(CollapseTreeAction.class).setAlwaysOn(true); actionManager.getAction(FilterAction.class).setAlwaysOn(true); JToolBar barPanel = new JToolBar(); barPanel.setMinimumSize(new Dimension(75, 25)); barPanel.setBorder(BorderFactory.createEtchedBorder()); barPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); barPanel.add(Box.createHorizontalStrut(3)); barPanel.add(filterButton);/*from ww w .ja v a 2s.c om*/ barPanel.addSeparator(); 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); this.detailPanel = new JPanel(); this.splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true); this.leftPanel = new JPanel(new BorderLayout()); // assemble... this.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.add(new JScrollPane(treeNavigatePanel), BorderLayout.CENTER); splitPane.setLeftComponent(leftPanel); splitPane.setRightComponent(detailPanel); setLayout(new BorderLayout()); add(splitPane, BorderLayout.CENTER); }