org.openide.awt.Toolbar Java Examples
The following examples show how to use
org.openide.awt.Toolbar.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OutlineTopComponent.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #2
Source File: OutlineTopComponent.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #3
Source File: OutlineTopComponent.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #4
Source File: OutlineTopComponent.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #5
Source File: OutlineTopComponent.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #6
Source File: OutlineTopComponent.java From hottub with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #7
Source File: OutlineTopComponent.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(GarbageCollectAction.get(GarbageCollectAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } }
Example #8
Source File: OutlineTopComponent.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void initToolbar() { Toolbar toolbar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolbar.setBorder(b); this.add(toolbar, BorderLayout.NORTH); toolbar.add(ImportAction.get(ImportAction.class)); toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); toolbar.add(SaveAllAction.get(SaveAllAction.class)); toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { tb.setVisible(false); } initOrganizers(); }
Example #9
Source File: FilterTopComponent.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #10
Source File: SceneComposerTopComponent.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void componentClosed() { super.componentClosed(); if (currentRequest != null) { SceneApplication.getApplication().closeScene(currentRequest); } Toolbar tb = ToolbarPool.getDefault().findToolbar("SceneComposer-Tools"); if (tb != null) { if (tb.isVisible()) { tb.setVisible(false); } } }
Example #11
Source File: SceneComposerTopComponent.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void componentOpened() { super.componentOpened(); Toolbar tb = ToolbarPool.getDefault().findToolbar("SceneComposer-Tools"); if (tb != null) { if (!tb.isVisible()) { tb.setVisible(true); } } if (currentRequest == null) { close(); } }
Example #12
Source File: FilterTopComponent.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #13
Source File: FilterTopComponent.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #14
Source File: FilterTopComponent.java From hottub with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #15
Source File: FilterTopComponent.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(NewFilterAction.get(NewFilterAction.class)); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #16
Source File: FilterTopComponent.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #17
Source File: PreviewMultiViewElement.java From netbeans with Apache License 2.0 | 5 votes |
public JComponent getToolbarRepresentation() { if (des != null) { Document doc = getEditorPane().getDocument(); if (doc instanceof NbDocument.CustomToolbar) { if (toolbar == null) { toolbar = ((NbDocument.CustomToolbar) doc).createToolbar(getEditorPane()); } return toolbar; } } Toolbar tb = new Toolbar(); return tb; }
Example #18
Source File: MainWindowOperator.java From netbeans with Apache License 2.0 | 5 votes |
public boolean checkComponent(Component comp) { if(comp instanceof org.openide.awt.Toolbar) { count++; if(comparator != null) { return comparator.equals(((Toolbar)comp).getDisplayName(), toolbarName); } else { return true; } } return false; }
Example #19
Source File: ToolbarConfiguration.java From netbeans with Apache License 2.0 | 5 votes |
/** Make toolbar visible/invisible in this configuration * @param tb toolbar * @param b true to make toolbar visible */ public void setToolbarVisible(Toolbar tb, boolean visible) { ToolbarConstraints tc = getConstraints( tb.getName() ); boolean isBarVisible = tc.isVisible(); tc.setVisible(visible); if( visible != isBarVisible ) { refresh(); save(); } }
Example #20
Source File: FilterTopComponent.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #21
Source File: FilterTopComponent.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private FilterTopComponent() { filterSettingsChangedEvent = new ChangedEvent<FilterTopComponent>(this); initComponents(); setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); // setIcon(Utilities.loadImage(ICON_PATH, true)); sequence = new FilterChain(); filterChain = new FilterChain(); initFilters(); manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new FilterChildren())); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); view = new CheckListView(); ToolbarPool.getDefault().setPreferredIconSize(16); Toolbar toolBar = new Toolbar(); Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N toolBar.setBorder(b); comboBox = new JComboBox(); toolBar.add(comboBox); this.add(toolBar, BorderLayout.NORTH); toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); toolBar.addSeparator(); toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); toolBar.add(NewFilterAction.get(NewFilterAction.class)); this.add(view, BorderLayout.CENTER); filterSettings = new ArrayList<FilterSetting>(); updateComboBox(); comboBox.addActionListener(comboBoxActionListener); setChain(filterChain); }
Example #22
Source File: DebuggerManagerListener.java From netbeans with Apache License 2.0 | 4 votes |
private void setupToolbar(final DebuggerEngine engine) { final List<Component> buttonsToClose = new ArrayList<Component>(); buttonsToClose.add(new java.awt.Label("EMPTY")); final boolean isFirst; synchronized (closedToolbarButtons) { isFirst = closedToolbarButtons.isEmpty(); closedToolbarButtons.put(engine, buttonsToClose); } RequestProcessor rp = engine.lookupFirst(null, RequestProcessor.class); if (rp == null) { rp = RP; } rp.post(new Runnable() { @Override public void run() { List<? extends ActionsProvider> actionsProviderList = engine.lookup(null, ActionsProvider.class); final Set engineActions = new HashSet(); for (ActionsProvider ap : actionsProviderList) { engineActions.addAll(ap.getActions()); } ToolbarPool.getDefault().waitFinished(); SwingUtilities.invokeLater (new Runnable () { @Override public void run () { List<Component> buttonsClosed = new ArrayList<Component>(); List<Component> buttonsUsed = new ArrayList<Component>(); try { if (ToolbarPool.getDefault ().getConfiguration ().equals(ToolbarPool.DEFAULT_CONFIGURATION)) { ToolbarPool.getDefault ().setConfiguration("Debugging"); // NOI18N } Toolbar debugToolbar = ToolbarPool.getDefault ().findToolbar("Debug"); if (debugToolbar == null) return ; registerToolbarListener(debugToolbar); for (Component c : debugToolbar.getComponents()) { DebuggerAction a = getDebuggerAction(c); if (a != null) { Object action = a.getAction(); //System.err.println("Engine "+engine+" contains action "+a+"("+action+") = "+engineActions.contains(action)); boolean containsAction = engineActions.contains(action); if (isFirst && !containsAction) { // For the first engine disable toolbar buttons for actions that are not provided c.setVisible(false); buttonsClosed.add(c); toolbarButtonsPrefferedSize.put(c, c.getPreferredSize()); c.setPreferredSize(new Dimension(0, 0)); } if (!isFirst && containsAction) { // For next engine enable toolbar buttons that could be previously disabled // and are used for actions that are provided. Dimension d = toolbarButtonsPrefferedSize.remove(c); if (d != null) { c.setPreferredSize(d); } c.setVisible(true); } if (containsAction) { // Keep track of buttons used by individual engines. buttonsUsed.add(c); } } } debugToolbar.revalidate(); debugToolbar.repaint(); } finally { synchronized (closedToolbarButtons) { usedToolbarButtons.put(engine, buttonsUsed); buttonsToClose.clear(); buttonsToClose.addAll(buttonsClosed); closedToolbarButtons.notifyAll(); } } } }); } }); }
Example #23
Source File: DebuggerManagerListener.java From netbeans with Apache License 2.0 | 4 votes |
private void registerToolbarListener(Toolbar debugToolbar) { if (toolbarContainerListener == null) { toolbarContainerListener = new ToolbarContainerListener(); debugToolbar.addContainerListener(toolbarContainerListener); } }
Example #24
Source File: DebuggerManagerListener.java From netbeans with Apache License 2.0 | 4 votes |
private void unregisterToolbarListener(Toolbar debugToolbar) { if (toolbarContainerListener != null) { debugToolbar.removeContainerListener(toolbarContainerListener); toolbarContainerListener = null; } }
Example #25
Source File: MainWindowOperatorTest.java From netbeans with Apache License 2.0 | 4 votes |
/** Test of getToolbarName method. */ public void testGetToolbarName() { String toolbarName = mainWindowOper.getToolbarName(0); String expected = ((Toolbar) mainWindowOper.getToolbar(0).getSource()).getDisplayName(); assertEquals("Wrong toolbar name", expected, toolbarName); }
Example #26
Source File: ToolbarContainer.java From netbeans with Apache License 2.0 | 4 votes |
Toolbar getToolbar() { return toolbar; }
Example #27
Source File: ToolbarConfiguration.java From netbeans with Apache License 2.0 | 4 votes |
/** Returns true if the toolbar is visible in this configuration * @param tb toolbar * @return true if the toolbar is visible */ public boolean isToolbarVisible(Toolbar tb) { ToolbarConstraints tc = getConstraints(tb.getName()); return tc.isVisible(); }
Example #28
Source File: DnDSupport.java From netbeans with Apache License 2.0 | 4 votes |
private ToolbarContainer getContainer( Toolbar bar ) { return (ToolbarContainer) bar.getParent(); }
Example #29
Source File: DnDSupport.java From netbeans with Apache License 2.0 | 4 votes |
private DataFolder getBackingFolder( Toolbar bar ) { Object res = bar.getClientProperty("folder"); //NOI18N if( res instanceof DataFolder ) return (DataFolder) res; return null; }
Example #30
Source File: DnDSupport.java From netbeans with Apache License 2.0 | 4 votes |
public void dragGestureRecognized(DragGestureEvent e) { Component c = e.getComponent(); if( !(c instanceof JComponent) ) return; Transferable t = null; try { final DataObject dob = (DataObject) ((JComponent) c).getClientProperty("file"); if( dob != null && c.getParent() instanceof Toolbar && buttonDndAllowed ) { //dragging a toolbar button sourceToolbar = (Toolbar) c.getParent(); t = new ExTransferable.Single(buttonDataFlavor) { public Object getData() { return dob; } }; isToolbarDrag = false; isButtonDrag = true; dragSourceButtonIndex = sourceToolbar.getComponentIndex(c); } else if( Boolean.TRUE.equals( ((JComponent) c).getClientProperty(ToolbarContainer.PROP_DRAGGER) ) ) { //dragging the whole toolbar final ToolbarContainer container = (ToolbarContainer) c.getParent().getParent(); if( container.isShowing() ) { sourceContainer = container; sourceRow = (ToolbarRow) container.getParent(); t = new ExTransferable.Single(toolbarDataFlavor) { public Object getData() { return container; } }; isToolbarDrag = true; isButtonDrag = false; startingPoint = new Point(e.getDragOrigin()); Rectangle bounds = new Rectangle(sourceContainer.getPreferredSize()); bounds.setLocation(sourceContainer.getLocationOnScreen()); dragImage = createContentImage(sourceContainer, bounds.getSize()); sourceRow.dragStarted( sourceContainer ); dragWindow = createDragWindow( dragImage, bounds ); } } if( c instanceof JButton ) { ((JButton) c).getModel().setArmed(false); ((JButton) c).getModel().setPressed(false); ((JButton) c).getModel().setRollover(true); } if( t != null ) { e.startDrag(dragMoveCursor, t, this); } } catch( InvalidDnDOperationException idoE ) { log.log(Level.INFO, null, idoE); } }