本文整理汇总了Java中com.intellij.util.IJSwingUtilities.adjustComponentsOnMac方法的典型用法代码示例。如果您正苦于以下问题:Java IJSwingUtilities.adjustComponentsOnMac方法的具体用法?Java IJSwingUtilities.adjustComponentsOnMac怎么用?Java IJSwingUtilities.adjustComponentsOnMac使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.IJSwingUtilities
的用法示例。
在下文中一共展示了IJSwingUtilities.adjustComponentsOnMac方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLabeledPanel
import com.intellij.util.IJSwingUtilities; //导入方法依赖的package包/类
public static JPanel createLabeledPanel(String labelText, JComponent component) {
final JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 2, true, false));
final JBLabel label = new JBLabel(labelText, UIUtil.ComponentStyle.SMALL);
IJSwingUtilities.adjustComponentsOnMac(label, component);
panel.add(label);
panel.add(component);
return panel;
}
示例2: createNorthPanel
import com.intellij.util.IJSwingUtilities; //导入方法依赖的package包/类
@Override
protected JComponent createNorthPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 0, 1,
GridBagConstraints.WEST,
GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0),
0, 0);
myNamePanel = new JPanel(new BorderLayout(0, 2));
myNameField = new EditorTextField(myMethod.getName());
final JLabel nameLabel = new JLabel(RefactoringBundle.message("changeSignature.name.prompt"));
nameLabel.setLabelFor(myNameField);
myNameField.setEnabled(myMethod.canChangeName());
if (myMethod.canChangeName()) {
myNameField.addDocumentListener(mySignatureUpdater);
myNameField.setPreferredWidth(200);
}
myNamePanel.add(nameLabel, BorderLayout.NORTH);
IJSwingUtilities.adjustComponentsOnMac(nameLabel, myNameField);
myNamePanel.add(myNameField, BorderLayout.SOUTH);
createVisibilityPanel();
if (myMethod.canChangeVisibility() && myVisibilityPanel instanceof ComboBoxVisibilityPanel) {
((ComboBoxVisibilityPanel)myVisibilityPanel).registerUpDownActionsFor(myNameField);
myVisibilityPanel.setBorder(new EmptyBorder(0, 0, 0, 8));
panel.add(myVisibilityPanel, gbc);
gbc.gridx++;
}
gbc.weightx = 1;
if (myMethod.canChangeReturnType() != MethodDescriptor.ReadWriteOption.None) {
JPanel typePanel = new JPanel(new BorderLayout(0, 2));
typePanel.setBorder(new EmptyBorder(0, 0, 0, 8));
final JLabel typeLabel = new JLabel(RefactoringBundle.message("changeSignature.return.type.prompt"));
myReturnTypeCodeFragment = createReturnTypeCodeFragment();
final Document document = PsiDocumentManager.getInstance(myProject).getDocument(myReturnTypeCodeFragment);
myReturnTypeField = createReturnTypeTextField(document);
((ComboBoxVisibilityPanel)myVisibilityPanel).registerUpDownActionsFor(myReturnTypeField);
typeLabel.setLabelFor(myReturnTypeField);
if (myMethod.canChangeReturnType() == MethodDescriptor.ReadWriteOption.ReadWrite) {
myReturnTypeField.setPreferredWidth(200);
myReturnTypeField.addDocumentListener(mySignatureUpdater);
}
else {
myReturnTypeField.setEnabled(false);
}
typePanel.add(typeLabel, BorderLayout.NORTH);
IJSwingUtilities.adjustComponentsOnMac(typeLabel, myReturnTypeField);
typePanel.add(myReturnTypeField, BorderLayout.SOUTH);
panel.add(typePanel, gbc);
gbc.gridx++;
}
panel.add(myNamePanel, gbc);
return panel;
}