public void showProperties(Node[] nodes) { PropertySheet ps = new PropertySheet(); ps.setNodes(nodes); JDialog d = new JDialog(); d.setTitle("Properties"); // XXX I18N d.setModal(true); d.getContentPane().setLayout(new BorderLayout()); d.getContentPane().add(ps, BorderLayout.CENTER); d.pack(); d.setVisible(true); d.dispose(); }
/** Enable/disable display of the description area */ void setDescriptionVisible(boolean val) { setDescriptionAreaVisible (val); PropUtils.saveShowDescription(val); }
/** Install actions the property sheet will need */ private void initActions() { Action invokePopupAction = new MutableAction(MutableAction.INVOKE_POPUP, this); table.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_MASK), ACTION_INVOKE_POPUP); table.getActionMap().put(ACTION_INVOKE_POPUP, invokePopupAction); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_MASK), ACTION_INVOKE_POPUP ); getActionMap().put(ACTION_INVOKE_POPUP, invokePopupAction); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), ACTION_INVOKE_HELP ); getActionMap().put(ACTION_INVOKE_HELP, helpAction); }
PropertySheet propertySheet = new PropertySheet(); for (String key : CustomPropertyItem.customDataMap.keySet()) propertySheet.getItems().add(new CustomPropertyItem(key));
public void disableEdit() { ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[]{}); }
setLayout(new BorderLayout()); psheet.setBackground(table.getBackground()); setBackground(table.getBackground()); psheet.setMarginColor(PropUtils.getSetRendererColor()); add(psheet, BorderLayout.CENTER); setDescriptionVisible(showDesc); setMinimumSize(new Dimension(100, 50)); psheet.setEmptyString(NbBundle.getMessage(PropertySheet.class, "CTL_NoProperties")); //NOI18N setSortingMode(PropUtils.getSavedSortOrder()); } catch (PropertyVetoException e) {
propertySheet = new PropertySheet(); propertySheet.setNodes(new Node[]{new PreviewNode(propertySheet)}); propertySheet.setDescriptionAreaVisible(false);
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; propertySheet = new PropertySheet(); setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(propertySheet, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables
holder = new PropertySheet(); holder.setOpaque(false); holder.setDescriptionAreaVisible(false); holder.setPreferredSize(new Dimension(250,150)); GridBagConstraints fillConstraints = new GridBagConstraints(); fillConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
@Override public void start(Stage primaryStage) { PropertySheet propertySheet = new PropertySheet(); propertySheet.setPropertyEditorFactory(new CustomPropertyEditorFactory()); Musicians address = new Musicians(); // 1: set initial selected values: address.getPersons().add(new Person("Paul", "McCartney")); // 2: listen to changes in selection: address.personsProperty().addListener((ors, ov, nv) -> { System.out.println("Selected persons:"); nv.forEach(System.out::println); }); propertySheet.getItems().setAll(BeanPropertyUtils.getProperties(address)); Scene scene = new Scene(propertySheet, 500, 500); primaryStage.setScene(scene); primaryStage.show(); }
@Override public boolean isEnabled() { if ((id == INVOKE_POPUP) && Boolean.TRUE.equals(sheet.getClientProperty("disablePopup"))) { return false; } return super.isEnabled(); } }
public void addNotify() { super.addNotify(); explorerManager = ExplorerManager.find(this); if (!guiInitialized) { initializeGUI(); } // add propertyChange listeners to the explorerManager explorerManager.addPropertyChangeListener(managerListener); setNodes(explorerManager.getSelectedNodes()); }
@Override public void removeNotify() { Node lastSel = null; if (pclistener != null) { //Save the last selection - if we're being transiently removed, //i.e. because of drag and drop, we'll want to reset it on the //next addNotify if it hasn't disappeared lastSel = pclistener.detach(); } doSetNodes(null); if (lastSel != null) { //Save the selected node in case we're re-added to a container storedNode = new WeakReference<Node>(lastSel); } super.removeNotify(); table.getReusablePropertyEnv().setBeans(null); table.getReusablePropertyEnv().setNode(null); table.getReusablePropertyModel().setProperty(null); }
void cancel() { holder.setNodes(null); if (filter != Filter.All) { return; } preferencesModel.clear(language); propertyChanged = false; stylesChanged = false; }
setLayout(new BorderLayout()); psheet.setBackground(table.getBackground()); setBackground(table.getBackground()); psheet.setMarginColor(PropUtils.getSetRendererColor()); add (psheet, BorderLayout.CENTER); setDescriptionVisible (showDesc); setMinimumSize(new Dimension(100, 50)); psheet.setEmptyString(NbBundle.getMessage( PropertySheet.class, "CTL_NoProperties")); //NOI18N setSortingMode (PropUtils.getSavedSortOrder()); } catch (PropertyVetoException e) {
private void deriveTreeListColors() { new PropertySheet();
public boolean isEnabled() { if (id == INVOKE_POPUP && Boolean.TRUE.equals (sheet.getClientProperty("disablePopup"))) { return false; } return super.isEnabled(); } }
public void addNotify () { super.addNotify (); explorerManager = ExplorerManager.find (this); if (!guiInitialized) initializeGUI(); // add propertyChange listeners to the explorerManager explorerManager.addPropertyChangeListener(managerListener); setNodes (explorerManager.getSelectedNodes ()); }
public void removeNotify() { Node lastSel = null; if (pclistener != null) { //Save the last selection - if we're being transiently removed, //i.e. because of drag and drop, we'll want to reset it on the //next addNotify if it hasn't disappeared lastSel = pclistener.detach(); } doSetNodes(null); if (lastSel != null) { //Save the selected node in case we're re-added to a container storedNode = new WeakReference(lastSel); } super.removeNotify(); table.getReusablePropertyEnv().setBeans(null); table.getReusablePropertyEnv().setNode(null); table.getReusablePropertyModel().setProperty(null); }
/** * Switch to new model. */ public void update(Sheet sheet) { dummyNodes[0].setSheet(sheet); super.setNodes(dummyNodes); } }