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); } }
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(); }
private boolean isMethodOverridden(NodeAction d, String name) { try { Method m = d.getClass().getMethod(name, new Class[0]); return m.getDeclaringClass() != CallableSystemAction.class; } catch (java.lang.NoSuchMethodException ex) { ex.printStackTrace(); throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N } }
protected void performAction(Node[] activatedNodes) { SwingUtilities.invokeLater(new Runnable() { public void run() { JrxmlVisualView view = IReportManager.getInstance().getActiveVisualView(); ReportObjectScene scene = view.getReportDesignerPanel().getScene(); // Find the backgound image layer... BackgroundImageLayer layer = BackgroundImageUtilities.getBackgroundImageLayer(view, false); JasperDesign jd = view.getModel().getJasperDesign(); jd.removeProperty("ireport.background.image"); jd.removeProperty("ireport.background.image.properties"); if (layer != null) { layer.removeChildren(); scene.validate(); scene.revalidate(true); } (SystemAction.get(ShowBackgroundImageAction.class)).resultChanged(null); firePropertyChange(NodeAction.PROP_ENABLED,true ,false); IReportManager.getInstance().notifyReportChange(); BackgroundImageUtilities.notifyBackgroundOptionsChange(); setEnabled(false); } }); }
/** Creates new form IndexedEditorPanel */ public IndexedEditorPanel(Node node, Node.Property[] props) { initComponents(); detailsPanel.setLayout(new java.awt.BorderLayout()); getExplorerManager().setRootContext(node); rootNode = node; prop = props[0]; getExplorerManager().addPropertyChangeListener(this); treeTableView1.setProperties(props); treeTableView1.setRootVisible(false); treeTableView1.setDefaultActionAllowed(false); treeTableView1.setTreePreferredWidth(200); node.addPropertyChangeListener(this); try { moveUp = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveUpAction")); // NOI18N moveDown = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveDownAction")); // NOI18N newAction = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.NewAction")); // NOI18N } catch (ClassNotFoundException cnfe) { } java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class); propertiesLabel.setDisplayedMnemonic(bundle.getString("CTL_Properties_Mnemonic").charAt(0)); newButton.setMnemonic(bundle.getString("CTL_New_Mnemonic").charAt(0)); deleteButton.setMnemonic(bundle.getString("CTL_Delete_Mnemonic").charAt(0)); upButton.setMnemonic(bundle.getString("CTL_MoveUp_Mnemonic").charAt(0)); downButton.setMnemonic(bundle.getString("CTL_MoveDown_Mnemonic").charAt(0)); treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties")); newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New")); deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete")); upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp")); downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown")); getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel")); }
/** Creates new form IndexedEditorPanel */ public IndexedEditorPanel(Node node, Node.Property[] props) { treeTableView1 = new TreeTableView(); // install proper border setBorder((Border) UIManager.get("Nb.ScrollPane.border")); // NOI18N initComponents(); propertiesLabel.setLabelFor(treeTableView1); jPanel2.setLayout(new java.awt.BorderLayout()); jPanel2.add(treeTableView1); detailsPanel.setLayout(new java.awt.BorderLayout()); getExplorerManager().setRootContext(node); rootNode = node; prop = props[0]; getExplorerManager().addPropertyChangeListener(this); treeTableView1.setProperties(props); treeTableView1.setRootVisible(false); treeTableView1.setDefaultActionAllowed(false); treeTableView1.setTreePreferredWidth(200); node.addPropertyChangeListener(this); try { ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); if (l == null) { l = Thread.currentThread().getContextClassLoader(); } if (l == null) { l = getClass().getClassLoader(); } selectedLookup = org.openide.util.lookup.Lookups.proxy(this); NodeAction globalMoveUp = SystemAction.get(Class.forName("org.openide.actions.MoveUpAction", true, l).asSubclass(NodeAction.class)); // NOI18N NodeAction globalMoveDown = SystemAction.get(Class.forName("org.openide.actions.MoveDownAction", true, l).asSubclass(NodeAction.class)); // NOI18N NodeAction globalNewAction = SystemAction.get(Class.forName("org.openide.actions.NewAction", true, l).asSubclass(NodeAction.class)); // NOI18N // Get context aware instances. moveUp = globalMoveUp.createContextAwareInstance(selectedLookup); moveDown = globalMoveDown.createContextAwareInstance(selectedLookup); newAction = globalNewAction.createContextAwareInstance(selectedLookup); } catch (ClassNotFoundException cnfe) { LOG.log(Level.INFO, "Maybe missing openide.actions module?", cnfe); } java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class); treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties")); newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New")); deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete")); upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp")); downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown")); getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel")); }
public DelegateAction(NodeAction a, Lookup actionContext) { this.delegate = a; this.model = new ActSubMenuModel(actionContext); }