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