当前位置: 首页>>代码示例>>Java>>正文


Java PropertiesComponent.getBoolean方法代码示例

本文整理汇总了Java中com.intellij.ide.util.PropertiesComponent.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java PropertiesComponent.getBoolean方法的具体用法?Java PropertiesComponent.getBoolean怎么用?Java PropertiesComponent.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.util.PropertiesComponent的用法示例。


在下文中一共展示了PropertiesComponent.getBoolean方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isModified

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public boolean isModified() {
   PropertiesComponent prop = PropertiesComponent.getInstance();
   String storedFolder = prop.getValue(FOLDER);
   String storedTimeExecution = prop.getValue(TIME_EXECUTION);
   int storedOpacity = getStoredOpacity(prop);
   boolean storedDisabledOption = prop.getBoolean(DISABLED);

   String uiFolder = imageFolder.getText();
   String uiTimeExecution = timeExecution.getText();
   int uiOpacity = opacity.getValue();
   boolean isDisabled = disabled.isSelected();

   if (storedFolder == null) {
      storedFolder = "";
   }
   if (storedTimeExecution == null) {
      storedTimeExecution = "";
   }

   return !storedFolder.equals(uiFolder) || !storedTimeExecution.equals(uiTimeExecution) || storedOpacity != uiOpacity || storedDisabledOption != isDisabled;
}
 
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:23,代码来源:Settings.java

示例2: applyAndSave

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public static void applyAndSave(@NotNull PropertiesComponent p,
                                @NotNull UISettings ui,
                                @NotNull EditorSettingsExternalizable.OptionSet eo,
                                @NotNull DaemonCodeAnalyzerSettings ds,
                                String before, String after, boolean value) {
  // @formatter:off
  p.setValue(before + "SHOW_STATUS_BAR",          valueOf(ui.SHOW_STATUS_BAR));           ui.SHOW_STATUS_BAR          = p.getBoolean(after + "SHOW_STATUS_BAR",  value); 
  p.setValue(before + "SHOW_MAIN_TOOLBAR",        valueOf(ui.SHOW_MAIN_TOOLBAR));         ui.SHOW_MAIN_TOOLBAR        = p.getBoolean(after + "SHOW_MAIN_TOOLBAR", value); 
  p.setValue(before + "SHOW_NAVIGATION_BAR",      valueOf(ui.SHOW_NAVIGATION_BAR));       ui.SHOW_NAVIGATION_BAR      = p.getBoolean(after + "SHOW_NAVIGATION_BAR", value); 

  p.setValue(before + "IS_FOLDING_OUTLINE_SHOWN", valueOf(eo.IS_FOLDING_OUTLINE_SHOWN));  eo.IS_FOLDING_OUTLINE_SHOWN = p.getBoolean(after + "IS_FOLDING_OUTLINE_SHOWN", value); 
  p.setValue(before + "IS_WHITESPACES_SHOWN",     valueOf(eo.IS_WHITESPACES_SHOWN));      eo.IS_WHITESPACES_SHOWN     = p.getBoolean(after + "IS_WHITESPACES_SHOWN", value); 
  p.setValue(before + "ARE_LINE_NUMBERS_SHOWN",   valueOf(eo.ARE_LINE_NUMBERS_SHOWN));    eo.ARE_LINE_NUMBERS_SHOWN   = p.getBoolean(after + "ARE_LINE_NUMBERS_SHOWN", value); 
  p.setValue(before + "IS_RIGHT_MARGIN_SHOWN",    valueOf(eo.IS_RIGHT_MARGIN_SHOWN));     eo.IS_RIGHT_MARGIN_SHOWN    = p.getBoolean(after + "IS_RIGHT_MARGIN_SHOWN", value); 
  p.setValue(before + "IS_INDENT_GUIDES_SHOWN",   valueOf(eo.IS_INDENT_GUIDES_SHOWN));    eo.IS_INDENT_GUIDES_SHOWN   = p.getBoolean(after + "IS_INDENT_GUIDES_SHOWN", value); 
  p.setValue(before + "SHOW_BREADCRUMBS",         valueOf(eo.SHOW_BREADCRUMBS));          eo.SHOW_BREADCRUMBS         = p.getBoolean(after + "SHOW_BREADCRUMBS", value); 

  p.setValue(before + "SHOW_METHOD_SEPARATORS",   valueOf(ds.SHOW_METHOD_SEPARATORS));    ds.SHOW_METHOD_SEPARATORS   = p.getBoolean(after + "SHOW_METHOD_SEPARATORS", value);
  
  p.setValue(before + "HIDE_TOOL_STRIPES",        valueOf(ui.HIDE_TOOL_STRIPES));         ui.HIDE_TOOL_STRIPES        = p.getBoolean(after + "HIDE_TOOL_STRIPES", !value);
  p.setValue(before + "EDITOR_TAB_PLACEMENT",     valueOf(ui.EDITOR_TAB_PLACEMENT));      ui.EDITOR_TAB_PLACEMENT     = p.getInt(after + "EDITOR_TAB_PLACEMENT", value ? SwingConstants.TOP : UISettings.TABS_NONE);
  // @formatter:on
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ToggleDistractionFreeModeAction.java

示例3: DefaultHtmlDoctypeInitialConfigurator

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
                                             PropertiesComponent propertiesComponent) {
  if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5")) {
    propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", true);
    ExternalResourceManagerEx.getInstanceEx()
      .setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
  }
  // sometimes VFS fails to pick up updated schema contents and we need to force refresh
  if (StringUtilRt.parseInt(propertiesComponent.getValue("DefaultHtmlDoctype.Refreshed"), 0) < VERSION) {
    propertiesComponent.setValue("DefaultHtmlDoctype.Refreshed", Integer.toString(VERSION));
    final String schemaUrl = VfsUtilCore.pathToUrl(Html5SchemaProvider.getHtml5SchemaLocation());
    final VirtualFile schemaFile = VirtualFileManager.getInstance().findFileByUrl(schemaUrl);
    if (schemaFile != null) {
      schemaFile.getParent().refresh(false, true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DefaultHtmlDoctypeInitialConfigurator.java

示例4: PyStudyInitialConfigurator

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
/**
 * @noinspection UnusedParameters
 */
public PyStudyInitialConfigurator(MessageBus bus,
                                  CodeInsightSettings codeInsightSettings,
                                  final PropertiesComponent propertiesComponent,
                                  FileTypeManager fileTypeManager,
                                  final ProjectManagerEx projectManager) {
  if (!propertiesComponent.getBoolean(CONFIGURED_V40)) {
    final File courses = new File(PathManager.getConfigPath(), "courses");
    FileUtil.delete(courses);
    propertiesComponent.setValue(CONFIGURED_V40, "true");
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:15,代码来源:PyStudyInitialConfigurator.java

示例5: isModified

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public boolean isModified() {
    PropertiesComponent prop = PropertiesComponent.getInstance();
    String storedFolder      = prop.getValue(FOLDER);
    String uiFolder          = imageFolder.getText();
    if (storedFolder == null) {
        storedFolder = "";
    }
    return !storedFolder.equals(uiFolder)
            || intervalModified(prop)
            || prop.getBoolean(AUTO_CHANGE) != autoChangeCheckBox.isSelected();
}
 
开发者ID:lachlankrautz,项目名称:backgroundImagePlus,代码行数:13,代码来源:Settings.java

示例6: RandomBackground

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public RandomBackground() {
    super("Random Background Image");
    PropertiesComponent prop = PropertiesComponent.getInstance();
    if (prop.getBoolean(Settings.AUTO_CHANGE, false)) {
        BackgroundService.start();
    }
}
 
开发者ID:lachlankrautz,项目名称:backgroundImagePlus,代码行数:8,代码来源:RandomBackground.java

示例7: actionPerformed

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent evt) {
    RandomBackgroundTask task = new RandomBackgroundTask();
    task.run();
    PropertiesComponent prop = PropertiesComponent.getInstance();
    if (prop.getBoolean(Settings.AUTO_CHANGE, false)) {
        BackgroundService.restart();
    }
}
 
开发者ID:lachlankrautz,项目名称:backgroundImagePlus,代码行数:10,代码来源:RandomBackground.java

示例8: customizeSettings

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private static void customizeSettings(PropertiesComponent propertiesComponent) {
  if (!propertiesComponent.getBoolean(CONFIG_V4)) {
    propertiesComponent.setValue(CONFIG_V4, "true");
    UISettings.getInstance().HIDE_TOOL_STRIPES = false;

    if (!propertiesComponent.getBoolean(CONFIG_V3)) {
      propertiesComponent.setValue(CONFIG_V3, "true");
      // See https://youtrack.jetbrains.com/issue/IDEA-113332
      // It's not really fixed but worked around by turning off the =-quoting
      WebEditorOptions.getInstance().setInsertQuotesForAttributeValue(false);
    }

    if (!propertiesComponent.getBoolean(CONFIG_V1)) {
      propertiesComponent.setValue(CONFIG_V1, "true");
      CodeInsightSettings.getInstance().AUTO_POPUP_JAVADOC_INFO = true;
      UISettings.getInstance().SCROLL_TAB_LAYOUT_IN_EDITOR = true;
      EditorSettingsExternalizable.getInstance().setVirtualSpace(false);

      // For Macs, use 10.5+ keymap as the default
      if (SystemInfo.isMac) {
        setDefaultMacKeymap();
      }
    }

    if (!propertiesComponent.getBoolean(CONFIG_V2)) {
      propertiesComponent.setValue(CONFIG_V2, "true");
      UISettings.getInstance().SHOW_MAIN_TOOLBAR = true;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:AndroidInitialConfigurator.java

示例9: invoke

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void invoke(final @NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
  final Module srcModule = ModuleUtilCore.findModuleForPsiElement(element);
  final PsiClass srcClass = getContainingClass(element);

  if (srcClass == null) return;

  PsiDirectory srcDir = element.getContainingFile().getContainingDirectory();
  PsiPackage srcPackage = JavaDirectoryService.getInstance().getPackage(srcDir);

  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  final HashSet<VirtualFile> testFolders = new HashSet<VirtualFile>();
  checkForTestRoots(srcModule, testFolders);
  if (testFolders.isEmpty() && !propertiesComponent.getBoolean(CREATE_TEST_IN_THE_SAME_ROOT)) {
    if (Messages.showOkCancelDialog(project, "Create test in the same source root?", "No Test Roots Found", Messages.getQuestionIcon()) !=
        Messages.OK) {
      return;
    }

    propertiesComponent.setValue(CREATE_TEST_IN_THE_SAME_ROOT, true);
  }

  final CreateTestDialog d = createTestDialog(project, srcModule, srcClass, srcPackage);
  if (!d.showAndGet()) {
    return;
  }

  CommandProcessor.getInstance().executeCommand(project, new Runnable() {
    @Override
    public void run() {
      TestFramework framework = d.getSelectedTestFrameworkDescriptor();
      final TestGenerator generator = TestGenerators.INSTANCE.forLanguage(framework.getLanguage());
      DumbService.getInstance(project).withAlternativeResolveEnabled(new Runnable() {
        @Override
        public void run() {
          generator.generateTest(project, d);
        }
      });
    }
  }, CodeInsightBundle.message("intention.create.test"), this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:CreateTestAction.java

示例10: PyCharmInitialConfigurator

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public PyCharmInitialConfigurator(MessageBus bus, final PropertiesComponent propertiesComponent, final FileTypeManager fileTypeManager) {
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration", "true");
    EditorSettingsExternalizable.getInstance().setVirtualSpace(false);
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V2")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V2", true);
    final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance().getCurrentSettings();
    settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
    settings.getCommonSettings(PythonLanguage.getInstance()).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
    UISettings.getInstance().SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES = true;
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V3")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V3", "true");
    UISettings.getInstance().SHOW_MEMORY_INDICATOR = false;
    final String ignoredFilesList = fileTypeManager.getIgnoredFilesList();
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            FileTypeManager.getInstance().setIgnoredFilesList(ignoredFilesList + ";*$py.class");
          }
        });
      }
    });
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V4")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V4", true);
    PyCodeInsightSettings.getInstance().SHOW_IMPORT_POPUP = false;
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V5")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V5", true);
    CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT;
  }
  if (!propertiesComponent.isValueSet(DISPLAYED_PROPERTY)) {
    bus.connect().subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() {
      @Override
      public void welcomeScreenDisplayed() {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
            propertiesComponent.setValue(DISPLAYED_PROPERTY, "true");
            showInitialConfigurationDialog();
          }
        });
      }
    });
  }

  Registry.get("ide.scratch.enabled").setValue(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:53,代码来源:PyCharmInitialConfigurator.java


注:本文中的com.intellij.ide.util.PropertiesComponent.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。