本文整理匯總了Java中com.intellij.util.ui.UIUtil.applyStyle方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.applyStyle方法的具體用法?Java UIUtil.applyStyle怎麽用?Java UIUtil.applyStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.applyStyle方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: KeyboardShortcutDialog
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public KeyboardShortcutDialog(Component component, String actionId, final QuickList[] quickLists) {
super(component, true);
setTitle(KeyMapBundle.message("keyboard.shortcut.dialog.title"));
myActionId = actionId;
final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(component));
myMainGroup = ActionsTreeUtil.createMainGroup(project, myKeymap, quickLists, null, false, null); //without current filter
myEnableSecondKeystroke = new JCheckBox();
UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, myEnableSecondKeystroke);
myEnableSecondKeystroke.setBorder(new EmptyBorder(4, 0, 0, 2));
myEnableSecondKeystroke.setFocusable(false);
myKeystrokePreview = new JLabel(" ");
myConflictInfoArea = new JTextArea("");
myConflictInfoArea.setFocusable(false);
init();
}
示例2: createCustomComponent
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public JComponent createCustomComponent(final boolean selected) {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
final JComponent baseComponent = createBaseComponent();
panel.add(baseComponent);
final JLabel descriptionLabel = new JLabel(myDescription);
UIUtil.applyStyle(UIUtil.ComponentStyle.MINI, descriptionLabel);
panel.add(installLeftIndentToLabel(descriptionLabel));
UIUtil.setEnabled(panel, enabled(), true);
panel.setBackground(selected ? UIUtil.getListSelectionBackground() : UIUtil.getListBackground());
descriptionLabel.setForeground(selected ? UIUtil.getListSelectionForeground() : UIUtil.getListForeground());
baseComponent.setForeground(selected ? UIUtil.getListSelectionForeground() : UIUtil.getListForeground());
return panel;
}
示例3: setComponentStyle
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void setComponentStyle(@NotNull UIUtil.ComponentStyle componentStyle) {
myComponentStyle = componentStyle;
UIUtil.applyStyle(componentStyle, this);
}
示例4: init
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void init() {
GuiUtils.replaceJSplitPaneWithIDEASplitter(main);
HTMLEditorKit kit = new HTMLEditorKit();
StyleSheet sheet = kit.getStyleSheet();
sheet.addRule("ul {margin-left: 16px}"); // list-style-type: none;
myDescriptionTextArea.setEditorKit(kit);
myDescriptionTextArea.setEditable(false);
myDescriptionTextArea.addHyperlinkListener(new MyHyperlinkListener());
JScrollPane installedScrollPane = createTable();
myPluginHeaderPanel = new PluginHeaderPanel(this);
myHeader.setBackground(UIUtil.getTextFieldBackground());
myPluginHeaderPanel.getPanel().setBackground(UIUtil.getTextFieldBackground());
myPluginHeaderPanel.getPanel().setOpaque(true);
myHeader.add(myPluginHeaderPanel.getPanel(), BorderLayout.CENTER);
installTableActions();
myTablePanel.add(installedScrollPane, BorderLayout.CENTER);
UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, myPanelDescription);
myPanelDescription.setBorder(JBUI.Borders.emptyLeft(7));
final JPanel header = new JPanel(new BorderLayout()) {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
final Color bg = UIUtil.getTableBackground(false);
((Graphics2D)g).setPaint(new GradientPaint(0, 0, ColorUtil.shift(bg, 1.4), 0, getHeight(), ColorUtil.shift(bg, 0.9)));
g.fillRect(0,0, getWidth(), getHeight());
}
};
header.setBorder(new CustomLineBorder(1, 1, 0, 1));
final JLabel mySortLabel = new JLabel();
mySortLabel.setForeground(UIUtil.getLabelDisabledForeground());
mySortLabel.setBorder(JBUI.Borders.empty(1, 1, 1, 5));
mySortLabel.setIcon(AllIcons.General.SplitDown);
mySortLabel.setHorizontalTextPosition(SwingConstants.LEADING);
header.add(mySortLabel, BorderLayout.EAST);
myTablePanel.add(header, BorderLayout.NORTH);
myToolbarPanel.setLayout(new BorderLayout());
myActionToolbar = ActionManager.getInstance().createActionToolbar("PluginManager", getActionGroup(true), true);
final JComponent component = myActionToolbar.getComponent();
myToolbarPanel.add(component, BorderLayout.CENTER);
myToolbarPanel.add(myFilter, BorderLayout.WEST);
new ClickListener() {
@Override
public boolean onClick(@NotNull MouseEvent event, int clickCount) {
JBPopupFactory.getInstance().createActionGroupPopup("Sort by:", createSortersGroup(), DataManager.getInstance().getDataContext(pluginTable),
JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true).showUnderneathOf(mySortLabel);
return true;
}
}.installOn(mySortLabel);
final TableModelListener modelListener = new TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
String text = "Sort by:";
if (pluginsModel.isSortByStatus()) {
text += " status,";
}
if (pluginsModel.isSortByRating()) {
text += " rating,";
}
if (pluginsModel.isSortByDownloads()) {
text += " downloads,";
}
if (pluginsModel.isSortByUpdated()) {
text += " updated,";
}
text += " name";
mySortLabel.setText(text);
}
};
pluginTable.getModel().addTableModelListener(modelListener);
modelListener.tableChanged(null);
myDescriptionScrollPane.setBackground(UIUtil.getTextFieldBackground());
Border border = new BorderUIResource.LineBorderUIResource(new JBColor(Gray._220, Gray._55), 1);
myInfoPanel.setBorder(border);
}
示例5: DescriptionLabel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public DescriptionLabel() {
UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, this);
setVerticalAlignment(CENTER);
setHorizontalAlignment(LEFT);
}