/** Creates new form DirectoryChooserPanel */ public DirectoryChooserPanel(String seed, PropertyEditorSupport editor, PropertyEnv propenv, FileSystem fileSystem) { initComponents(); this.seed = seed; this.editor = editor; this.fileSystem = fileSystem; directoryTextField.setText(seed); propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION); propenv.addPropertyChangeListener(this); }
private DirectoriesChooser(PropertyEditorSupport editor, PropertyEnv env, String baseDir, String path, FileSystem fileSystem){ super(getPathsFromString(path)); getDefaultButton().setVisible(false); this.editor = editor; this.baseDir = baseDir; this.path = path; this.fileSystem = fileSystem; env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); }
/** Create a StringCustomEditor. * @param value the initial value for the string * @param editable whether to show the editor in read only or read-write mode * @param oneline whether the text component should be a single-line or multi-line component * @param instructions any instructions that should be displayed */ StringCustomEditor (String value, boolean editable, boolean oneline, String instructions, PropertyEditor editor, PropertyEnv env) { this.oneline = oneline; this.instructions = instructions; this.env = env; this.editor = editor; this.env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); this.env.addPropertyChangeListener(this); init (value, editable); }
/** Creates new form NewJPanel */ public StringPanel(StringEditor stringEditor, PropertyEnv env) { this.stringEditor = stringEditor; initComponents(); textPane.setText(stringEditor.getAsText()); setPreferredSize(new Dimension(400, 300)); env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); }
private void commonInit( String panelTitle, PropertyEnv env ) { getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PointCustomEditor.class, "ACSD_PointCustomEditor")); setBorder (new javax.swing.border.EmptyBorder(12, 12, 0, 11)); insidePanel.setBorder (new javax.swing.border.CompoundBorder ( new javax.swing.border.TitledBorder ( new javax.swing.border.EtchedBorder (), " " + panelTitle + " " ), new javax.swing.border.EmptyBorder (new java.awt.Insets(5, 5, 5, 5)))); env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); setPanel( insidePanel ); xField.addKeyListener(this); yField.addKeyListener(this); getMap().put( xField , xLabel ); getMap().put( yField , yLabel ); }
public Spud(Property prop, PropertyEditor editor, PropertyModel model, PropertyEnv env, Component customEditor, PropertyChangeListener envListener, VetoableChangeListener veto) { if (prop != null) { property = new WeakReference(property); } if (editor != null) { this.editor = new WeakReference(editor); } if (env != null) { this.env = new WeakReference(env); env.addPropertyChangeListener(WeakListeners.propertyChange(this, env)); env.addVetoableChangeListener(WeakListeners.vetoableChange(this, env)); } if (customEditor != null) { this.customEditor = new WeakReference(customEditor); } if (envListener != null) { this.envListener = new WeakReference(envListener); } if (veto != null) { this.venvListener = new WeakReference(veto); } if (model != null) { this.model = new WeakReference(model); model.addPropertyChangeListener(WeakListeners.propertyChange(this, editor)); } if (editor != null) { editor.addPropertyChangeListener(this); } }
private JFileChooser createDirPanel(String seed, final PropertyEditorSupport editor, PropertyEnv propenv) { String titleText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("Run_Directory"); String buttonText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("SelectLabel"); final JFileChooser chooser = RemoteFileUtil.createFileChooser(getSourceExecutionEnvironment(), titleText, buttonText, JFileChooser.DIRECTORIES_ONLY, null, seed, true); chooser.putClientProperty("title", chooser.getDialogTitle()); // NOI18N chooser.setControlButtonsAreShown(false); propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION); propenv.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) && evt.getNewValue() == PropertyEnv.STATE_VALID) { File selectedFile= chooser.getSelectedFile(); String path = CndPathUtilities.toRelativePath(makeConfiguration.getBaseDir(), selectedFile.getPath()); // FIXUP: not always relative path path = CndPathUtilities.normalizeSlashes(path); editor.setValue(path); } } }); return chooser; }
private void detachFromEnv(PropertyEnv env) { // System.err.println(" detachFromEnv - " + env); env.removeVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(null); attachedEnv = null; }
private void detachFromEnv(PropertyEnv env) { // System.err.println(" detachFromEnv - " + env); env.removeVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(null); attachedEnv = null; }
private void detachFromEnv(PropertyEnv env) { // System.err.println(" detachFromEnv - " + env); env.removeVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(null); attachedEnv = null; }
/** Creates new form CustomizerCompile */ public ExceptionsPanel(PropertyEditorSupport propertyEditor, PropertyEnv env, Exceptions exceptions) { this.propertyEditor = propertyEditor; initComponents(); adjustButtons(); setPreferredSize(new java.awt.Dimension(500, 500)); // Arrange for propertyChange to get called when OK is pressed. env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); this.exceptions = exceptions; initValues(exceptions); }
/** Creates new form CustomizerCompile */ public PathmapPanel(PropertyEditorSupport propertyEditor, PropertyEnv env, Pathmap pathmap) { this.propertyEditor = propertyEditor; initComponents(); adjustButtons(); // Arrange for propertyChange to get called when OK is pressed. env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); this.pathmap = pathmap; initValues(pathmap); }
private void attachToEnv(PropertyEnv env) { env.addPropertyChangeListener(getEnvListener()); env.addVetoableChangeListener(getEnvListener()); env.setBeans(EditorPropertyDisplayer.findBeans(this)); }
private void attachToEnv(PropertyEnv env) { if (attachedEnv == env) { return; } // System.err.println(" attachToEnv - " + env); env.addVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(findBeans(this)); }
private void attachToEnv(PropertyEnv env) { env.addPropertyChangeListener(getEnvListener()); env.addVetoableChangeListener(getEnvListener()); env.setBeans(EditorPropertyDisplayer.findBeans(this)); }
private void attachToEnv(PropertyEnv env) { if (attachedEnv == env) { return; } // System.err.println(" attachToEnv - " + env); env.addVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(findBeans(this)); }
/** Creates new form EnvPanel */ public EnvPanel(Env env, PropertyEditorSupport editor, PropertyEnv propenv) { initComponents(); this.env = env; this.editor = editor; envvarScrollPane.getViewport().setBackground(java.awt.Color.WHITE); // Environment Variables envvarModel = new ListTableModel(getString("EnvName"), getString("EnvValue")); envvarTable = new JTable(envvarModel); envvarModel.setTable(envvarTable); envvarScrollPane.setViewportView(envvarTable); initValues(env); propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION); propenv.addPropertyChangeListener(this); // Accessibility environmentLabel.setLabelFor(envvarTable); envvarTable.getAccessibleContext().setAccessibleDescription(getString("ACSD_ENV_VAR_TABLE")); addButton.getAccessibleContext().setAccessibleDescription(getString("ACSD_ADD_BUTTON")); removeButton.getAccessibleContext().setAccessibleDescription(getString("ACSD_REMOVE_BUTTON")); envvarTable.getSelectionModel().addListSelectionListener(this); validateButtons(); }
private void attachToEnv(PropertyEnv env) { env.addPropertyChangeListener(getEnvListener()); env.addVetoableChangeListener(getEnvListener()); env.setBeans(EditorPropertyDisplayer.findBeans(this)); }
private void attachToEnv(PropertyEnv env) { if (attachedEnv == env) { return; } // System.err.println(" attachToEnv - " + env); env.addVetoableChangeListener(getEnvListener()); env.addPropertyChangeListener(getEnvListener()); env.setBeans(findBeans(this)); }
/** * Creates new form CustomizerCompile */ public SignalsPanel(PropertyEditorSupport propertyEditor, PropertyEnv env, Signals signals) { this.propertyEditor = propertyEditor; initComponents(); // Arrange for propertyChange to get called when OK is pressed. env.setState(PropertyEnv.STATE_NEEDS_VALIDATION); env.addPropertyChangeListener(this); assert signals.isClone() : "SignalsPanel.<init>() didn't get a clone"; this.signals = signals; // Transfer out stuff to TableModel if (signals.count() == 0) sigmodel.signalsUpdated(null); else sigmodel.signalsUpdated(signals); }