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


Java PropertiesComponent.getValue方法代码示例

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


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

示例1: init

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void init(ToolWindow window) {
    builds = BuildsModel.getInstance();
    rootNode = new DefaultMutableTreeNode("CircleCI");
    TreeModel treeModel = new DefaultTreeModel(rootNode);
    tree1.setModel(treeModel);
    tree1.setShowsRootHandles(true);
    tree1.setCellRenderer(new RecentBuildTreeCellRenderer());
    PropertiesComponent component = PropertiesComponent.getInstance();
    Integer refreshInterval;
    try {
        refreshInterval = new Integer(component.getValue("com.bkv.intellij.icons.refresh_interval"));
    } catch (Exception e) {
        refreshInterval = new Integer(99999999);
    }
    enableAutoRefresh(refreshInterval);
    refresh();
}
 
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:19,代码来源:RecentBuildsToolWindowFactory.java

示例2: 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

示例3: CustomFrameTitleBuilder

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public CustomFrameTitleBuilder() {
    PropertiesComponent prop = PropertiesComponent.getInstance();

    projectPattern = prop.getValue(Settings.TEMPLATE_PATTERN_PROJECT, DEFAULT_TEMPLATE_PATTERN_PROJECT);
    filePattern = prop.getValue(Settings.TEMPLATE_PATTERN_FILE, DEFAULT_TEMPLATE_PATTERN_FILE);

    engine = new ScriptEngineManager().getEngineByName("nashorn");

    try {
        // evaluate JavaScript Underscore library
        engine.eval(new InputStreamReader(getClass().getResourceAsStream("/underscore-min.js")));

        // create new JavaScript methods references for templates
        engine.eval("var projectTemplate;");
        engine.eval("var fileTemplate;");

        prepareTemplateSettings();
    } catch (Exception e) {
        // we took precaution below
    }

    TitleComponent.addSettingChangeListener(this);
}
 
开发者ID:mabdurrahman,项目名称:custom-title-plugin,代码行数:24,代码来源:CustomFrameTitleBuilder.java

示例4: run

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void run() {
    PropertiesComponent prop = PropertiesComponent.getInstance();
    String folder = prop.getValue(Settings.FOLDER);
    if (folder == null || folder.isEmpty()) {
        NotificationCenter.notice("Image folder not set");
        return;
    }
    File file = new File(folder);
    if (!file.exists()) {
        NotificationCenter.notice("Image folder not set");
        return;
    }
    String image = imagesHandler.getRandomImage(folder);
    if (image == null) {
        NotificationCenter.notice("No image found");
        return;
    }
    if (image.contains(",")) {
        NotificationCenter.notice("Intellij wont load images with ',' character\n" + image);
    }
    prop.setValue(IdeBackgroundUtil.FRAME_PROP, null);
    prop.setValue(IdeBackgroundUtil.EDITOR_PROP, image);
    // NotificationCenter.notice("Image: " + image.replace(folder + File.separator, ""));
    IdeBackgroundUtil.repaintAllWindows();
}
 
开发者ID:lachlankrautz,项目名称:backgroundImagePlus,代码行数:27,代码来源:RandomBackgroundTask.java

示例5: getInstallationUIDOnWindows

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Nullable
private static String getInstallationUIDOnWindows(PropertiesComponent propertiesComponent) {
  String appdata = System.getenv("APPDATA");
  if (appdata != null) {
    File jetBrainsDir = new File(appdata, "JetBrains");
    if (jetBrainsDir.exists() || jetBrainsDir.mkdirs()) {
      File permanentIdFile = new File(jetBrainsDir, "PermanentUserId");
      try {
        if (permanentIdFile.exists()) {
          return FileUtil.loadFile(permanentIdFile).trim();
        }

        String uuid = propertiesComponent.getValue(INSTALLATION_UID);
        if (uuid == null) {
          uuid = generateUUID();
        }
        FileUtil.writeToFile(permanentIdFile, uuid);
        return uuid;
      }
      catch (IOException ignored) { }
    }
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:UpdateChecker.java

示例6: tweakFrameFullScreen

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private static ActionCallback tweakFrameFullScreen(Project project, boolean inPresentation) {
  Window window = IdeFrameImpl.getActiveFrame();
  if (window instanceof IdeFrameImpl) {
    IdeFrameImpl frame = (IdeFrameImpl)window;
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    if (inPresentation) {
      propertiesComponent.setValue("full.screen.before.presentation.mode", String.valueOf(frame.isInFullScreen()));
      return frame.toggleFullScreen(true);
    }
    else {
      if (frame.isInFullScreen()) {
        final String value = propertiesComponent.getValue("full.screen.before.presentation.mode");
        return frame.toggleFullScreen("true".equalsIgnoreCase(value));
      }
    }
  }
  return ActionCallback.DONE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TogglePresentationModeAction.java

示例7: setCustomState

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private static void setCustomState(FileEditor editor) {
  final FileEditorState state = editor.getState(FileEditorStateLevel.FULL);
  if (state instanceof TransferableFileEditorState) {
    final TransferableFileEditorState editorState = (TransferableFileEditorState)state;
    final String id = editorState.getEditorId();
    final HashMap<String, String> options = new HashMap<String, String>();
    final PropertiesComponent properties = PropertiesComponent.getInstance();
    for (String key : editorState.getTransferableOptions().keySet()) {
      final String value = properties.getValue(getKey(id, key));
      if (value != null) {
        options.put(key, value);
      }
    }
    editorState.setTransferableOptions(options);
    editor.setState(editorState);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VirtualFileDiffElement.java

示例8: initGlobalScopes

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private void initGlobalScopes() {
  PropertiesComponent propertyComponent = PropertiesComponent.getInstance();
  for (String scopeName : predefinedScopeNameToPropertyKey.keySet()) {
    if (findConfiguration(scopeName, false) == null) {
      String color = propertyComponent.getValue(predefinedScopeNameToPropertyKey.get(scopeName));
      if (color == null) {
        // backward compatibility, previously it was saved incorrectly as scope name instead of specified property key
        color = propertyComponent.getValue(scopeName);
        if (color == null) {
          color = predefinedScopeNameToColor.get(scopeName);
        }
      }

      if (!color.isEmpty()) {
        final Color col = ColorUtil.fromHex(color, null);
        final String name = col == null ? null : FileColorManagerImpl.getColorName(col);
        myApplicationLevelConfigurations.add(new FileColorConfiguration(scopeName, name == null ? color : name));
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FileColorsModel.java

示例9: setupPlatform

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private static void setupPlatform(@NotNull Module module) {
  String targetHashString = getTargetHashStringFromPropertyFile(module);
  if (targetHashString != null && findAndSetSdkWithHashString(module, targetHashString)) {
    return;
  }

  PropertiesComponent component = PropertiesComponent.getInstance();
  if (component.isValueSet(DEFAULT_PLATFORM_NAME_PROPERTY)) {
    String defaultPlatformName = component.getValue(DEFAULT_PLATFORM_NAME_PROPERTY);
    Sdk defaultLib = ProjectJdkTable.getInstance().findJdk(defaultPlatformName, AndroidSdkType.getInstance().getName());
    if (defaultLib != null && tryToSetAndroidPlatform(module, defaultLib)) {
      return;
    }
  }
  for (Sdk sdk : getAllAndroidSdks()) {
    AndroidPlatform platform = AndroidPlatform.getInstance(sdk);

    if (platform != null &&
        checkSdkRoots(sdk, platform.getTarget(), false) &&
        tryToSetAndroidPlatform(module, sdk)) {
      component.setValue(DEFAULT_PLATFORM_NAME_PROPERTY, sdk.getName());
      return;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AndroidSdkUtils.java

示例10: getInstance

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public static BuildsModel getInstance()
{
    if (instance == null) {
        PropertiesComponent component = PropertiesComponent.getInstance();
        String token = component.getValue("com.bkv.intellij.icons.api_key", "api_key");

        instance = new BuildsModel(new CircleCiHttpClient(new HttpClient(), "https://circleci.com/api/v1.1/", token));
    }
    return instance;
}
 
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:11,代码来源:BuildsModel.java

示例11: reset

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public void reset() {
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    String apiKey = propertiesComponent.getValue("com.bkv.intellij.icons.api_key", "Your icons api key found under account settings");
    String refreshInterval = propertiesComponent.getValue("com.bkv.intellij.icons.refresh_interval", "30");

    txtApiKey.setText(apiKey);
    txtRefreshInterval.setText(refreshInterval);
    changed = false;
}
 
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:10,代码来源:Settings.java

示例12: getTimeExecution

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private int getTimeExecution(PropertiesComponent prop) {
   try {
      String timeExecution = prop.getValue(Settings.TIME_EXECUTION);
      if (timeExecution.isEmpty()) {
         return -1;
      }
      return Integer.valueOf(timeExecution);
   } catch (NumberFormatException e) {
      NotificationCenter.notice("Please, specify a valid integer number as execution time.");
   }
   return -1;
}
 
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:13,代码来源:RandomBackground.java

示例13: getStoredOpacity

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public static int getStoredOpacity(PropertiesComponent prop) {
   String storedOpacity = prop.getValue(OPACITY);
   try {
      return Integer.valueOf(storedOpacity);
   } catch (NumberFormatException e) {
      //No problem here, we have no previous value
   }
   return 50;
}
 
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:10,代码来源:Settings.java

示例14: prepareTemplateSettings

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private void prepareTemplateSettings() {
    PropertiesComponent prop = PropertiesComponent.getInstance();

    projectPattern = prop.getValue(Settings.TEMPLATE_PATTERN_PROJECT, DEFAULT_TEMPLATE_PATTERN_PROJECT);
    filePattern = prop.getValue(Settings.TEMPLATE_PATTERN_FILE, DEFAULT_TEMPLATE_PATTERN_FILE);

    try {
        // create new JavaScript methods of required templates
        engine.eval("projectTemplate = _.template('" + projectPattern + "')");
        engine.eval("fileTemplate = _.template('" + filePattern + "')");
    } catch (Exception e) {
        // we took precaution below
    }
}
 
开发者ID:mabdurrahman,项目名称:custom-title-plugin,代码行数:15,代码来源:CustomFrameTitleBuilder.java

示例15: isModified

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public boolean isModified() {
    PropertiesComponent prop = PropertiesComponent.getInstance();
    String storedProjectTemplate = prop.getValue(TEMPLATE_PATTERN_PROJECT, "");
    String newProjectTemplate = projectTemplatePattern.getText();

    String storedFileTemplate = prop.getValue(TEMPLATE_PATTERN_FILE, "");
    String newFileTemplate = fileTemplatePattern.getText();

    return !storedProjectTemplate.equals(newProjectTemplate) || !storedFileTemplate.equals(newFileTemplate);
}
 
开发者ID:mabdurrahman,项目名称:custom-title-plugin,代码行数:12,代码来源:Settings.java


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