當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。