public ToolPath(JCheckBox checkBox, TextFieldWithBrowseButton textField, @Nullable JTextField parameters, StringProperty pathProperty, BooleanProperty enabledProperty, @Nullable StringProperty parametersProperty) { myCheckBox = checkBox; myTextField = textField; myPathProperty = pathProperty; myEnabledProperty = enabledProperty; myParameters = parameters; myParametersProperty = parametersProperty; final ButtonModel model = myCheckBox.getModel(); model.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateEnabledEffect(); } }); myTextField.addBrowseFolderListener(DiffBundle.message("select.external.diff.program.dialog.title"), null, null, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), TextComponentAccessor.TEXT_FIELD_SELECTED_TEXT); }
public ToolPath(JCheckBox checkBox, TextFieldWithBrowseButton textField, @Nullable JTextField parameters, StringProperty pathProperty, BooleanProperty enabledProperty, @Nullable StringProperty parametersProperty) { myCheckBox = checkBox; myTextField = textField; myPathProperty = pathProperty; myEnabledProperty = enabledProperty; myParameters = parameters; myParametersProperty = parametersProperty; final ButtonModel model = myCheckBox.getModel(); model.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateEnabledEffect(); } }); myTextField.addBrowseFolderListener(DiffBundle.message("select.external.diff.program.dialog.title"), null, null, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), TextComponentAccessor.TEXT_FIELD_SELECTED_TEXT); }
@NotNull private static String getProperty(@Nullable StringProperty oldProperty, @Nullable String newValue, @NotNull String defaultValue) { if (newValue != null) return newValue; if (oldProperty != null) { String oldValue = oldProperty.get(getProperties()); if (!StringUtil.isEmptyOrSpaces(oldValue)) return oldValue; } return defaultValue; }
@Nonnull private static String getProperty(@javax.annotation.Nullable StringProperty oldProperty, @javax.annotation.Nullable String newValue, @Nonnull String defaultValue) { if (newValue != null) return newValue; if (oldProperty != null) { String oldValue = oldProperty.get(getProperties()); if (!StringUtil.isEmptyOrSpaces(oldValue)) return oldValue; } return defaultValue; }
private static void setProperty(@Nullable StringProperty oldProperty, @NotNull String value) { if (oldProperty != null) oldProperty.set(getProperties(), value); }
protected BaseExternalTool(BooleanProperty enableProperty, StringProperty toolProperty) { myEnableProperty = enableProperty; myToolProperty = toolProperty; }
private static void setProperty(@javax.annotation.Nullable StringProperty oldProperty, @Nonnull String value) { if (oldProperty != null) oldProperty.set(getProperties(), value); }