當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertiesComponent類代碼示例

本文整理匯總了Java中com.intellij.ide.util.PropertiesComponent的典型用法代碼示例。如果您正苦於以下問題:Java PropertiesComponent類的具體用法?Java PropertiesComponent怎麽用?Java PropertiesComponent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PropertiesComponent類屬於com.intellij.ide.util包,在下文中一共展示了PropertiesComponent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: save

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
public void save() {

        PropertiesComponent.getInstance().setValue("fieldPrivateMode", "" + isFieldPrivateMode());
        PropertiesComponent.getInstance().setValue("useSerializedName", isUseSerializedName() + "");
        PropertiesComponent.getInstance().setValue("objectFromData", objectFromData + "");
        PropertiesComponent.getInstance().setValue("objectFromData1", objectFromData1 + "");
        PropertiesComponent.getInstance().setValue("arrayFromData", arrayFromData + "");
        PropertiesComponent.getInstance().setValue("arrayFromData1", arrayFromData1 + "");
        PropertiesComponent.getInstance().setValue("objectFromDataStr", objectFromDataStr + "");
        PropertiesComponent.getInstance().setValue("objectFromDataStr1", objectFromDataStr1 + "");
        PropertiesComponent.getInstance().setValue("arrayFromData1Str", arrayFromData1Str + "");
        PropertiesComponent.getInstance().setValue("suffixStr", suffixStr + "");
        PropertiesComponent.getInstance().setValue("reuseEntity", reuseEntity + "");
        PropertiesComponent.getInstance().setValue("virgoMode", virgoMode + "");
        PropertiesComponent.getInstance().setValue("filedNamePreFixStr", filedNamePreFixStr + "");
        PropertiesComponent.getInstance().setValue("annotationStr", annotationStr + "");
        PropertiesComponent.getInstance().setValue("errorCount", errorCount + "");
        PropertiesComponent.getInstance().setValue("entityPackName", entityPackName + "");
        PropertiesComponent.getInstance().setValue("useFieldNamePrefix", useFieldNamePrefix + "");
        PropertiesComponent.getInstance().setValue("generateComments", generateComments + "");
        PropertiesComponent.getInstance().setValue("splitGenerate", splitGenerate + "");
        PropertiesComponent.getInstance().setValue("useWrapperClass", useWrapperClass + "");

    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:25,代碼來源:Config.java

示例2: save

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
public void save() {

        PropertiesComponent.getInstance().setValue("fieldPrivateMode", "" + isFieldPrivateMode());
        PropertiesComponent.getInstance().setValue("useSerializedName", isUseSerializedName() + "");
        PropertiesComponent.getInstance().setValue("objectFromData", objectFromData + "");
        PropertiesComponent.getInstance().setValue("objectFromData1", objectFromData1 + "");
        PropertiesComponent.getInstance().setValue("arrayFromData", arrayFromData + "");
        PropertiesComponent.getInstance().setValue("arrayFromData1", arrayFromData1 + "");
        PropertiesComponent.getInstance().setValue("objectFromDataStr", objectFromDataStr + "");
        PropertiesComponent.getInstance().setValue("objectFromDataStr1", objectFromDataStr1 + "");
        PropertiesComponent.getInstance().setValue("arrayFromData1Str", arrayFromData1Str + "");
        PropertiesComponent.getInstance().setValue("suffixStr", suffixStr + "");
        PropertiesComponent.getInstance().setValue("reuseEntity", reuseEntity + "");
        PropertiesComponent.getInstance().setValue("virgoMode", virgoMode + "");
        PropertiesComponent.getInstance().setValue("filedNamePreFixStr", filedNamePreFixStr + "");
        PropertiesComponent.getInstance().setValue("annotationStr", annotationStr + "");
        PropertiesComponent.getInstance().setValue("errorCount", errorCount + "");
        PropertiesComponent.getInstance().setValue("entityPackName", entityPackName + "");
        PropertiesComponent.getInstance().setValue("useFieldNamePrefix", useFieldNamePrefix + "");
        PropertiesComponent.getInstance().setValue("generateComments", generateComments + "");
        PropertiesComponent.getInstance().setValue("splitGenerate", splitGenerate + "");
    }
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:23,代碼來源:Config.java

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

示例4: actionPerformed

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent evt) {
   try {
      PropertiesComponent prop = PropertiesComponent.getInstance();
      RandomBackgroundTask task = RandomBackgroundTask.Builder.createTask().withProp(prop).build();
      int timeExecution = getTimeExecution(prop);

      if (timeExecution != -1) {
         ScheduledExecutorServiceHandler scheduler = ScheduledExecutorServiceHandler.
               Builder.
               createScheduler().withTask(task).
               withInitialDelay(0).
               withPeriod(timeExecution).
               withTimeUnit(TimeUnit.SECONDS).
               build();

         scheduler.scheduleAtFixedRate();
      } else {
         task.run();
      }
   } catch (Exception e) {
      e.printStackTrace();
   }
}
 
開發者ID:allandequeiroz,項目名稱:random_image_background_any_jetbrains_plugin,代碼行數:25,代碼來源:RandomBackground.java

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

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

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

示例8: projectOpened

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
@Override
public void projectOpened() {
  ApplicationManager.getApplication().invokeLater((DumbAwareRunnable)() -> ApplicationManager.getApplication().runWriteAction(
    (DumbAwareRunnable)() -> {
      if (PropertiesComponent.getInstance().getBoolean(ourShowPopup, true)) {
        final String content = "<html>If you'd like to learn more about PyCharm Edu, " +
                               "click <a href=\"https://www.jetbrains.com/pycharm-edu/quickstart/\">here</a> to watch a tutorial</html>";
        final Notification notification = new Notification("Watch Tutorials!", "", content, NotificationType.INFORMATION,
                                                           new NotificationListener.UrlOpeningListener(true));
        StartupManager.getInstance(myProject).registerPostStartupActivity(() -> Notifications.Bus.notify(notification));
        Balloon balloon = notification.getBalloon();
        if (balloon != null) {
          balloon.addListener(new JBPopupAdapter() {
            @Override
            public void onClosed(LightweightWindowEvent event) {
              notification.expire();
            }
          });
        }
        notification.whenExpired(() -> PropertiesComponent.getInstance().setValue(ourShowPopup, false, true));
      }
    }));
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:24,代碼來源:PyStudyShowTutorial.java

示例9: createComponent

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
@Nullable
@Override
public JComponent createComponent() {
  if (!PropertiesComponent.getInstance().getBoolean(COURSE_CREATOR_ENABLED)) return null;
  if (CCSettings.getInstance().useHtmlAsDefaultTaskFormat()) {
    myHtmlRadioButton.setSelected(true);
    IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(
      () -> IdeFocusManager.getGlobalInstance().requestFocus(myHtmlRadioButton, true));
  }
  else {
    myMarkdownRadioButton.setSelected(true);
    IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(
      () -> IdeFocusManager.getGlobalInstance().requestFocus(myMarkdownRadioButton, true));
  }
  return myPanel;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:17,代碼來源:CCOptions.java

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

示例11: generateProject

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
@Override
public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @NotNull GravProjectSettings settings, @NotNull Module module) {
    StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
    VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(new File(settings.gravInstallationPath));
    if (vf == null || !GravSdkType.isValidGravSDK(vf)) {
        JBPopupFactory.getInstance()
                .createHtmlTextBalloonBuilder("Project couldn't be created because Grav Installation isn't valid", MessageType.ERROR, null)
                .setFadeoutTime(3500)
                .createBalloon()
                .show(RelativePoint.getSouthEastOf(statusBar.getComponent()), Balloon.Position.above);
    } else {
        storage.setDefaultGravDownloadPath(settings.gravInstallationPath);
        PropertiesComponent.getInstance().setValue(LAST_USED_GRAV_HOME, new File(settings.gravInstallationPath).getAbsolutePath());
        GravProjectGeneratorUtil projectGenerator = new GravProjectGeneratorUtil();
        projectGenerator.generateProject(project, baseDir, settings, module);
        try {
            List<String> includePath = new ArrayList<>();
            includePath.add(baseDir.getPath());
            PhpIncludePathManager.getInstance(project).setIncludePath(includePath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
開發者ID:PioBeat,項目名稱:GravSupport,代碼行數:25,代碼來源:GravProjectGenerator.java

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

示例13: doOKAction

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
@Override
protected void doOKAction() {
  myDeviceChooser.finish();

  final PropertiesComponent properties = PropertiesComponent.getInstance(myProject);
  properties.setValue(SELECTED_SERIALS_PROPERTY, AndroidRunningState.toString(myDeviceChooser.getSelectedDevices()));

  final IdDisplay selectedAvd = (IdDisplay)myAvdCombo.getComboBox().getSelectedItem();
  if (selectedAvd != null) {
    properties.setValue(SELECTED_AVD_PROPERTY, selectedAvd.getId());
  }
  else {
    properties.unsetValue(SELECTED_AVD_PROPERTY);
  }

  super.doOKAction();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ExtendedDeviceChooserDialog.java

示例14: showRerunNotification

import com.intellij.ide.util.PropertiesComponent; //導入依賴的package包/類
public static void showRerunNotification(@Nullable RunContentDescriptor contentToReuse,
                                         @NotNull final ExecutionConsole executionConsole) {
  if (contentToReuse == null) {
    return;
  }
  String lastActionId = ActionManagerEx.getInstanceEx().getPrevPreformedActionId();
  boolean showNotification = !RerunTestsAction.ID.equals(lastActionId);
  if (showNotification && !PropertiesComponent.getInstance().isTrueValue(KEY)) {
    UiNotifyConnector.doWhenFirstShown(executionConsole.getComponent(), new Runnable() {
      @Override
      public void run() {
        doShow(executionConsole);
      }
    });
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:RerunTestsNotification.java

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


注:本文中的com.intellij.ide.util.PropertiesComponent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。