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


Java PropertiesComponent.setValue方法代码示例

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


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

示例1: apply

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
   PropertiesComponent prop = PropertiesComponent.getInstance();
   prop.setValue(FOLDER, imageFolder.getText());

   String timeExecutionValue = timeExecution.getText();
   prop.setValue(TIME_EXECUTION, timeExecutionValue);

   int opcity = opacity.getValue();
   prop.setValue(OPACITY, String.valueOf(opcity));

   boolean isDisabled = disabled.isSelected();
   prop.setValue(DISABLED, isDisabled);

   ScheduledExecutorServiceHandler.shutdownExecution();

   if(isDisabled) {
      ActionManager.getInstance().getAction("clearBackgroundImage").actionPerformed(null);
   }else {
      ActionManager.getInstance().getAction("randomBackgroundImage").actionPerformed(null);
   }
}
 
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:23,代码来源:Settings.java

示例2: showDiscountOffer

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private void showDiscountOffer(final Project project) {
    final PropertiesComponent properties = PropertiesComponent.getInstance();
    final long lastNotificationTime = properties.getOrInitLong(LAST_DISCOUNT_OFFER_TIME_PROPERTY, 0);
    final long currentTime = System.currentTimeMillis();

    if (currentTime - lastNotificationTime >= DateFormatUtil.MONTH) {
        properties.setValue(LAST_DISCOUNT_OFFER_TIME_PROPERTY, String.valueOf(currentTime));

        final Notification notification = notificationGroup.createNotification(
            HybrisI18NBundleUtils.message("evaluation.license.discount.offer.bubble.title"),
            HybrisI18NBundleUtils.message("evaluation.license.discount.offer.bubble.text"),
            NotificationType.INFORMATION,
            (myNotification, myHyperlinkEvent) -> goToDiscountOffer(myHyperlinkEvent)
        );
        notification.setImportant(true);
        Notifications.Bus.notify(notification, project);

        ApplicationManager.getApplication().invokeLater(() -> {
            if (!notificationClosingAlarm.isDisposed()) {
                notificationClosingAlarm.addRequest(notification::hideBalloon, 3000);
            }
        });

    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:HybrisProjectManagerListener.java

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

示例4: apply

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
    PropertiesComponent prop = PropertiesComponent.getInstance();

    boolean autoChange = autoChangeCheckBox.isSelected();
    int interval = ((SpinnerNumberModel) intervalSpinner.getModel()).getNumber().intValue();

    prop.setValue(FOLDER, imageFolder.getText());
    prop.setValue(INTERVAL, interval, 0);
    prop.setValue(AUTO_CHANGE, autoChange);
    intervalSpinner.setEnabled(autoChange);

    if (autoChange && interval > 0) {
        BackgroundService.start();
    } else {
        BackgroundService.stop();
    }
}
 
开发者ID:lachlankrautz,项目名称:backgroundImagePlus,代码行数:19,代码来源:Settings.java

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

示例6: setConfigurations

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public void setConfigurations(@NotNull List<FileColorConfiguration> configurations, boolean isProjectLevel) {
  if (isProjectLevel) {
    myProjectLevelConfigurations.clear();
    myProjectLevelConfigurations.addAll(configurations);
  }
  else {
    myApplicationLevelConfigurations.clear();
    Map<String, String> predefinedScopeNameToPropertyKey = new THashMap<String, String>(FileColorsModel.predefinedScopeNameToPropertyKey);
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    for (FileColorConfiguration configuration : configurations) {
      myApplicationLevelConfigurations.add(configuration);
      String propertyKey = predefinedScopeNameToPropertyKey.remove(configuration.getScopeName());
      if (propertyKey != null) {
        propertiesComponent.setValue(propertyKey, configuration.getColorName());
      }
    }
    for (String scopeName : predefinedScopeNameToPropertyKey.keySet()) {
      // empty string means that value deleted
      propertiesComponent.setValue(predefinedScopeNameToPropertyKey.get(scopeName), "");
      // previously it was saved incorrectly as scope name instead of specified property key
      propertiesComponent.setValue(scopeName, null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FileColorsModel.java

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

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

示例9: doOKAction

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
protected void doOKAction() {
  final PropertiesComponent properties = PropertiesComponent.getInstance(myProject);

  final IDevice selectedDevice = getSelectedDevice();
  if (selectedDevice == null) {
    return;
  }

  final Client selectedClient = getSelectedClient();
  if (selectedClient == null) {
    return;
  }

  super.doOKAction();

  properties.setValue(DEBUGGABLE_DEVICE_PROPERTY, selectedDevice.getName());
  properties.setValue(DEBUGGABLE_PROCESS_PROPERTY, selectedClient.getClientData().getClientDescription());
  properties.setValue(SHOW_ALL_PROCESSES_PROPERTY, Boolean.toString(myShowAllProcessesCheckBox.isSelected()));

  final String debugPort = Integer.toString(selectedClient.getDebuggerListenPort());

  closeOldSessionAndRun(debugPort);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AndroidProcessChooserDialog.java

示例10: save

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public void save(@NotNull Element e, boolean isProjectLevel) {
  List<FileColorConfiguration> configurations = isProjectLevel ? myProjectLevelConfigurations : myApplicationLevelConfigurations;
  for (FileColorConfiguration configuration : configurations) {
    String scopeName = configuration.getScopeName();
    String propertyKey = isProjectLevel ? null : predefinedScopeNameToPropertyKey.get(scopeName);
    if (propertyKey == null) {
      configuration.save(e);
    }
    else {
      PropertiesComponent propertyComponent = PropertiesComponent.getInstance();
      propertyComponent.setValue(propertyKey, configuration.getColorName(), predefinedScopeNameToColor.get(scopeName));
      // previously it was saved incorrectly as scope name instead of specified property key
      PropertiesComponent.getInstance().setValue(scopeName, null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FileColorsModel.java

示例11: apply

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
public void apply() throws ConfigurationException {
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    propertiesComponent.setValue("com.bkv.intellij.icons.api_key", txtApiKey.getText());
    propertiesComponent.setValue("com.bkv.intellij.icons.refresh_interval", txtRefreshInterval.getText());
    changed = false;

    BuildsModel.resetInstance();
}
 
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:9,代码来源:Settings.java

示例12: initComponent

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void initComponent() {
    ActionManager am = ActionManager.getInstance();
    AnAction action = new AnAction("JNomad Configuration") {
        @Override
        public void actionPerformed(AnActionEvent anActionEvent) {
            Project project = Objects.requireNonNull(anActionEvent.getData(PlatformDataKeys.PROJECT));
            JNomadConfigurationPanel configPanel = new JNomadConfigurationPanel();
            DialogBuilder builder = new DialogBuilder(project);
            builder.setTitle("JNomad Configuration");
            builder.setCenterPanel(configPanel);
            builder.setOkActionEnabled(true);
            if (configPanel.getPluginConfiguration().getEnvironmentList().isEmpty()) {
                builder.setPreferredFocusComponent(configPanel.getEnvironmentNameTextField());
            } else {
                builder.setPreferredFocusComponent(configPanel.getDatabaseHostTextField());
            }

            if (DialogWrapper.OK_EXIT_CODE == builder.show()) {
                JNomadPluginConfiguration pluginConfiguration = configPanel.getPluginConfiguration();
                pluginConfiguration.setSlowQueryThreshold(configPanel.getSlowQueryThreshold());
                pluginConfiguration.setRecommendIndexThreshold(configPanel.getRecommendIndexThreshold());

                PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
                propertiesComponent.setValue("jnomad.plugin.configuration", new Gson().toJson(pluginConfiguration));
                JNomadInspection.resetJNomadSetup();
            }
        }
    };
    am.registerAction("JNomadPluginAction", action);

    //add to analyze menu
    DefaultActionGroup windowM = (DefaultActionGroup) am.getAction("AnalyzeMenu");
    windowM.addSeparator();
    windowM.add(action);
}
 
开发者ID:BFergerson,项目名称:JNomad-Plugin,代码行数:37,代码来源:JNomadPluginRegistration.java

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

示例14: apply

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
    PropertiesComponent prop = PropertiesComponent.getInstance();
    prop.setValue(TEMPLATE_PATTERN_PROJECT, projectTemplatePattern.getText());
    prop.setValue(TEMPLATE_PATTERN_FILE, fileTemplatePattern.getText());

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

示例15: commitForNext

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
protected void commitForNext() throws CommitStepException {
  if (myIdeaAndroidProject == null) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.no.model"));
  }

  final String apkFolder = myApkPathField.getText().trim();
  if (apkFolder.isEmpty()) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.destination"));
  }

  File f = new File(apkFolder);
  if (!f.isDirectory() || !f.canWrite()) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.invalid.destination"));
  }

  int[] selectedFlavorIndices = myFlavorsList.getSelectedIndices();
  if (!myFlavorsListModel.isEmpty() && selectedFlavorIndices.length == 0) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.flavors"));
  }

  Object[] selectedFlavors = myFlavorsList.getSelectedValues();
  List<String> flavors = new ArrayList<String>(selectedFlavors.length);
  for (int i = 0; i < selectedFlavors.length; i++) {
    flavors.add((String)selectedFlavors[i]);
  }

  myWizard.setApkPath(apkFolder);
  myWizard.setGradleOptions((String)myBuildTypeCombo.getSelectedItem(), flavors);

  PropertiesComponent properties = PropertiesComponent.getInstance(myWizard.getProject());
  properties.setValue(PROPERTY_APK_PATH, apkFolder);
  properties.setValues(PROPERTY_FLAVORS, ArrayUtil.toStringArray(flavors));
  properties.setValue(PROPERTY_BUILD_TYPE, (String)myBuildTypeCombo.getSelectedItem());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GradleSignStep.java


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