本文整理匯總了Java中com.intellij.openapi.util.IconLoader.activate方法的典型用法代碼示例。如果您正苦於以下問題:Java IconLoader.activate方法的具體用法?Java IconLoader.activate怎麽用?Java IconLoader.activate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.util.IconLoader
的用法示例。
在下文中一共展示了IconLoader.activate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: patchSystem
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static void patchSystem(boolean headless) {
System.setProperty("sun.awt.noerasebackground", "true");
IdeEventQueue.getInstance(); // replace system event queue
if (headless) return;
if (Patches.SUN_BUG_ID_6209673) {
RepaintManager.setCurrentManager(new IdeRepaintManager());
}
if (SystemInfo.isXWindow) {
String wmName = X11UiUtil.getWmName();
LOG.info("WM detected: " + wmName);
if (wmName != null) {
X11UiUtil.patchDetectedWm(wmName);
}
}
IconLoader.activate();
new JFrame().pack(); // this peer will prevent shutting down our application
}
示例2: main
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public static void main(String[] args) {
IconLoader.activate();
final JFrame frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
final JPanel content = new JPanel(new BorderLayout());
final LoadingDecorator loadingTree = new LoadingDecorator(new JComboBox(), Disposer.newDisposable(), -1);
content.add(loadingTree.getComponent(), BorderLayout.CENTER);
final JCheckBox loadingCheckBox = new JCheckBox("Loading");
loadingCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
if (loadingTree.isLoading()) {
loadingTree.stopLoading();
} else {
loadingTree.startLoading(false);
}
}
});
content.add(loadingCheckBox, BorderLayout.SOUTH);
frame.getContentPane().add(content, BorderLayout.CENTER);
frame.setBounds(300, 300, 300, 300);
frame.show();
}
示例3: CustomizeUIThemeStepPanel
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public CustomizeUIThemeStepPanel() {
setLayout(createSmallBorderLayout());
IconLoader.activate();
initThemes(myThemes);
myColumnMode = myThemes.size() > 2;
JPanel buttonsPanel = new JPanel(new GridLayout(myColumnMode ? myThemes.size() : 1, myColumnMode ? 1 : myThemes.size(), 5, 5));
ButtonGroup group = new ButtonGroup();
final ThemeInfo myDefaultTheme = myThemes.iterator().next();
for (final ThemeInfo theme: myThemes) {
final JRadioButton radioButton = new JRadioButton(theme.name, myDefaultTheme == theme);
radioButton.setOpaque(false);
final JPanel panel = createBigButtonPanel(createSmallBorderLayout(), radioButton, new Runnable() {
@Override
public void run() {
applyLaf(theme, CustomizeUIThemeStepPanel.this);
theme.apply();
}
});
panel.setBorder(createSmallEmptyBorder());
panel.add(radioButton, myColumnMode ? BorderLayout.WEST : BorderLayout.NORTH);
Icon icon = theme.getIcon();
final JLabel label = new JLabel(myColumnMode ? IconUtil.scale(IconUtil.cropIcon(icon, icon.getIconWidth() * 2 / 3, icon.getIconHeight() * 2 / 3), .5) : icon);
label.setVerticalAlignment(SwingConstants.TOP);
label.setHorizontalAlignment(SwingConstants.RIGHT);
panel.add(label, BorderLayout.CENTER);
group.add(radioButton);
buttonsPanel.add(panel);
}
add(buttonsPanel, BorderLayout.CENTER);
myPreviewLabel = new JLabel();
myPreviewLabel.setHorizontalAlignment(myColumnMode ? SwingConstants.LEFT : SwingConstants.CENTER);
myPreviewLabel.setVerticalAlignment(SwingConstants.CENTER);
if (myColumnMode) {
add(buttonsPanel, BorderLayout.WEST);
JPanel wrapperPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
wrapperPanel.add(myPreviewLabel);
add(wrapperPanel, BorderLayout.CENTER);
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
applyLaf(myDefaultTheme, CustomizeUIThemeStepPanel.this);
}
});
myInitial = false;
}