use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class EditorTabsConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
UISettings uiSettings = UISettings.getInstance();
boolean uiSettingsChanged = uiSettings.getMarkModifiedTabsWithAsterisk() != myCbModifiedTabsMarkedWithAsterisk.isSelected();
uiSettings.setMarkModifiedTabsWithAsterisk(myCbModifiedTabsMarkedWithAsterisk.isSelected());
if (isModified(myShowTabsTooltipsCheckBox, uiSettings.getShowTabsTooltips()))
uiSettingsChanged = true;
uiSettings.setShowTabsTooltips(myShowTabsTooltipsCheckBox.isSelected());
if (isModified(myScrollTabLayoutInEditorCheckBox, uiSettings.getScrollTabLayoutInEditor()))
uiSettingsChanged = true;
uiSettings.setScrollTabLayoutInEditor(myScrollTabLayoutInEditorCheckBox.isSelected());
if (isModified(myHideTabsCheckbox, uiSettings.getHideTabsIfNeed()))
uiSettingsChanged = true;
uiSettings.setHideTabsIfNeed(myHideTabsCheckbox.isSelected());
if (isModified(myShowCloseButtonOnCheckBox, uiSettings.getShowCloseButton()))
uiSettingsChanged = true;
uiSettings.setShowCloseButton(myShowCloseButtonOnCheckBox.isSelected());
final int tabPlacement = ((Integer) myEditorTabPlacement.getSelectedItem()).intValue();
if (uiSettings.getEditorTabPlacement() != tabPlacement)
uiSettingsChanged = true;
uiSettings.setEditorTabPlacement(tabPlacement);
boolean hide = myHideKnownExtensions.isSelected();
if (uiSettings.getHdeKnownExtensionInTabs() != hide)
uiSettingsChanged = true;
uiSettings.setHdeKnownExtensionInTabs(hide);
boolean dir = myShowDirectoryInTabCheckBox.isSelected();
if (uiSettings.getShowDirectoryForNonUniqueFilenames() != dir)
uiSettingsChanged = true;
uiSettings.setShowDirectoryForNonUniqueFilenames(dir);
uiSettings.setCloseNonModifiedFilesFirst(myCloseNonModifiedFilesFirstRadio.isSelected());
uiSettings.setActiveMruEditorOnClose(myActivateMRUEditorOnCloseRadio.isSelected());
uiSettings.setActiveRigtEditorOnClose(myActivateRightNeighbouringTabRadioButton.isSelected());
if (isModified(myReuseNotModifiedTabsCheckBox, uiSettings.getReuseNotModifiedTabs()))
uiSettingsChanged = true;
uiSettings.setReuseNotModifiedTabs(myReuseNotModifiedTabsCheckBox.isSelected());
if (isModified(myEditorTabLimitField, uiSettings.getEditorTabLimit(), EDITOR_TABS_RANGE))
uiSettingsChanged = true;
try {
uiSettings.setEditorTabLimit(EDITOR_TABS_RANGE.fit(Integer.parseInt(myEditorTabLimitField.getText().trim())));
} catch (NumberFormatException ignored) {
}
if (uiSettingsChanged) {
uiSettings.fireUISettingsChanged();
}
}
use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class EditorTabsConfigurable method reset.
@Override
public void reset() {
UISettings uiSettings = UISettings.getInstance();
myCbModifiedTabsMarkedWithAsterisk.setSelected(uiSettings.getMarkModifiedTabsWithAsterisk());
myShowTabsTooltipsCheckBox.setSelected(uiSettings.getShowTabsTooltips());
myScrollTabLayoutInEditorCheckBox.setSelected(uiSettings.getScrollTabLayoutInEditor());
myHideTabsCheckbox.setEnabled(myScrollTabLayoutInEditorCheckBox.isSelected());
myHideTabsCheckbox.setSelected(uiSettings.getHideTabsIfNeed());
myEditorTabPlacement.setSelectedItem(uiSettings.getEditorTabPlacement());
myHideKnownExtensions.setSelected(uiSettings.getHdeKnownExtensionInTabs());
myShowDirectoryInTabCheckBox.setSelected(uiSettings.getShowDirectoryForNonUniqueFilenames());
myEditorTabLimitField.setText(Integer.toString(uiSettings.getEditorTabLimit()));
myReuseNotModifiedTabsCheckBox.setSelected(uiSettings.getReuseNotModifiedTabs());
myShowCloseButtonOnCheckBox.setSelected(uiSettings.getShowCloseButton());
if (uiSettings.getCloseNonModifiedFilesFirst()) {
myCloseNonModifiedFilesFirstRadio.setSelected(true);
} else {
myCloseLRUFilesRadio.setSelected(true);
}
if (uiSettings.getActiveMruEditorOnClose()) {
myActivateMRUEditorOnCloseRadio.setSelected(true);
} else if (uiSettings.getActiveRigtEditorOnClose()) {
myActivateRightNeighbouringTabRadioButton.setSelected(true);
} else {
myActivateLeftEditorOnCloseRadio.setSelected(true);
}
}
use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class ShowNavBarAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext context = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(context);
if (project != null) {
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.getShowNavigationBar() && !uiSettings.getPresentationMode()) {
new SelectInNavBarTarget(project).select(null, false);
} else {
final Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
if (!isInsideNavBar(component)) {
final Editor editor = CommonDataKeys.EDITOR.getData(context);
final NavBarPanel toolbarPanel = new NavBarPanel(project, false);
toolbarPanel.showHint(editor, context);
}
}
}
}
use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class AbstractColorsScheme method readExternal.
@Override
public void readExternal(@NotNull Element parentNode) {
UISettings settings = UISettings.getInstanceOrNull();
ColorBlindness blindness = settings == null ? null : settings.getColorBlindness();
myValueReader.setAttribute(blindness == null ? null : blindness.name());
if (SCHEME_ELEMENT.equals(parentNode.getName())) {
readScheme(parentNode);
} else {
List<Element> children = parentNode.getChildren(SCHEME_ELEMENT);
if (children.isEmpty()) {
throw new InvalidDataException("Scheme is not valid");
}
for (Element element : children) {
readScheme(element);
}
}
initFonts();
myVersion = CURR_VERSION;
}
use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class AbstractColorsScheme method getConsoleFontSize.
@Override
public int getConsoleFontSize() {
String font = getConsoleFontName();
UISettings uiSettings = UISettings.getInstanceOrNull();
if ((uiSettings == null || !uiSettings.getPresentationMode()) && myConsoleFontPreferences.hasSize(font)) {
return myConsoleFontPreferences.getSize(font);
}
return getEditorFontSize();
}
Aggregations