Search in sources :

Example 6 with UISettings

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();
    }
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Example 7 with UISettings

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);
    }
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Example 8 with UISettings

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);
            }
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) UISettings(com.intellij.ide.ui.UISettings) Editor(com.intellij.openapi.editor.Editor)

Example 9 with UISettings

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;
}
Also used : UISettings(com.intellij.ide.ui.UISettings) Element(org.jdom.Element) ColorBlindness(com.intellij.ide.ui.ColorBlindness)

Example 10 with UISettings

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();
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Aggregations

UISettings (com.intellij.ide.ui.UISettings)38 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)8 Project (com.intellij.openapi.project.Project)4 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)3 RichCopySettings (com.intellij.openapi.editor.richcopy.settings.RichCopySettings)3 VcsApplicationSettings (com.intellij.openapi.vcs.VcsApplicationSettings)3 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 HyperlinkEvent (javax.swing.event.HyperlinkEvent)2 DaemonCodeAnalyzerSettings (com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings)1 QuickDocOnMouseOverManager (com.intellij.codeInsight.documentation.QuickDocOnMouseOverManager)1 ColorBlindness (com.intellij.ide.ui.ColorBlindness)1 UISettingsListener (com.intellij.ide.ui.UISettingsListener)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 Notification (com.intellij.notification.Notification)1 NotificationListener (com.intellij.notification.NotificationListener)1 Application (com.intellij.openapi.application.Application)1 ApplicationManager.getApplication (com.intellij.openapi.application.ApplicationManager.getApplication)1