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


Java LafManager类代码示例

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


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

示例1: lookAndFeelChanged

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
@Override
public void lookAndFeelChanged(LafManager source) {
    final Color background = UIUtil.isUnderDarcula()
            ? JBColor.background()
            : JBColor.black;

    inputTerminal.setBackground(background);
    // TODO: Upstream fix for Kahlua
    outputTerminal.setBackground(background);

    // Find the panes we are looking for
    JScrollPane scrollPane = (JScrollPane) outputTerminal.getComponent(0);
    JPanel panel1 = (JPanel) scrollPane.getViewport().getView();
    JPanel panel2 = (JPanel) panel1.getComponent(0);

    // Set the background onto the panes directly
    JPanel panel3 = (JPanel) panel2.getComponent(0);
    panel3.setBackground(background);
    JEditorPane editorPane = (JEditorPane) panel2.getComponent(1);
    editorPane.setBackground(background);
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:22,代码来源:LuaJInterpreter.java

示例2: createColorField

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
private JTextField createColorField(boolean hex) {
  final NumberDocument doc = new NumberDocument(hex);
  int lafFix = UIUtil.isUnderWindowsLookAndFeel() || UIUtil.isUnderDarcula() ? 1 : 0;
  UIManager.LookAndFeelInfo info = LafManager.getInstance().getCurrentLookAndFeel();
  if (info != null && (info.getName().startsWith("IDEA") || info.getName().equals("Windows Classic")))
    lafFix = 1;
  final JTextField field;
  if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
    field = new JTextField("");
    field.setDocument(doc);
    field.setPreferredSize(new Dimension(hex ? 60 : 40, 26));
  } else {
    field = new JTextField(doc, "", (hex ? 5 : 2) + lafFix);
    field.setSize(50, -1);
  }
  doc.setSource(field);
  field.getDocument().addDocumentListener(this);
  field.addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(final FocusEvent e) {
      field.selectAll();
    }
  });
  return field;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ColorPicker.java

示例3: tweakEditorAndFireUpdateUI

import com.intellij.ide.ui.LafManager; //导入依赖的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

示例4: fillActions

import com.intellij.ide.ui.LafManager; //导入依赖的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

示例5: unsubscribeFrom

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
static void unsubscribeFrom(NavBarPanel panel) {
  final NavBarListener listener = (NavBarListener)panel.getClientProperty(LISTENER);
  panel.putClientProperty(LISTENER, null);
  if (listener != null) {
    final Project project = panel.getProject();
    KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener(listener);
    FileStatusManager.getInstance(project).removeFileStatusListener(listener);
    PsiManager.getInstance(project).removePsiTreeChangeListener(listener);
    WolfTheProblemSolver.getInstance(project).removeProblemListener(listener);
    ActionManager.getInstance().removeAnActionListener(listener);
    final MessageBusConnection connection = (MessageBusConnection)panel.getClientProperty(BUS);
    panel.putClientProperty(BUS, null);
    if (connection != null) {
      connection.disconnect();
    }
    LafManager.getInstance().removeLafManagerListener(listener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:NavBarListener.java

示例6: createColorField

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
private JTextField createColorField(boolean hex) {
  final NumberDocument doc = new NumberDocument(hex);
  int lafFix = UIUtil.isUnderWindowsLookAndFeel() || UIUtil.isUnderDarcula() ? 1 : 0;
  UIManager.LookAndFeelInfo info = LafManager.getInstance().getCurrentLookAndFeel();
  if (info != null && (info.getName().startsWith("IDEA") || info.getName().equals("Windows Classic")))
    lafFix = 1;
  final JTextField field = new JTextField(doc, "", (hex ? 5:2) + lafFix);
  field.setSize(50, -1);
  doc.setSource(field);
  field.getDocument().addDocumentListener(this);
  field.addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(final FocusEvent e) {
      field.selectAll();
    }
  });
  return field;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ColorPicker.java

示例7: Palette

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
/**
 * Invoked by reflection
 */
public Palette(Project project) {
  myProject = project;
  myLafManagerListener = project == null ? null : new MyLafManagerListener();
  myClass2Properties = new HashMap<Class, IntrospectedProperty[]>();
  myClassName2Item = new HashMap<String, ComponentItem>();
  myGroups = new ArrayList<GroupItem>();

  if (project != null) {
    mySpecialGroup.setReadOnly(true);
    mySpecialGroup.addItem(ComponentItem.createAnyComponentItem(project));
  }

  if (myLafManagerListener != null) {
    LafManager.getInstance().addLafManagerListener(myLafManagerListener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:Palette.java

示例8: lookAndFeelChanged

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
public void lookAndFeelChanged(final LafManager source) {
  updateUI(myBorderProperty);
  updateUI(MarginProperty.getInstance(myProject));
  updateUI(HGapProperty.getInstance(myProject));
  updateUI(VGapProperty.getInstance(myProject));
  updateUI(HSizePolicyProperty.getInstance(myProject));
  updateUI(VSizePolicyProperty.getInstance(myProject));
  updateUI(HorzAlignProperty.getInstance(myProject));
  updateUI(VertAlignProperty.getInstance(myProject));
  updateUI(IndentProperty.getInstance(myProject));
  updateUI(UseParentLayoutProperty.getInstance(myProject));
  updateUI(MinimumSizeProperty.getInstance(myProject));
  updateUI(PreferredSizeProperty.getInstance(myProject));
  updateUI(MaximumSizeProperty.getInstance(myProject));
  updateUI(myButtonGroupProperty);
  updateUI(myLayoutManagerProperty);
  updateUI(SameSizeHorizontallyProperty.getInstance(myProject));
  updateUI(SameSizeVerticallyProperty.getInstance(myProject));
  updateUI(CustomCreateProperty.getInstance(myProject));
  updateUI(ClientPropertiesProperty.getInstance(myProject));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PropertyInspectorTable.java

示例9: SearchEverywhereAction

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
public SearchEverywhereAction() {
  createSearchField();
  LafManager.getInstance().addLafManagerListener(new LafManagerListener() {
    @Override
    public void lookAndFeelChanged(LafManager source) {
      createSearchField();
    }
  });
  myRenderer = new MyListRenderer();
  myList.setCellRenderer(myRenderer);
  //noinspection SSBasedInspection
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      onFocusLost(field.getTextEditor());
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:SearchEverywhereAction.java

示例10: lookAndFeelChanged

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
@Override
public void lookAndFeelChanged(final LafManager source)
{
	updateUI(myBorderProperty);
	updateUI(MarginProperty.getInstance(myProject));
	updateUI(HGapProperty.getInstance(myProject));
	updateUI(VGapProperty.getInstance(myProject));
	updateUI(HSizePolicyProperty.getInstance(myProject));
	updateUI(VSizePolicyProperty.getInstance(myProject));
	updateUI(HorzAlignProperty.getInstance(myProject));
	updateUI(VertAlignProperty.getInstance(myProject));
	updateUI(IndentProperty.getInstance(myProject));
	updateUI(UseParentLayoutProperty.getInstance(myProject));
	updateUI(MinimumSizeProperty.getInstance(myProject));
	updateUI(PreferredSizeProperty.getInstance(myProject));
	updateUI(MaximumSizeProperty.getInstance(myProject));
	updateUI(myButtonGroupProperty);
	updateUI(myLayoutManagerProperty);
	updateUI(SameSizeHorizontallyProperty.getInstance(myProject));
	updateUI(SameSizeVerticallyProperty.getInstance(myProject));
	updateUI(CustomCreateProperty.getInstance(myProject));
	updateUI(ClientPropertiesProperty.getInstance(myProject));
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:24,代码来源:PropertyInspectorTable.java

示例11: createColorField

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
private JTextField createColorField(boolean hex) {
  final NumberDocument doc = new NumberDocument(hex);
  int lafFix = UIUtil.isUnderWindowsLookAndFeel() || UIUtil.isUnderDarcula() ? 1 : 0;
  UIManager.LookAndFeelInfo info = LafManager.getInstance().getCurrentLookAndFeel();
  if (info != null && (info.getName().startsWith("IDEA") || info.getName().equals("Windows Classic"))) lafFix = 1;
  final JTextField field = new JTextField(doc, "", (hex ? 5 : 2) + lafFix);
  field.setSize(JBUI.scale(50), -1);
  doc.setSource(field);
  field.getDocument().addDocumentListener(this);
  field.addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(final FocusEvent e) {
      field.selectAll();
    }
  });
  return field;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ColorPicker.java

示例12: dispose

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
public void dispose() {
  myLayeredPane.removeComponentListener(myResizeListener);
  if (myLafListener != null) {
    LafManager.getInstance().removeLafManagerListener(myLafListener);
    myLafListener = null;
  }
  for (Balloon balloon : new ArrayList<>(myBalloons)) {
    Disposer.dispose(balloon);
  }
  myRelayoutAlarm.cancelAllRequests();
  myBalloons.clear();
  myLayoutData.clear();
  myListeners.clear();
  myLayeredPane = null;
  myParent = null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:DesktopBalloonLayoutImpl.java

示例13: fillActions

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
@Override
protected void fillActions(Project project, @Nonnull DefaultActionGroup group, @Nonnull 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) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        final UIManager.LookAndFeelInfo cur = manager.getCurrentLookAndFeel();
        if (cur == lf) return;
        manager.setCurrentLookAndFeel(lf);
        manager.updateUI();
      }
    });
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:QuickChangeLookAndFeel.java

示例14: StudyBrowserWindow

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
public StudyBrowserWindow(@NotNull final Project project, final boolean linkInNewWindow, final boolean showProgress) {
  myProject = project;
  myLinkInNewBrowser = linkInNewWindow;
  myShowProgress = showProgress;
  setSize(new Dimension(900, 800));
  setLayout(new BorderLayout());
  setPanel(new JFXPanel());
  setTitle("Study Browser");
  LafManager.getInstance().addLafManagerListener(new StudyLafManagerListener());
  initComponents();
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:12,代码来源:StudyBrowserWindow.java

示例15: initComponents

import com.intellij.ide.ui.LafManager; //导入依赖的package包/类
private void initComponents() {
  Platform.runLater(() -> {
    myPane = new StackPane();
    myWebComponent = new WebView();
    myWebComponent.setOnDragDetected(event -> {});
    myEngine = myWebComponent.getEngine();


    if (myShowProgress) {
      myProgressBar = makeProgressBarWithListener();
      myWebComponent.setVisible(false);
      myPane.getChildren().addAll(myWebComponent, myProgressBar);
    }
    else {
      myPane.getChildren().add(myWebComponent);
    }
    if (myLinkInNewBrowser) {
      initHyperlinkListener();
    }
    Scene scene = new Scene(myPane);
    myPanel.setScene(scene);
    myPanel.setVisible(true);
    updateLaf(LafManager.getInstance().getCurrentLookAndFeel() instanceof DarculaLookAndFeelInfo);
  });

  add(myPanel, BorderLayout.CENTER);
  setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:29,代码来源:StudyBrowserWindow.java


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