本文整理汇总了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 + "");
}
示例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 + "");
}
示例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;
}
示例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);
}
}
示例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));
}
}));
}
示例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;
}
示例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);
}
示例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();
}
}
}
示例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);
}
}
}
示例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();
}
示例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);
}
});
}
}
示例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;
}
}
}