当前位置: 首页>>代码示例>>Java>>正文


Java DarculaInstaller类代码示例

本文整理汇总了Java中com.intellij.ide.ui.laf.darcula.DarculaInstaller的典型用法代码示例。如果您正苦于以下问题:Java DarculaInstaller类的具体用法?Java DarculaInstaller怎么用?Java DarculaInstaller使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DarculaInstaller类属于com.intellij.ide.ui.laf.darcula包,在下文中一共展示了DarculaInstaller类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillActions

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  final LafManager manager = LafManager.getInstance();
  final UIManager.LookAndFeelInfo[] lfs = manager.getInstalledLookAndFeels();
  final UIManager.LookAndFeelInfo current = manager.getCurrentLookAndFeel();
  for (final UIManager.LookAndFeelInfo lf : lfs) {
    group.add(new DumbAwareAction(lf.getName(), "", lf == current ? ourCurrentAction : ourNotCurrentAction) {
      public void actionPerformed(AnActionEvent e) {
        final UIManager.LookAndFeelInfo cur = manager.getCurrentLookAndFeel();
        if (cur == lf) return;
        boolean needUninstall = UIUtil.isUnderDarcula();
        manager.setCurrentLookAndFeel(lf);
        manager.updateUI();
        if (UIUtil.isUnderDarcula()) {
          DarculaInstaller.install();
        } else if (needUninstall) {
          DarculaInstaller.uninstall();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:QuickChangeLookAndFeel.java

示例2: removeTheme

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
/**
 * Completely remove theme
 *
 * @param mtTheme
 */
private void removeTheme(final MTThemes mtTheme) {
  try {
    resetContrast();

    if (UIUtil.isUnderDarcula()) {
      UIManager.setLookAndFeel(new DarculaLaf());
    } else {
      UIManager.setLookAndFeel(new IntelliJLaf());
    }

    JBColor.setDark(mtTheme.isDark());
    IconLoader.setUseDarkIcons(mtTheme.isDark());
    PropertiesComponent.getInstance().unsetValue(getSettingsPrefix() + ".theme");

    // We need this to update parts of the UI that do not change
    if (UIUtil.isUnderDarcula()) {
      DarculaInstaller.uninstall();
      DarculaInstaller.install();
    } else {
      DarculaInstaller.uninstall();
    }
  } catch (final UnsupportedLookAndFeelException e) {
    e.printStackTrace();
  }
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:31,代码来源:MTThemeManager.java

示例3: initComponent

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
@Override
public void initComponent() {
  if (myCurrentLaf != null) {
    final UIManager.LookAndFeelInfo laf = findLaf(myCurrentLaf.getClassName());
    if (laf != null) {
      boolean needUninstall = UIUtil.isUnderDarcula();
      setCurrentLookAndFeel(laf); // setup default LAF or one specified by readExternal.
      if (WelcomeWizardUtil.getWizardLAF() != null) {
        if (UIUtil.isUnderDarcula()) {
          DarculaInstaller.install();
        }
        else if (needUninstall) {
          DarculaInstaller.uninstall();
        }
      }
    }
  }

  updateUI();

  if (SystemInfo.isXWindow) {
    myThemeChangeListener = new PropertyChangeListener() {
      @Override
      public void propertyChange(final PropertyChangeEvent evt) {
        //noinspection SSBasedInspection
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            fixGtkPopupStyle();
            patchGtkDefaults(UIManager.getLookAndFeelDefaults());
          }
        });
      }
    };
    Toolkit.getDefaultToolkit().addPropertyChangeListener(GNOME_THEME_PROPERTY_NAME, myThemeChangeListener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:LafManagerImpl.java

示例4: commitStep

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
@Override
public boolean commitStep() {
  // This code is duplicated from LafManager.initComponent(). But our Welcome Wizard is started
  // AFTER that call so we repeat it here.
  if (UIUtil.isUnderDarcula()) {
    DarculaInstaller.install();
  }
  else {
    DarculaInstaller.uninstall();
  }

  return super.commitStep();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SelectThemeStep.java

示例5: reloadUI

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
/**
 * Trigger a reloadUI event
 *
 * @param mtTheme
 */
private void reloadUI(final MTTheme mtTheme) {
  try {
    UIManager.setLookAndFeel(new MTLaf(MTConfig.getInstance().getSelectedTheme().getTheme()));

    applyFonts();

    DarculaInstaller.uninstall();
    if (UIUtil.isUnderDarcula()) {
      DarculaInstaller.install();
    }
  } catch (final UnsupportedLookAndFeelException e) {
    e.printStackTrace();
  }
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:20,代码来源:MTThemeManager.java

示例6: apply

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
@Override
public void apply() throws ConfigurationException {
  if (myApplyCompleted) {
    return;
  }

  try {
    EditorColorsManager myColorsManager = EditorColorsManager.getInstance();
    SchemesManager<EditorColorsScheme, EditorColorsSchemeImpl> schemeManager = ((EditorColorsManagerImpl)myColorsManager).getSchemeManager();

    List<EditorColorsScheme> result = new ArrayList<EditorColorsScheme>(mySchemes.values().size());
    boolean activeSchemeModified = false;
    EditorColorsScheme activeOriginalScheme = mySelectedScheme.getOriginalScheme();
    for (MyColorScheme scheme : mySchemes.values()) {
      if (!activeSchemeModified && activeOriginalScheme == scheme.getOriginalScheme()) {
        activeSchemeModified = scheme.isModified();
      }

      if (!scheme.isDefault()) {
        scheme.apply();
      }
      result.add(scheme.getOriginalScheme());
    }

    // refresh only if scheme is not switched
    boolean refreshEditors = activeSchemeModified && schemeManager.getCurrentScheme() == activeOriginalScheme;
    schemeManager.setSchemes(result, activeOriginalScheme);
    if (refreshEditors) {
      EditorColorsManagerImpl.schemeChangedOrSwitched();
    }

    if (DarculaLaf.NAME.equals(activeOriginalScheme.getName()) && !UIUtil.isUnderDarcula()) {
      if (Messages.showYesNoDialog(
        "Darcula color scheme has been set for editors. Would you like to set Darcula as default Look and Feel?",
        "Darcula Look and Feel",
        Messages.getQuestionIcon()) == Messages.YES) {
        LafManager.getInstance().setCurrentLookAndFeel(new DarculaLookAndFeelInfo());
        DarculaInstaller.install();
      }
    }

    reset();
  }
  finally {
    myApplyCompleted = true;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:ColorAndFontOptions.java

示例7: activate

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
/**
 * Activate theme
 *
 * @param mtTheme
 */
public void activate(final MTThemes mtTheme, final boolean switchColorScheme) {
  MTThemes newTheme = mtTheme;
  if (newTheme == null) {
    newTheme = MTThemes.OCEANIC;
  }

  MTConfig.getInstance().setSelectedTheme(newTheme);

  newTheme.getTheme().activate();
  switchScheme(newTheme, switchColorScheme);

  // Because the DarculaInstaller overrides this
  final EditorColorsScheme currentScheme = EditorColorsManager.getInstance().getGlobalScheme();

  PropertiesComponent.getInstance().setValue(getSettingsPrefix() + ".theme", newTheme.getId());
  applyContrast(false);
  applyCompactSidebar(false);
  applyCustomTreeIndent();
  applyAccents(false);
  setBoldTabs();

  // We need this to update parts of the UI that do not change
  if (UIUtil.isUnderDarcula()) {
    DarculaInstaller.uninstall();
    DarculaInstaller.install();
  } else {
    DarculaInstaller.uninstall();
  }
  LafManager.getInstance().updateUI();

  // Because the DarculaInstaller overrides this
  EditorColorsManager.getInstance().setGlobalScheme(currentScheme);

  applyFonts();

  // Documentation styles
  patchStyledEditorKit();

  UIReplacer.patchUI();
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:46,代码来源:MTThemeManager.java

示例8: apply

import com.intellij.ide.ui.laf.darcula.DarculaInstaller; //导入依赖的package包/类
@Override
  public void apply() throws ConfigurationException {
    if (!myApplyCompleted) {
      try {
        EditorColorsManager myColorsManager = EditorColorsManager.getInstance();

        myColorsManager.removeAllSchemes();
        for (MyColorScheme scheme : mySchemes.values()) {
          if (!scheme.isDefault()) {
            scheme.apply();
            myColorsManager.addColorsScheme(scheme.getOriginalScheme());
          }
        }

        EditorColorsScheme originalScheme = mySelectedScheme.getOriginalScheme();
        myColorsManager.setGlobalScheme(originalScheme);
        if (originalScheme != null && DarculaLaf.NAME.equals(originalScheme.getName()) && !UIUtil.isUnderDarcula()) {
          int ok = Messages.showYesNoDialog(
            "Darcula color scheme has been set for editors. Would you like to set Darcula as default Look and Feel?",
            "Darcula Look and Feel",
            Messages.getQuestionIcon());
          if (ok == Messages.OK) {
            LafManager.getInstance().setCurrentLookAndFeel(new DarculaLookAndFeelInfo());
            DarculaInstaller.install();
          }
        }
        applyChangesToEditors();

        reset();
      }
      finally {
        myApplyCompleted = true;


      }


    }


//    initAll();
//    resetSchemesCombo();


  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:46,代码来源:ColorAndFontOptions.java


注:本文中的com.intellij.ide.ui.laf.darcula.DarculaInstaller类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。