本文整理匯總了Java中com.intellij.ide.util.PropertiesComponent.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertiesComponent.getBoolean方法的具體用法?Java PropertiesComponent.getBoolean怎麽用?Java PropertiesComponent.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.ide.util.PropertiesComponent
的用法示例。
在下文中一共展示了PropertiesComponent.getBoolean方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: applyAndSave
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
public static void applyAndSave(@NotNull PropertiesComponent p,
@NotNull UISettings ui,
@NotNull EditorSettingsExternalizable.OptionSet eo,
@NotNull DaemonCodeAnalyzerSettings ds,
String before, String after, boolean value) {
// @formatter:off
p.setValue(before + "SHOW_STATUS_BAR", valueOf(ui.SHOW_STATUS_BAR)); ui.SHOW_STATUS_BAR = p.getBoolean(after + "SHOW_STATUS_BAR", value);
p.setValue(before + "SHOW_MAIN_TOOLBAR", valueOf(ui.SHOW_MAIN_TOOLBAR)); ui.SHOW_MAIN_TOOLBAR = p.getBoolean(after + "SHOW_MAIN_TOOLBAR", value);
p.setValue(before + "SHOW_NAVIGATION_BAR", valueOf(ui.SHOW_NAVIGATION_BAR)); ui.SHOW_NAVIGATION_BAR = p.getBoolean(after + "SHOW_NAVIGATION_BAR", value);
p.setValue(before + "IS_FOLDING_OUTLINE_SHOWN", valueOf(eo.IS_FOLDING_OUTLINE_SHOWN)); eo.IS_FOLDING_OUTLINE_SHOWN = p.getBoolean(after + "IS_FOLDING_OUTLINE_SHOWN", value);
p.setValue(before + "IS_WHITESPACES_SHOWN", valueOf(eo.IS_WHITESPACES_SHOWN)); eo.IS_WHITESPACES_SHOWN = p.getBoolean(after + "IS_WHITESPACES_SHOWN", value);
p.setValue(before + "ARE_LINE_NUMBERS_SHOWN", valueOf(eo.ARE_LINE_NUMBERS_SHOWN)); eo.ARE_LINE_NUMBERS_SHOWN = p.getBoolean(after + "ARE_LINE_NUMBERS_SHOWN", value);
p.setValue(before + "IS_RIGHT_MARGIN_SHOWN", valueOf(eo.IS_RIGHT_MARGIN_SHOWN)); eo.IS_RIGHT_MARGIN_SHOWN = p.getBoolean(after + "IS_RIGHT_MARGIN_SHOWN", value);
p.setValue(before + "IS_INDENT_GUIDES_SHOWN", valueOf(eo.IS_INDENT_GUIDES_SHOWN)); eo.IS_INDENT_GUIDES_SHOWN = p.getBoolean(after + "IS_INDENT_GUIDES_SHOWN", value);
p.setValue(before + "SHOW_BREADCRUMBS", valueOf(eo.SHOW_BREADCRUMBS)); eo.SHOW_BREADCRUMBS = p.getBoolean(after + "SHOW_BREADCRUMBS", value);
p.setValue(before + "SHOW_METHOD_SEPARATORS", valueOf(ds.SHOW_METHOD_SEPARATORS)); ds.SHOW_METHOD_SEPARATORS = p.getBoolean(after + "SHOW_METHOD_SEPARATORS", value);
p.setValue(before + "HIDE_TOOL_STRIPES", valueOf(ui.HIDE_TOOL_STRIPES)); ui.HIDE_TOOL_STRIPES = p.getBoolean(after + "HIDE_TOOL_STRIPES", !value);
p.setValue(before + "EDITOR_TAB_PLACEMENT", valueOf(ui.EDITOR_TAB_PLACEMENT)); ui.EDITOR_TAB_PLACEMENT = p.getInt(after + "EDITOR_TAB_PLACEMENT", value ? SwingConstants.TOP : UISettings.TABS_NONE);
// @formatter:on
}
示例3: 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);
}
}
}
示例4: 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");
}
}
示例5: isModified
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
@Override
public boolean isModified() {
PropertiesComponent prop = PropertiesComponent.getInstance();
String storedFolder = prop.getValue(FOLDER);
String uiFolder = imageFolder.getText();
if (storedFolder == null) {
storedFolder = "";
}
return !storedFolder.equals(uiFolder)
|| intervalModified(prop)
|| prop.getBoolean(AUTO_CHANGE) != autoChangeCheckBox.isSelected();
}
示例6: RandomBackground
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
public RandomBackground() {
super("Random Background Image");
PropertiesComponent prop = PropertiesComponent.getInstance();
if (prop.getBoolean(Settings.AUTO_CHANGE, false)) {
BackgroundService.start();
}
}
示例7: actionPerformed
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent evt) {
RandomBackgroundTask task = new RandomBackgroundTask();
task.run();
PropertiesComponent prop = PropertiesComponent.getInstance();
if (prop.getBoolean(Settings.AUTO_CHANGE, false)) {
BackgroundService.restart();
}
}
示例8: customizeSettings
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
private static void customizeSettings(PropertiesComponent propertiesComponent) {
if (!propertiesComponent.getBoolean(CONFIG_V4)) {
propertiesComponent.setValue(CONFIG_V4, "true");
UISettings.getInstance().HIDE_TOOL_STRIPES = false;
if (!propertiesComponent.getBoolean(CONFIG_V3)) {
propertiesComponent.setValue(CONFIG_V3, "true");
// See https://youtrack.jetbrains.com/issue/IDEA-113332
// It's not really fixed but worked around by turning off the =-quoting
WebEditorOptions.getInstance().setInsertQuotesForAttributeValue(false);
}
if (!propertiesComponent.getBoolean(CONFIG_V1)) {
propertiesComponent.setValue(CONFIG_V1, "true");
CodeInsightSettings.getInstance().AUTO_POPUP_JAVADOC_INFO = true;
UISettings.getInstance().SCROLL_TAB_LAYOUT_IN_EDITOR = true;
EditorSettingsExternalizable.getInstance().setVirtualSpace(false);
// For Macs, use 10.5+ keymap as the default
if (SystemInfo.isMac) {
setDefaultMacKeymap();
}
}
if (!propertiesComponent.getBoolean(CONFIG_V2)) {
propertiesComponent.setValue(CONFIG_V2, "true");
UISettings.getInstance().SHOW_MAIN_TOOLBAR = true;
}
}
}
示例9: invoke
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
@Override
public void invoke(final @NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
final Module srcModule = ModuleUtilCore.findModuleForPsiElement(element);
final PsiClass srcClass = getContainingClass(element);
if (srcClass == null) return;
PsiDirectory srcDir = element.getContainingFile().getContainingDirectory();
PsiPackage srcPackage = JavaDirectoryService.getInstance().getPackage(srcDir);
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
final HashSet<VirtualFile> testFolders = new HashSet<VirtualFile>();
checkForTestRoots(srcModule, testFolders);
if (testFolders.isEmpty() && !propertiesComponent.getBoolean(CREATE_TEST_IN_THE_SAME_ROOT)) {
if (Messages.showOkCancelDialog(project, "Create test in the same source root?", "No Test Roots Found", Messages.getQuestionIcon()) !=
Messages.OK) {
return;
}
propertiesComponent.setValue(CREATE_TEST_IN_THE_SAME_ROOT, true);
}
final CreateTestDialog d = createTestDialog(project, srcModule, srcClass, srcPackage);
if (!d.showAndGet()) {
return;
}
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
@Override
public void run() {
TestFramework framework = d.getSelectedTestFrameworkDescriptor();
final TestGenerator generator = TestGenerators.INSTANCE.forLanguage(framework.getLanguage());
DumbService.getInstance(project).withAlternativeResolveEnabled(new Runnable() {
@Override
public void run() {
generator.generateTest(project, d);
}
});
}
}, CodeInsightBundle.message("intention.create.test"), this);
}
示例10: PyCharmInitialConfigurator
import com.intellij.ide.util.PropertiesComponent; //導入方法依賴的package包/類
public PyCharmInitialConfigurator(MessageBus bus, final PropertiesComponent propertiesComponent, final FileTypeManager fileTypeManager) {
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration")) {
propertiesComponent.setValue("PyCharm.InitialConfiguration", "true");
EditorSettingsExternalizable.getInstance().setVirtualSpace(false);
}
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V2")) {
propertiesComponent.setValue("PyCharm.InitialConfiguration.V2", true);
final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance().getCurrentSettings();
settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
settings.getCommonSettings(PythonLanguage.getInstance()).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
UISettings.getInstance().SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES = true;
}
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V3")) {
propertiesComponent.setValue("PyCharm.InitialConfiguration.V3", "true");
UISettings.getInstance().SHOW_MEMORY_INDICATOR = false;
final String ignoredFilesList = fileTypeManager.getIgnoredFilesList();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
FileTypeManager.getInstance().setIgnoredFilesList(ignoredFilesList + ";*$py.class");
}
});
}
});
}
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V4")) {
propertiesComponent.setValue("PyCharm.InitialConfiguration.V4", true);
PyCodeInsightSettings.getInstance().SHOW_IMPORT_POPUP = false;
}
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V5")) {
propertiesComponent.setValue("PyCharm.InitialConfiguration.V5", true);
CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT;
}
if (!propertiesComponent.isValueSet(DISPLAYED_PROPERTY)) {
bus.connect().subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() {
@Override
public void welcomeScreenDisplayed() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
propertiesComponent.setValue(DISPLAYED_PROPERTY, "true");
showInitialConfigurationDialog();
}
});
}
});
}
Registry.get("ide.scratch.enabled").setValue(true);
}