private Action getDelegate() { ExplorerManager em = manager; if (em == null) { return orig; } Action a = ExplorerUtils.actionCopy(em); if (a.isEnabled()) { return a; } else { return orig; } }
@Override protected void componentDeactivated() { ExplorerUtils.activateActions(manager, false); }
/** Creates new form TemplatesPanel */ public TemplatesPanel (String pathToSelect) { ActionMap map = getActionMap (); map.put (DefaultEditorKit.copyAction, ExplorerUtils.actionCopy (getExplorerManager ())); map.put (DefaultEditorKit.cutAction, ExplorerUtils.actionCut (getExplorerManager ())); map.put (DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste (getExplorerManager ())); map.put ("delete", ExplorerUtils.actionDelete (getExplorerManager (), true)); // NOI18N initComponents (); createTemplateView (); treePanel.add (view, BorderLayout.CENTER); associateLookup (ExplorerUtils.createLookup (getExplorerManager (), map)); initialize (pathToSelect); }
private void checkState(){ if (explorerManager == null || lookup == null){ explorerManager = initExplorer(); lookup = ExplorerUtils.createLookup(explorerManager, new ActionMap()); } }
public ImportExplorerTopComponent() { ExplorerManager manager = controller.getExplorerManager(); ActionMap map = new ActionMap(); //AgroSense-33: // action id "org.openide.actions.DeleteAction" will pass a key to lookup in the action map, // tie it to the explorer action so Node.destroy() will be called: map.put("delete", ExplorerUtils.actionDelete(manager, true)); initComponents(); setName(Bundle.CTL_ImportExplorerTopComponent()); setToolTipText(Bundle.HINT_ImportExplorerTopComponent()); setLayout(new BorderLayout()); view.setRootVisible(false); add(view); associateLookup(ExplorerUtils.createLookup(manager, map)); }
@Override final protected void initExplorer() { try { ExplorerManager manager = new ExplorerManager(); manager.setRootContext(new PlotRootNode(new PlotLayer("plot.node.name", this))); manager.getRootContext().setDisplayName(NbBundle.getMessage(this.getClass(), "plot_explorer.rootnode")); ActionMap map = new ActionMap(); map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager)); map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager)); map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager)); map.put("delete", ExplorerUtils.actionDelete(manager, true)); // or false setExplorerManager(manager, map); } catch (IntrospectionException ex) { Exceptions.printStackTrace(ex); } } }
/** * Updates the content of this lookup according to the given panel. * * @param panel new panel to display in {@code DomTC}. */ void setPanel(DomPanel panel) { Lookup lookup = ExplorerUtils.createLookup(panel.getExplorerManager(), getActionMap()); setLookups(lookup); }
map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(explorerManager)); map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(explorerManager)); map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(explorerManager)); map.put("delete", ExplorerUtils.actionDelete(explorerManager, true)); lookup = ExplorerUtils.createLookup(explorerManager, map);
public RobotEditorTopComponent() { initComponents(); associateLookup (ExplorerUtils.createLookup(mgr, getActionMap())); setDisplayName("Robot Editor"); }
@Override protected void componentActivated() { ExplorerUtils.activateActions(manager, true); }
@Override public void actionPerformed(ActionEvent e) { ExplorerManager em = manager; if (em != null) { Action a = ExplorerUtils.actionCopy(em); if (a.isEnabled()) { doCopy(em); return ; } } getDelegate().actionPerformed(e); }
/** * initializes the layer list explorer manager */ private DataProvider initExplorerDP() { ExplorerManager manager = new ExplorerManager(); manager.setRootContext(new AbstractNode(new CategoryChildren())); manager.getRootContext().setDisplayName(NbBundle.getMessage(this.getClass(), ROOT_NODE_NAME)); ExplorerChangeListener changeListener = new ExplorerChangeListener(); manager.addPropertyChangeListener(changeListener); ActionMap map = new ActionMap(); map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager)); map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager)); map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager)); map.put("delete", ExplorerUtils.actionDelete(manager, true)); // or false // ...but add e.g.: InputMap keys = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); // keys.put(KeyStroke.getKeyStroke("control C"), DefaultEditorKit.copyAction); // keys.put(KeyStroke.getKeyStroke("control X"), DefaultEditorKit.cutAction); // keys.put(KeyStroke.getKeyStroke("control V"), DefaultEditorKit.pasteAction); // keys.put(KeyStroke.getKeyStroke("DELETE"), "delete"); // ...and initialization of lookup variable return new DataProvider(manager, map); }
public DataProvider(ExplorerManager explorerManager, ActionMap actionMap) { this.explorerManager = explorerManager; content = new InstanceContent(); this.lookup = new ProxyLookup(ExplorerUtils.createLookup(explorerManager, actionMap), new AbstractLookup(content)); }
/******************************************************************************************************************* * * Deactivates the component. * ******************************************************************************************************************/ @Override public void notifyDeactivated() { ExplorerUtils.activateActions(explorerManager, false); }
public ClassView() { setLayout(new BorderLayout()); //init(); manager.addPropertyChangeListener(this); ActionMap map = this.getActionMap(); map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager)); setupRootContext(createEmptyRoot()); }
map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager)); map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager)); map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager)); map.put("delete", ExplorerUtils.actionDelete(manager, true)); // or false // NOI18N lookup = ExplorerUtils.createLookup(manager, map);
public TaskDetailTopComponent() { initComponents(); setName(NbBundle.getMessage(TaskDetailTopComponent.class, "CTL_TaskDetailTopComponent")); setToolTipText(NbBundle.getMessage(TaskDetailTopComponent.class, "HINT_TaskDetailTopComponent")); manager.setRootContext(new TaskDetailRootNode((BeanTreeView)jScrollPane1)); setDisplayName (NbBundle.getMessage(TaskDetailTopComponent.class, "TITLE_TaskDetails")); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); editorSynchronizationSupport = new EditorSynchronizationSupport(this); }
@Override protected void componentDeactivated() { ExplorerUtils.activateActions(manager, false); }
manager = new ExplorerManager(); ActionMap map = getActionMap(); map.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(manager)); map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager)); map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager)); map.put("delete", ExplorerUtils.actionDelete(manager, true)); associateLookup(ExplorerUtils.createLookup(manager, map)); pnlBrowse.add(btv, BorderLayout.CENTER); btnIndex.setIcon(new ImageIcon(Utilities.loadImage("org/codehaus/mevenide/repository/refreshRepo.png"))); //NOI18N
public TaskExplorerTopComponent() { initComponents(); setName(NbBundle.getMessage(TaskExplorerTopComponent.class, "CTL_TaskExplorerTopComponent")); setToolTipText(NbBundle.getMessage(TaskExplorerTopComponent.class, "HINT_TaskExplorerTopComponent")); manager.setRootContext(new TaskRootNode()); setDisplayName (NbBundle.getMessage(TaskEditorTopComponent.class, "TITLE_TaskExplorer")); ((TreeView)jScrollPane1).setQuickSearchAllowed(true); associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); }