本文整理汇总了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);
}
示例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;
}
示例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();
}
示例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();
}
}
});
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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));
}
示例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());
}
});
}
示例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));
}
示例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;
}
示例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;
}
示例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();
}
});
}
}
示例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();
}
示例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);
}