当前位置: 首页>>代码示例>>Java>>正文


Java IJSwingUtilities.adjustComponentsOnMac方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JBTableRowEditor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:63,代码来源:ChangeSignatureDialogBase.java


注:本文中的com.intellij.util.IJSwingUtilities.adjustComponentsOnMac方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。