本文整理匯總了Java中com.intellij.util.ui.UIUtil.findComponentsOfType方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.findComponentsOfType方法的具體用法?Java UIUtil.findComponentsOfType怎麽用?Java UIUtil.findComponentsOfType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.findComponentsOfType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: repaintMnemonics
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private static void repaintMnemonics(@NotNull Component focusOwner, boolean pressed) {
if (pressed != myAltPressed) return;
Window window = SwingUtilities.windowForComponent(focusOwner);
if (window != null) {
for (Component component : window.getComponents()) {
if (component instanceof JComponent) {
for (JComponent c : UIUtil.findComponentsOfType((JComponent)component, JComponent.class)) {
if ((c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() != -1)
|| (c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() != -1)
) {
c.repaint();
}
}
}
}
}
}
示例2: installPaddingAndBordersForEditors
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private static void installPaddingAndBordersForEditors(JBTableRowEditor editor) {
final List<EditorTextField> editors = UIUtil.findComponentsOfType(editor, EditorTextField.class);
for (EditorTextField textField : editors) {
textField.putClientProperty("JComboBox.isTableCellEditor", Boolean.FALSE);
textField.putClientProperty("JBListTable.isTableCellEditor", Boolean.TRUE);
}
}
示例3: paint
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void paint(Graphics g, JComponent c) {
JComponent editor = spinner.getEditor();
boolean hasFocus = c.hasFocus();
if (!hasFocus && editor != null) {
hasFocus = editor.hasFocus();
if (!hasFocus) {
for (JComponent child : UIUtil.findComponentsOfType(editor, JComponent.class)) {
hasFocus = child.hasFocus();
if (hasFocus) break;
}
}
}
Container parent = c.getParent();
if (c.isOpaque() && parent != null) {
g.setColor(parent.getBackground());
g.fillRect(0,0,c.getWidth(),c.getHeight());
}
Insets clip = c.getInsets();
int stop = c.getWidth() - MacIntelliJIconCache.getIcon("spinnerRight").getIconWidth() - clip.right;
//int y = (c.getHeight() - 26) / 2;
Graphics gg = g.create(clip.left, clip.top, stop - clip.left, MacIntelliJIconCache.getIcon("spinnerRight").getIconHeight());
boolean enabled = c.isEnabled();
Icon icon = MacIntelliJIconCache.getIcon("comboLeft", false, hasFocus, enabled);
icon.paintIcon(c,gg,clip.left,clip.top);
int x = icon.getIconWidth();
icon = MacIntelliJIconCache.getIcon("comboMiddle", false, hasFocus, enabled);
while (x < stop) {
icon.paintIcon(c, gg, x, clip.top);
x+=icon.getIconWidth();
}
gg.dispose();
icon = MacIntelliJIconCache.getIcon("spinnerRight", false, hasFocus, enabled);
icon.paintIcon(c, g, stop, clip.top);
}
示例4: setAnchor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void setAnchor(@Nullable JComponent anchor) {
super.setAnchor(anchor);
List<JBLabel> labels = UIUtil.findComponentsOfType(myCustomPanel, JBLabel.class);
for (JBLabel label : labels) {
label.setAnchor(anchor);
}
}
示例5: createCenterPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout());
//Should be called from here to initialize fields !!!
final JComponent optionsPanel = createOptionsPanel();
final JPanel subPanel = new JPanel(new BorderLayout());
final List<Pair<String, JPanel>> panels = createAdditionalPanels();
if (myMethod.canChangeParameters()) {
final JPanel parametersPanel = createParametersPanel(!panels.isEmpty());
if (!panels.isEmpty()) {
parametersPanel.setBorder(IdeBorderFactory.createEmptyBorder());
}
subPanel.add(parametersPanel, BorderLayout.CENTER);
}
if (myMethod.canChangeVisibility() && !(myVisibilityPanel instanceof ComboBoxVisibilityPanel)) {
subPanel.add(myVisibilityPanel, myMethod.canChangeParameters() ? BorderLayout.EAST : BorderLayout.CENTER);
}
panel.add(subPanel, BorderLayout.CENTER);
final JPanel main;
if (panels.isEmpty()) {
main = panel;
}
else {
final TabbedPaneWrapper tabbedPane = new TabbedPaneWrapper(getDisposable());
tabbedPane.addTab(RefactoringBundle.message("parameters.border.title"), panel);
for (Pair<String, JPanel> extraPanel : panels) {
tabbedPane.addTab(extraPanel.first, extraPanel.second);
}
main = new JPanel(new BorderLayout());
final JComponent tabs = tabbedPane.getComponent();
main.add(tabs, BorderLayout.CENTER);
//remove traversal policies
for (JComponent c : UIUtil.findComponentsOfType(tabs, JComponent.class)) {
c.setFocusCycleRoot(false);
c.setFocusTraversalPolicy(null);
}
}
final JPanel bottom = new JPanel(new BorderLayout());
bottom.add(optionsPanel, BorderLayout.NORTH);
bottom.add(createSignaturePanel(), BorderLayout.SOUTH);
main.add(bottom, BorderLayout.SOUTH);
main.setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 0, 0));
return main;
}