本文整理汇总了Java中com.intellij.ui.TitledSeparator类的典型用法代码示例。如果您正苦于以下问题:Java TitledSeparator类的具体用法?Java TitledSeparator怎么用?Java TitledSeparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TitledSeparator类属于com.intellij.ui包,在下文中一共展示了TitledSeparator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createParametersPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Nullable
private JPanel createParametersPanel () {
myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod);
myOldClassParameterNameFields = new HashMap<PsiClass, EditorTextField>();
if (myThisClassesMap.size() == 0) return null;
JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true));
for (PsiClass aClass : myThisClassesMap.keySet()) {
final String text = RefactoringBundle.message("move.method.this.parameter.label", aClass.getName());
panel.add(new TitledSeparator(text, null));
String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass);
final EditorTextField field = new EditorTextField(suggestedName, getProject(), StdFileTypes.JAVA);
field.setMinimumSize(new Dimension(field.getPreferredSize()));
myOldClassParameterNameFields.put(aClass, field);
panel.add(field);
}
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MoveInstanceMethodDialog.java
示例2: paintBorder
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
int labelX = x + outsideInsets.left;
int labelY = y + outsideInsets.top;
TitledSeparator titledSeparator = getTitledSeparator(c);
JLabel label = titledSeparator.getLabel();
Dimension labelSize = label.getPreferredSize();
label.setSize(labelSize);
g.translate(labelX, labelY);
label.paint(g);
int separatorX = labelX + labelSize.width + TitledSeparator.SEPARATOR_LEFT_INSET;
int separatorY = labelY + (UIUtil.isUnderAquaLookAndFeel() ? 2 : labelSize.height / 2 - 1);
int separatorW = Math.max(0, width - separatorX - TitledSeparator.SEPARATOR_RIGHT_INSET);
int separatorH = 2;
JSeparator separator = titledSeparator.getSeparator();
separator.setSize(separatorW, separatorH);
g.translate(separatorX - labelX, separatorY - labelY);
separator.paint(g);
g.translate(-separatorX, -separatorY);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:IdeaTitledBorder.java
示例3: paintBorder
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
int labelX = x + outsideInsets.left;
int labelY = y + outsideInsets.top;
TitledSeparator titledSeparator = getTitledSeparator(c);
JLabel label = titledSeparator.getLabel();
Dimension labelSize = label.getPreferredSize();
label.setSize(labelSize);
g.translate(labelX, labelY);
label.paint(g);
int separatorX = labelX + labelSize.width + TitledSeparator.SEPARATOR_LEFT_INSET;
int separatorY = labelY + (UIUtil.isUnderAquaLookAndFeel() ? 2 : labelSize.height / 2 - 1);
int separatorW = Math.max(0, width - separatorX - TitledSeparator.SEPARATOR_RIGHT_INSET);
int separatorH = 2;
JSeparator separator = titledSeparator.getSeparator();
separator.setSize(separatorW, separatorH);
g.translate(separatorX - labelX, separatorY - labelY);
if (myShowLine) {
separator.paint(g);
}
g.translate(-separatorX, -separatorY);
}
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:IdeaTitledBorder.java
示例4: createParametersPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Nullable
private JPanel createParametersPanel () {
myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod);
myOldClassParameterNameFields = new HashMap<PsiClass, EditorTextField>();
if (myThisClassesMap.size() == 0) return null;
JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true));
for (PsiClass aClass : myThisClassesMap.keySet()) {
final String text = RefactoringBundle.message("move.method.this.parameter.label", aClass.getName());
panel.add(new TitledSeparator(text, null));
String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass);
final EditorTextField field = new EditorTextField(suggestedName, getProject(), JavaFileType.INSTANCE);
field.setMinimumSize(new Dimension(field.getPreferredSize()));
myOldClassParameterNameFields.put(aClass, field);
panel.add(field);
}
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
return panel;
}
开发者ID:consulo,项目名称:consulo-java,代码行数:20,代码来源:MoveInstanceMethodDialog.java
示例5: getAdditionalActionSettings
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
protected JComponent getAdditionalActionSettings(Project project, BaseAnalysisActionDialog dialog) {
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(new TitledSeparator());
myAnnotateLocalVariablesCb = new JCheckBox("Annotate local variables", PropertiesComponent.getInstance().getBoolean(ANNOTATE_LOCAL_VARIABLES));
panel.add(myAnnotateLocalVariablesCb);
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InferNullityAnnotationsAction.java
示例6: createCenterPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
protected JComponent createCenterPanel() {
JPanel mainPanel = new JPanel(new GridBagLayout());
final TitledSeparator separator = new TitledSeparator();
mainPanel.add(separator, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
myList = createTargetVariableChooser();
myList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
validateTextFields(e.getFirstIndex());
}
});
separator.setText(RefactoringBundle.message("moveInstanceMethod.select.an.instance.parameter"));
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myList);
mainPanel.add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0));
myVisibilityPanel = createVisibilityPanel();
mainPanel.add(myVisibilityPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0,0,0,0), 0,0));
final JPanel parametersPanel = createParametersPanel();
if (parametersPanel != null) {
mainPanel.add(parametersPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
}
mainPanel.add(initOpenInEditorCb(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
separator.setLabelFor(myList);
validateTextFields(myList.getSelectedIndex());
updateOnChanged(myList);
return mainPanel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:MoveInstanceMethodDialog.java
示例7: IdeaTitledBorder
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
public IdeaTitledBorder(String title, int indent, Insets insets) {
super(title);
titledSeparator = new TitledSeparator(title);
titledSeparator.setText(title);
DialogUtil.registerMnemonic(titledSeparator.getLabel(), null);
outsideInsets = JBInsets.create(insets);
insideInsets = new JBInsets(TitledSeparator.BOTTOM_INSET, indent, 0, 0);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:IdeaTitledBorder.java
示例8: getBorderInsets
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
public Insets getBorderInsets(Component c, final Insets insets) {
insets.top += getTitledSeparator(c).getPreferredSize().getHeight() - TitledSeparator.TOP_INSET - TitledSeparator.BOTTOM_INSET;
insets.top += UIUtil.DEFAULT_VGAP;
insets.top += insideInsets.top;
insets.left += insideInsets.left;
insets.bottom += insideInsets.bottom;
insets.right += insideInsets.right;
insets.top += outsideInsets.top;
insets.left += outsideInsets.left;
insets.bottom += outsideInsets.bottom;
insets.right += outsideInsets.right;
return insets;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:IdeaTitledBorder.java
示例9: createPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@NotNull
static JPanel createPanel(boolean isUseTitledBorder) {
int verticalGap = TitledSeparator.TOP_INSET;
JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, isUseTitledBorder ? 0 : verticalGap, true, true));
// VerticalFlowLayout incorrectly use vertical gap as top inset
if (!isUseTitledBorder) {
panel.setBorder(new EmptyBorder(-verticalGap, 0, 0, 0));
}
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MergedCompositeConfigurable.java
示例10: getAdditionalActionSettings
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Nullable
@Override
protected JComponent getAdditionalActionSettings(Project project, BaseAnalysisActionDialog dialog) {
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(new TitledSeparator());
myUpdateExistingCopyrightsCb = new JCheckBox("Update existing copyrights",
PropertiesComponent.getInstance().getBoolean(UPDATE_EXISTING_COPYRIGHTS, true));
panel.add(myUpdateExistingCopyrightsCb);
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UpdateCopyrightAction.java
示例11: getAdditionalActionSettings
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
protected JComponent getAdditionalActionSettings(Project project, BaseAnalysisActionDialog dialog) {
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(new TitledSeparator());
myAnnotateLocalVariablesCb = new JCheckBox("Annotate local variables", false);
panel.add(myAnnotateLocalVariablesCb);
return panel;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:InferNullityAnnotationsAction.java
示例12: createCenterPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
protected JComponent createCenterPanel() {
JPanel mainPanel = new JPanel(new GridBagLayout());
final TitledSeparator separator = new TitledSeparator();
mainPanel.add(separator, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
myList = createTargetVariableChooser();
myList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
validateTextFields(e.getFirstIndex());
}
});
separator.setText(RefactoringBundle.message("moveInstanceMethod.select.an.instance.parameter"));
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myList);
mainPanel.add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0));
myVisibilityPanel = createVisibilityPanel();
mainPanel.add(myVisibilityPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0,0,0,0), 0,0));
final JPanel parametersPanel = createParametersPanel();
if (parametersPanel != null) {
mainPanel.add(parametersPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
}
separator.setLabelFor(myList);
validateTextFields(myList.getSelectedIndex());
updateOnChanged(myList);
return mainPanel;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:MoveInstanceMethodDialog.java
示例13: IdeaTitledBorder
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
public IdeaTitledBorder(String title, int indent, Insets insets) {
super(title);
titledSeparator = new TitledSeparator(title);
titledSeparator.setText(title);
DialogUtil.registerMnemonic(titledSeparator.getLabel(), null);
this.outsideInsets = new Insets(insets.top, insets.left, insets.bottom, insets.right);
this.insideInsets = new Insets(TitledSeparator.BOTTOM_INSET, indent, 0, 0);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:IdeaTitledBorder.java
示例14: createPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Nonnull
static JPanel createPanel(boolean isUseTitledBorder) {
int verticalGap = TitledSeparator.TOP_INSET;
JPanel panel = new JPanel(new VerticalFlowLayout(0, isUseTitledBorder ? 0 : verticalGap));
// VerticalFlowLayout incorrectly use vertical gap as top inset
if (!isUseTitledBorder) {
panel.setBorder(new EmptyBorder(-verticalGap, 0, 0, 0));
}
return panel;
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:MergedCompositeConfigurable.java
示例15: getAdditionalActionSettings
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
protected JComponent getAdditionalActionSettings(Project project, BaseAnalysisActionDialog dialog)
{
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(new TitledSeparator());
myAnnotateLocalVariablesCb = new JCheckBox("Annotate local variables", PropertiesComponent.getInstance().getBoolean(ANNOTATE_LOCAL_VARIABLES));
panel.add(myAnnotateLocalVariablesCb);
return panel;
}
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:InferNullityAnnotationsAction.java
示例16: createConfigurable
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@Override
protected UnnamedConfigurable createConfigurable(Couple<TemplateResource> item) {
final GenerateTemplateConfigurable equalsConfigurable = new GenerateTemplateConfigurable(item.first, GenerateEqualsHelper.getEqualsImplicitVars(myProject), myProject);
final GenerateTemplateConfigurable hashCodeConfigurable = new GenerateTemplateConfigurable(item.second, GenerateEqualsHelper.getHashCodeImplicitVars(), myProject);
return new UnnamedConfigurable() {
@Nullable
@Override
public JComponent createComponent() {
final Splitter splitter = new Splitter(true);
final JPanel eqPanel = new JPanel(new BorderLayout());
eqPanel.add(new TitledSeparator("Equals Template:"), BorderLayout.NORTH);
final JComponent eqPane = equalsConfigurable.createComponent();
eqPane.setPreferredSize(JBUI.size(300, 200));
eqPanel.add(eqPane, BorderLayout.CENTER);
splitter.setFirstComponent(eqPanel);
final JPanel hcPanel = new JPanel(new BorderLayout());
hcPanel.add(new TitledSeparator("HashCode Template:"), BorderLayout.NORTH);
final JComponent hcPane = hashCodeConfigurable.createComponent();
hcPane.setPreferredSize(JBUI.size(300, 200));
hcPanel.add(hcPane, BorderLayout.CENTER);
splitter.setSecondComponent(hcPanel);
return splitter;
}
@Override
public boolean isModified() {
return equalsConfigurable.isModified() || hashCodeConfigurable.isModified();
}
@Override
public void apply() throws ConfigurationException {
equalsConfigurable.apply();
hashCodeConfigurable.apply();
}
@Override
public void reset() {
equalsConfigurable.reset();
hashCodeConfigurable.reset();
}
@Override
public void disposeUIResources() {
equalsConfigurable.disposeUIResources();
hashCodeConfigurable.disposeUIResources();
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:EqualsHashCodeTemplatesPanel.java
示例17: getTitledSeparator
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
private TitledSeparator getTitledSeparator(Component c) {
titledSeparator.setEnabled(c.isEnabled());
return titledSeparator;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:IdeaTitledBorder.java
示例18: showUsages
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
private static void showUsages(final JPanel panel,
final TitledSeparator separator,
final List<IntentionUsagePanel> usagePanels,
@Nullable final TextDescriptor[] exampleUsages) throws IOException {
GridBagConstraints gb = null;
boolean reuse = exampleUsages != null && panel.getComponents().length == exampleUsages.length;
if (!reuse) {
disposeUsagePanels(usagePanels);
panel.setLayout(new GridBagLayout());
panel.removeAll();
gb = new GridBagConstraints();
gb.anchor = GridBagConstraints.NORTHWEST;
gb.fill = GridBagConstraints.BOTH;
gb.gridheight = GridBagConstraints.REMAINDER;
gb.gridwidth = 1;
gb.gridx = 0;
gb.gridy = 0;
gb.insets = new Insets(0,0,0,0);
gb.ipadx = 5;
gb.ipady = 5;
gb.weightx = 1;
gb.weighty = 1;
}
if (exampleUsages != null) {
for (int i = 0; i < exampleUsages.length; i++) {
final TextDescriptor exampleUsage = exampleUsages[i];
final String name = exampleUsage.getFileName();
final FileTypeManagerEx fileTypeManager = FileTypeManagerEx.getInstanceEx();
final String extension = fileTypeManager.getExtension(name);
final FileType fileType = fileTypeManager.getFileTypeByExtension(extension);
IntentionUsagePanel usagePanel;
if (reuse) {
usagePanel = (IntentionUsagePanel)panel.getComponent(i);
}
else {
usagePanel = new IntentionUsagePanel();
usagePanels.add(usagePanel);
}
usagePanel.reset(exampleUsage.getText(), fileType);
if (!reuse) {
if (i == exampleUsages.length) {
gb.gridwidth = GridBagConstraints.REMAINDER;
}
panel.add(usagePanel, gb);
gb.gridx++;
}
}
}
panel.revalidate();
panel.repaint();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:IntentionDescriptionPanel.java
示例19: BrowserSettingsPanel
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
public BrowserSettingsPanel() {
alternativeBrowserPathField.addBrowseFolderListener(IdeBundle.message("title.select.path.to.browser"), null, null, APP_FILE_CHOOSER_DESCRIPTOR);
defaultBrowserPanel.setBorder(TitledSeparator.EMPTY_BORDER);
ArrayList<DefaultBrowserPolicy> defaultBrowserPolicies = new ArrayList<DefaultBrowserPolicy>();
if (BrowserLauncherAppless.canUseSystemDefaultBrowserPolicy()) {
defaultBrowserPolicies.add(DefaultBrowserPolicy.SYSTEM);
}
defaultBrowserPolicies.add(DefaultBrowserPolicy.FIRST);
defaultBrowserPolicies.add(DefaultBrowserPolicy.ALTERNATIVE);
//noinspection Since15,unchecked
defaultBrowserPolicyComboBox.setModel(new ListComboBoxModel<DefaultBrowserPolicy>(defaultBrowserPolicies));
defaultBrowserPolicyComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(@NotNull ItemEvent e) {
boolean customPathEnabled = e.getItem() == DefaultBrowserPolicy.ALTERNATIVE;
if (e.getStateChange() == ItemEvent.DESELECTED) {
if (customPathEnabled) {
customPathValue = alternativeBrowserPathField.getText();
}
}
else if (e.getStateChange() == ItemEvent.SELECTED) {
alternativeBrowserPathField.setEnabled(customPathEnabled);
updateCustomPathTextFieldValue((DefaultBrowserPolicy)e.getItem());
}
}
});
defaultBrowserPolicyComboBox.setRenderer(new ListCellRendererWrapper<DefaultBrowserPolicy>() {
@Override
public void customize(JList list, DefaultBrowserPolicy value, int index, boolean selected, boolean hasFocus) {
String name;
switch (value) {
case SYSTEM:
name = "System default";
break;
case FIRST:
name = "First listed";
break;
case ALTERNATIVE:
name = "Custom path";
break;
default:
throw new IllegalStateException();
}
setText(name);
}
});
if (UIUtil.isUnderAquaLookAndFeel()) {
defaultBrowserPolicyComboBox.setBorder(new EmptyBorder(3, 0, 0, 0));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:BrowserSettingsPanel.java
示例20: updateBuilderWithTitle
import com.intellij.ui.TitledSeparator; //导入依赖的package包/类
@SuppressWarnings("MethodMayBeStatic")
private FormBuilder updateBuilderWithTitle(FormBuilder builder, String title) {
return builder.addComponent(new TitledSeparator(title), IdeBorderFactory.TITLED_BORDER_TOP_INSET);
}
开发者ID:consulo,项目名称:consulo-tasks,代码行数:5,代码来源:UntrustedCertificateWarningDialog.java
注:本文中的com.intellij.ui.TitledSeparator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论