Java Code Examples for com.intellij.ide.util.PropertiesComponent#isTrueValue()

The following examples show how to use com.intellij.ide.util.PropertiesComponent#isTrueValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChooseRunConfigurationPopup.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nullable
protected String getAdText(final Executor alternateExecutor) {
  final PropertiesComponent properties = PropertiesComponent.getInstance();
  if (alternateExecutor != null && !properties.isTrueValue(myAddKey)) {
    return String.format("Hold %s to %s", KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke("SHIFT")), alternateExecutor.getActionName());
  }

  if (!properties.isTrueValue("run.configuration.edit.ad")) {
    return String.format("Press %s to Edit", KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke("F4")));
  }

  if (!properties.isTrueValue("run.configuration.delete.ad")) {
    return String.format("Press %s to Delete configuration", KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke("DELETE")));
  }

  return null;
}
 
Example 2
Source File: ChooseRunConfigurationPopup.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void removeSelected() {
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  if (!propertiesComponent.isTrueValue("run.configuration.delete.ad")) {
    propertiesComponent.setValue("run.configuration.delete.ad", Boolean.toString(true));
  }

  final int index = getSelectedIndex();
  if (index == -1) {
    return;
  }

  final Object o = getListModel().get(index);
  if (o != null && o instanceof ItemWrapper && ((ItemWrapper)o).canBeDeleted()) {
    deleteConfiguration(myProject, (RunnerAndConfigurationSettings)((ItemWrapper)o).getValue());
    getListModel().deleteItem(o);
    final List<Object> values = getListStep().getValues();
    values.remove(o);

    if (index < values.size()) {
      onChildSelectedFor(values.get(index));
    }
    else if (index - 1 >= 0) {
      onChildSelectedFor(values.get(index - 1));
    }
  }
}
 
Example 3
Source File: GotoFileModel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void saveInitialCheckBoxState(boolean state) {
  PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject);
  if (propertiesComponent.isTrueValue("GoToClass.toSaveIncludeLibraries")) {
    propertiesComponent.setValue("GoToFile.includeJavaFiles", Boolean.toString(state));
  }
}
 
Example 4
Source File: GotoFileModel.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean loadInitialCheckBoxState() {
  PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject);
  return propertiesComponent.isTrueValue("GoToClass.toSaveIncludeLibraries") && propertiesComponent.isTrueValue("GoToFile.includeJavaFiles");
}