mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
constants in borders
This commit is contained in:
@@ -45,19 +45,23 @@ public class JavaVisibilityPanel extends VisibilityPanelBase {
|
||||
private final JRadioButton myRbPublic;
|
||||
|
||||
public JavaVisibilityPanel(boolean hasAsIs, final boolean hasEscalate) {
|
||||
setBorder(IdeBorderFactory.createTitledBorder(RefactoringBundle.message("visibility.border.title"), false, true, true, new Insets(0,UIUtil.DEFAULT_HGAP,0,0)));
|
||||
setBorder(IdeBorderFactory.createTitledBorder(RefactoringBundle.message("visibility.border.title"), false, true, true,
|
||||
new Insets(IdeBorderFactory.TITLED_BORDER_TOP_INSET,
|
||||
UIUtil.DEFAULT_HGAP,
|
||||
IdeBorderFactory.TITLED_BORDER_BOTTOM_INSET,
|
||||
IdeBorderFactory.TITLED_BORDER_RIGHT_INSET)));
|
||||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
||||
ButtonGroup bg = new ButtonGroup();
|
||||
|
||||
ItemListener listener = new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
if(e.getStateChange() == ItemEvent.SELECTED) {
|
||||
if (e.getStateChange() == ItemEvent.SELECTED) {
|
||||
myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(hasEscalate) {
|
||||
if (hasEscalate) {
|
||||
myRbEscalate = new JRadioButton();
|
||||
myRbEscalate.setText(RefactoringBundle.getEscalateVisibility());
|
||||
myRbEscalate.addItemListener(listener);
|
||||
@@ -65,7 +69,7 @@ public class JavaVisibilityPanel extends VisibilityPanelBase {
|
||||
bg.add(myRbEscalate);
|
||||
}
|
||||
|
||||
if(hasAsIs) {
|
||||
if (hasAsIs) {
|
||||
myRbAsIs = new JRadioButton();
|
||||
myRbAsIs.setText(RefactoringBundle.getVisibilityAsIs());
|
||||
myRbAsIs.addItemListener(listener);
|
||||
@@ -74,7 +78,6 @@ public class JavaVisibilityPanel extends VisibilityPanelBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
myRbPrivate = new JRadioButton();
|
||||
myRbPrivate.setText(RefactoringBundle.getVisibilityPrivate());
|
||||
myRbPrivate.addItemListener(listener);
|
||||
@@ -159,5 +162,4 @@ public class JavaVisibilityPanel extends VisibilityPanelBase {
|
||||
myRbPublic.setEnabled(true);
|
||||
myRbPublic.setSelected(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@ import java.awt.*;
|
||||
|
||||
public class IdeBorderFactory {
|
||||
public static final int BORDER_ROUNDNESS = 5;
|
||||
public static final int TITLED_BORDER_TOP_INSET = 5;
|
||||
public static final int TITLED_BORDER_LEFT_INSET = 0;
|
||||
public static final int TITLED_BORDER_BOTTOM_INSET = 10;
|
||||
public static final int TITLED_BORDER_RIGHT_INSET = 0;
|
||||
public static final int TITLED_BORDER_INDENT = 20;
|
||||
|
||||
private IdeBorderFactory() {
|
||||
}
|
||||
@@ -58,12 +63,12 @@ public class IdeBorderFactory {
|
||||
}
|
||||
|
||||
public static IdeaTitledBorder createTitledBorder(String title, boolean hasBoldFont, boolean hasIndent, boolean hasSmallFont) {
|
||||
Insets insets = new Insets(5, 0, 10, 0);
|
||||
Insets insets = new Insets(TITLED_BORDER_TOP_INSET, TITLED_BORDER_LEFT_INSET, TITLED_BORDER_BOTTOM_INSET, TITLED_BORDER_RIGHT_INSET);
|
||||
return createTitledBorder(title, hasBoldFont, hasIndent, hasSmallFont, insets);
|
||||
}
|
||||
|
||||
public static IdeaTitledBorder createTitledBorder(String title, boolean hasBoldFont, boolean hasIndent, boolean hasSmallFont, Insets insets) {
|
||||
int indent = hasIndent ? 20 : 0;
|
||||
int indent = hasIndent ? TITLED_BORDER_INDENT : 0;
|
||||
return new IdeaTitledBorder(title, hasBoldFont, hasSmallFont, indent, insets);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user