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


Java UISettings类代码示例

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


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

示例1: uiSettingsChanged

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
public void uiSettingsChanged(final UISettings settings) {
  if (myNavigationBar != null) {
    myNavigationBar.updateState(settings.SHOW_NAVIGATION_BAR);
    myWrapperPanel.setVisible(settings.SHOW_NAVIGATION_BAR && !UISettings.getInstance().PRESENTATION_MODE);

    myWrapperPanel.revalidate();
    myNavigationBar.revalidate();
    myWrapperPanel.repaint();

    if (myWrapperPanel.getComponentCount() > 0) {
      final Component c = myWrapperPanel.getComponent(0);
      if (c instanceof JComponent) ((JComponent)c).setOpaque(false);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NavBarRootPaneExtension.java

示例2: moveMousePointerOn

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
public static void moveMousePointerOn(Component component) {
  if (component != null && component.isShowing()) {
    UISettings settings = ApplicationManager.getApplication() == null ? null : UISettings.getInstance();
    if (settings != null && settings.MOVE_MOUSE_ON_DEFAULT_BUTTON) {
      Point point = component.getLocationOnScreen();
      int dx = component.getWidth() / 2;
      int dy = component.getHeight() / 2;
      try {
        new Robot().mouseMove(point.x + dx, point.y + dy);
      }
      catch (AWTException ignored) {
        // robot is not available
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IJSwingUtilities.java

示例3: setPresentationMode

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
public static void setPresentationMode(final Project project, final boolean inPresentation) {
  final UISettings settings = UISettings.getInstance();
  settings.PRESENTATION_MODE = inPresentation;

  final boolean layoutStored = storeToolWindows(project);

  tweakUIDefaults(settings, inPresentation);

  ActionCallback callback = project == null ? ActionCallback.DONE : tweakFrameFullScreen(project, inPresentation);
  callback.doWhenProcessed(new Runnable() {
    @Override
    public void run() {
      tweakEditorAndFireUpdateUI(settings, inPresentation);

      restoreToolWindows(project, layoutStored, inPresentation);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TogglePresentationModeAction.java

示例4: EditorTabsConfigurable

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
public EditorTabsConfigurable() {
  myEditorTabPlacement.setModel(new DefaultComboBoxModel(new Object[]{
    SwingConstants.TOP,
    SwingConstants.LEFT,
    SwingConstants.BOTTOM,
    SwingConstants.RIGHT,
    UISettings.TABS_NONE,
  }));
  myEditorTabPlacement.setRenderer(new MyTabsPlacementComboBoxRenderer(myEditorTabPlacement.getRenderer()));
  myEditorTabPlacement.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(ItemEvent e) {
      revalidateSingleRowCheckbox();
    }
  });

  revalidateSingleRowCheckbox();
  myScrollTabLayoutInEditorCheckBox.addChangeListener(new ChangeListener() {
    @Override
    public void stateChanged(ChangeEvent event) {
      myHideTabsCheckbox.setEnabled(myScrollTabLayoutInEditorCheckBox.isSelected());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:EditorTabsConfigurable.java

示例5: customize

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
public void customize(JList list, Integer value, int index, boolean selected, boolean hasFocus) {
  int tabPlacement = value.intValue();
  String text;
  if (UISettings.TABS_NONE == tabPlacement) {
    text = ApplicationBundle.message("combobox.tab.placement.none");
  }
  else if (SwingConstants.TOP == tabPlacement) {
    text = ApplicationBundle.message("combobox.tab.placement.top");
  }
  else if (SwingConstants.LEFT == tabPlacement) {
    text = ApplicationBundle.message("combobox.tab.placement.left");
  }
  else if (SwingConstants.BOTTOM == tabPlacement) {
    text = ApplicationBundle.message("combobox.tab.placement.bottom");
  }
  else if (SwingConstants.RIGHT == tabPlacement) {
    text = ApplicationBundle.message("combobox.tab.placement.right");
  }
  else {
    throw new IllegalArgumentException("unknown tabPlacement: " + tabPlacement);
  }
  setText(text);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:EditorTabsConfigurable.java

示例6: revalidateSingleRowCheckbox

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
private void revalidateSingleRowCheckbox() {
  final int i = ((Integer)myEditorTabPlacement.getSelectedItem()).intValue();

  boolean none = i == UISettings.TABS_NONE;
  myHideKnownExtensions.setEnabled(!none);
  myHideTabsCheckbox.setEnabled(!none && myScrollTabLayoutInEditorCheckBox.isSelected());
  myScrollTabLayoutInEditorCheckBox.setEnabled(!none);
  myCbModifiedTabsMarkedWithAsterisk.setEnabled(!none);
  myShowTabsTooltipsCheckBox.setEnabled(!none);
  myShowCloseButtonOnCheckBox.setEnabled(!none);
  myShowDirectoryInTabCheckBox.setEnabled(!none);

  if (SwingConstants.TOP == i) {
    myScrollTabLayoutInEditorCheckBox.setEnabled(true);
  } else {
    myScrollTabLayoutInEditorCheckBox.setSelected(true);
    myScrollTabLayoutInEditorCheckBox.setEnabled(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EditorTabsConfigurable.java

示例7: getImage

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
private Pair<BufferedImage, SoftReference<BufferedImage>> getImage(SoftReference<BufferedImage> imageRef) {
  LOG.assertTrue(UISettings.getInstance().ANIMATE_WINDOWS);
  BufferedImage image = imageRef.get();
  if (
    image == null ||
    image.getWidth(null) < getWidth() || image.getHeight(null) < getHeight()
    ) {
    final int width = Math.max(Math.max(1, getWidth()), myFrame.getWidth());
    final int height = Math.max(Math.max(1, getHeight()), myFrame.getHeight());
    if (SystemInfo.isWindows) {
      image = myFrame.getGraphicsConfiguration().createCompatibleImage(width, height);
    }
    else {
      // Under Linux we have found that images created by createCompatibleImage(),
      // createVolatileImage(), etc extremely slow for rendering. TrueColor buffered image
      // is MUCH faster.
      // On Mac we create a retina-compatible image

      image = UIUtil.createImage(width, height, BufferedImage.TYPE_INT_RGB);
    }
    imageRef = new SoftReference<BufferedImage>(image);
  }
  return Pair.create(image, imageRef);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ToolWindowsPane.java

示例8: tweakEditorAndFireUpdateUI

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
private static void tweakEditorAndFireUpdateUI(UISettings settings, boolean inPresentation) {
  EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = inPresentation ? settings.PRESENTATION_MODE_FONT_SIZE : globalScheme.getEditorFontSize();
  if (inPresentation) {
    ourSavedConsoleFontSize = globalScheme.getConsoleFontSize();
    globalScheme.setConsoleFontSize(fontSize);
  }
  else {
    globalScheme.setConsoleFontSize(ourSavedConsoleFontSize);
  }
  for (Editor editor : EditorFactory.getInstance().getAllEditors()) {
    if (editor instanceof EditorEx) {
      ((EditorEx)editor).setFontSize(fontSize);
    }
  }
  UISettings.getInstance().fireUISettingsChanged();
  LafManager.getInstance().updateUI();
  EditorUtil.reinitSettings();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TogglePresentationModeAction.java

示例9: EditorWindow

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
protected EditorWindow(final EditorsSplitters owner) {
  myOwner = owner;
  myPanel = new JPanel(new BorderLayout());
  myPanel.setOpaque(false);

  myTabbedPane = null;

  final int tabPlacement = UISettings.getInstance().EDITOR_TAB_PLACEMENT;
  if (tabPlacement != UISettings.TABS_NONE && !UISettings.getInstance().PRESENTATION_MODE) {
    createTabs(tabPlacement);
  }

  // Tab layout policy
  if (UISettings.getInstance().SCROLL_TAB_LAYOUT_IN_EDITOR) {
    setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
  } else {
    setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);
  }

  myOwner.addWindow(this);
  if (myOwner.getCurrentWindow() == null) {
    myOwner.setCurrentWindow(this, false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:EditorWindow.java

示例10: paint

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
public void paint(Graphics g) {
  boolean isDarkBackground = UIUtil.isUnderDarcula();
  UISettings.setupAntialiasing(g);
  g.setColor(new JBColor(isDarkBackground ? Gray._230 : Gray._80, Gray._160));
  g.setFont(JBUI.Fonts.label(isDarkBackground ? 24f : 20f));

  UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.5f);
  painter.withShadow(true, new JBColor(Gray._200.withAlpha(100), Gray._0.withAlpha(255)));

  painter.appendLine("No files are open");//.underlined(new JBColor(Gray._150, Gray._180));
  painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
    @Override
    public Couple<Integer> fun(Integer width, Integer height) {
      Dimension s = EmptyStatePanel.this.getSize();
      return Couple.of((s.width - width) / 2, (s.height - height) / 2);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PreviewManagerImpl.java

示例11: paintEmptyText

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
public void paintEmptyText(@NotNull final JComponent splitters, @NotNull Graphics g) {
  UISettings.setupAntialiasing(g);
  g.setColor(new JBColor(Gray._80, Gray._160));
  g.setFont(JBUI.Fonts.label(16f));
  UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.8f);
  advertiseActions(splitters, painter);
  painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
    @Override
    public Couple<Integer> fun(Integer width, Integer height) {
      Dimension s = splitters.getSize();
      int w = (s.width - width) / 2;
      int h = s.height * 3 / 8; // fix vertical position @ golden ratio
      return Couple.of(w, h);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditorEmptyTextPainter.java

示例12: EditorsSplitters

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
EditorsSplitters(final FileEditorManagerImpl manager, DockManager dockManager, boolean createOwnDockableContainer) {
  super(new BorderLayout());
  myManager = manager;
  myFocusWatcher = new MyFocusWatcher();
  setFocusTraversalPolicy(new MyFocusTraversalPolicy());
  clear();

  if (createOwnDockableContainer) {
    DockableEditorTabbedContainer dockable = new DockableEditorTabbedContainer(myManager.getProject(), this, false);
    Disposer.register(manager.getProject(), dockable);
    dockManager.register(dockable);
  }
  KeymapManagerListener keymapListener = new KeymapManagerListener() {
    @Override
    public void activeKeymapChanged(Keymap keymap) {
      invalidate();
      repaint();
    }
  };
  KeymapManager.getInstance().addKeymapManagerListener(keymapListener, this);
  UISettings.getInstance().addUISettingsListener(this, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:EditorsSplitters.java

示例13: initTest

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
protected void initTest(Container applicationServices, Container projectServices) {
  super.initTest(applicationServices, projectServices);

  applicationServices.register(UISettings.class, new UISettings());
  projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
  BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);

  applicationServices.register(ExperimentService.class, new MockExperimentService());

  ExtensionPointImpl<TargetFinder> targetFinderEp =
      registerExtensionPoint(TargetFinder.EP_NAME, TargetFinder.class);
  targetFinderEp.registerExtension(new MockTargetFinder());

  ExtensionPointImpl<BlazeCommandRunConfigurationHandlerProvider> handlerProviderEp =
      registerExtensionPoint(
          BlazeCommandRunConfigurationHandlerProvider.EP_NAME,
          BlazeCommandRunConfigurationHandlerProvider.class);
  handlerProviderEp.registerExtension(new MockBlazeCommandRunConfigurationHandlerProvider());

  this.configuration = this.type.getFactory().createTemplateConfiguration(project);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:23,代码来源:BlazeCommandRunConfigurationTest.java

示例14: update

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
public void update(final AnActionEvent e) {
  e.getPresentation().setIcon(AllIcons.Actions.Close);
  e.getPresentation().setHoveredIcon(AllIcons.Actions.CloseHovered);
  e.getPresentation().setVisible(UISettings.getInstance().getShowCloseButton());
  e.getPresentation().setText("Delete test");
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:8,代码来源:StudyEditInputAction.java

示例15: uninstallListeners

import com.intellij.ide.ui.UISettings; //导入依赖的package包/类
@Override
protected void uninstallListeners() {
  scrollbar.removeMouseMotionListener(this);
  scrollbar.removeMouseListener(this);
  myErrorStripeButton.removeMouseMotionListener(this);
  myErrorStripeButton.removeMouseListener(this);
  UISettings.getInstance().removeUISettingsListener(this);
  super.uninstallListeners();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EditorMarkupModelImpl.java


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