/** The constructor all the other constructors call */ private PropertyPanel(Node.Property p, int preferences, PropertyModel mdl) { if (p == null) { prop = ModelProperty.toProperty(mdl); } else { prop = p; } this.preferences = preferences; initializing = true; setModel(mdl); initializing = false; setOpaque(true); //for debugging, allow CTRL-. to dump the state to stderr getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_PERIOD, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "dump"); getActionMap().put("dump", new AbstractAction() { //NOI18N public void actionPerformed(ActionEvent ae) { System.err.println(""); //NOI18N System.err.println(PropertyPanel.this); System.err.println(""); //NOI18N } }); //#44226 - Unpretty, but this allows the TreeTableView to invoke a custom editor dialog when //necessary - with the TTV rewrite, all cell editor infrastructure will be moved to //org.netbeans.modules.openide.explorer, and they will simply share editor classes. Since that //involves an API change (some package private methods of PropertyEnv need to be accessible to //the editor classes), this will have to wait for after 4.0 - Tim getActionMap().put("invokeCustomEditor", new CustomEditorProxyAction()); //NOI18N }
/** The constructor all the other constructors call */ private PropertyPanel(Node.Property p, int preferences, PropertyModel mdl) { if (p == null) { prop = ModelProperty.toProperty(mdl); } else { prop = p; } this.preferences = preferences; initializing = true; setModel(mdl); initializing = false; setOpaque(true); //for debugging, allow CTRL-. to dump the state to stderr getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_PERIOD, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "dump"); getActionMap().put("dump", new AbstractAction() { //NOI18N public void actionPerformed(ActionEvent ae) { System.err.println(""); //NOI18N System.err.println(PropertyPanel.this); System.err.println(""); //NOI18N } }); //#44226 - Unpretty, but this allows the TreeTableView to invoke a custom editor dialog when //necessary - with the TTV rewrite, all cell editor infrastructure will be moved to //org.netbeans.modules.openide.explorer, and they will simply share editor classes. Since that //involves an API change (some package private methods of PropertyEnv need to be accessible to //the editor classes), this will have to wait for after 4.0 - Tim getActionMap().put("invokeCustomEditor", new CustomEditorProxyAction()); //NOI18N }
); getActionMap().put( "dump", new AbstractAction() { //NOI18N getActionMap().put("invokeCustomEditor", new CustomEditorProxyAction()); //NOI18N
Action act = panel.getActionMap().get("invokeCustomEditor"); //NOI18N
private boolean openCustomEditor(ActionEvent e) { if (getSelectedRowCount() != 1 || getSelectedColumnCount() != 1) { return false; } int row = getSelectedRow(); if (row < 0) return false; int column = getSelectedColumn(); if (column < 0) return false; Object o = getValueAt(row, column); if (!(o instanceof Node.Property)) { return false; } Node.Property p = (Node.Property) o; if (!Boolean.TRUE.equals(p.getValue("suppressCustomEditor"))) { //NOI18N PropertyPanel panel = new PropertyPanel(p); @SuppressWarnings("deprecation") PropertyEditor ed = panel.getPropertyEditor(); if ((ed != null) && ed.supportsCustomEditor()) { Action act = panel.getActionMap().get("invokeCustomEditor"); //NOI18N if (act != null) { act.actionPerformed(null); return true; } } } return false; } }
Action act = panel.getActionMap().get("invokeCustomEditor"); //NOI18N
PropertyEditor ed = panel.getPropertyEditor(); if (ed != null && ed.supportsCustomEditor()) { Action act = panel.getActionMap().get("invokeCustomEditor"); //NOI18N if (act != null) { SwingUtilities.invokeLater (new Runnable(){
PropertyEditor ed = panel.getPropertyEditor(); if (ed != null && ed.supportsCustomEditor()) { Action act = panel.getActionMap().get("invokeCustomEditor"); //NOI18N if (act != null) { SwingUtilities.invokeLater (new Runnable(){