mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-198364 Add keys: disabled separator
This commit is contained in:
@@ -21,6 +21,9 @@ public class TitledSeparator extends JPanel {
|
||||
public static final int SEPARATOR_LEFT_INSET = 6;
|
||||
public static final int SEPARATOR_RIGHT_INSET = 3;
|
||||
|
||||
private static final Color ENABLED_SEPARATOR_FOREGROUND = JBColor.namedColor("Group.separatorColor", new JBColor(Gray.xCD, Gray.x51));
|
||||
private static final Color DISABLED_SEPARATOR_FOREGROUND = JBColor.namedColor("Group.disabledSeparatorColor", ENABLED_SEPARATOR_FOREGROUND);
|
||||
|
||||
@NotNull
|
||||
public static Border createEmptyBorder() {
|
||||
return JBUI.Borders.empty(TOP_INSET, 0, BOTTOM_INSET, 0);
|
||||
@@ -44,7 +47,7 @@ public class TitledSeparator extends JPanel {
|
||||
}
|
||||
|
||||
public TitledSeparator(String text, @Nullable JComponent labelFor) {
|
||||
mySeparator.setForeground(JBColor.namedColor("Group.separatorColor", new JBColor(Gray.xCD, Gray.x51)));
|
||||
mySeparator.setForeground(ENABLED_SEPARATOR_FOREGROUND);
|
||||
|
||||
setLayout(new GridBagLayout());
|
||||
add(myLabel, new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.emptyInsets(), 0, 0));
|
||||
@@ -95,5 +98,7 @@ public class TitledSeparator extends JPanel {
|
||||
super.setEnabled(enabled);
|
||||
myLabel.setEnabled(enabled);
|
||||
mySeparator.setEnabled(enabled);
|
||||
|
||||
mySeparator.setForeground(enabled ? ENABLED_SEPARATOR_FOREGROUND : DISABLED_SEPARATOR_FOREGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<grid id="715a5" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="36" y="27" width="677" height="735"/>
|
||||
<xy x="36" y="27" width="918" height="735"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -210,7 +210,7 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="ba5e7" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="0">
|
||||
<grid id="ba5e7" binding="myRelativeLocationPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="0">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
|
||||
@@ -66,6 +66,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
private JLabel lblLengthBefore;
|
||||
private JLabel lblLengthAfter;
|
||||
private JLabel mySeparatorCharLabel;
|
||||
private JPanel myRelativeLocationPanel;
|
||||
|
||||
|
||||
private void updateBox() {
|
||||
@@ -274,6 +275,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
case LanguageOptions.NO_COPYRIGHT:
|
||||
enableFormattingOptions(false);
|
||||
showPreview(getOptions());
|
||||
myRelativeLocationPanel.setEnabled(false);
|
||||
rbBefore.setEnabled(false);
|
||||
rbAfter.setEnabled(false);
|
||||
cbAddBlank.setEnabled(false);
|
||||
@@ -287,6 +289,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
final boolean isTemplate = parentPanel == null;
|
||||
enableFormattingOptions(isTemplate);
|
||||
showPreview(parentOpts != null ? parentOpts : getOptions());
|
||||
myRelativeLocationPanel.setEnabled(isTemplate);
|
||||
rbBefore.setEnabled(isTemplate);
|
||||
rbAfter.setEnabled(isTemplate);
|
||||
cbAddBlank.setEnabled(isTemplate);
|
||||
@@ -299,6 +302,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
case LanguageOptions.USE_TEXT:
|
||||
enableFormattingOptions(true);
|
||||
showPreview(getOptions());
|
||||
myRelativeLocationPanel.setEnabled(true);
|
||||
rbBefore.setEnabled(true);
|
||||
rbAfter.setEnabled(true);
|
||||
cbAddBlank.setEnabled(true);
|
||||
@@ -313,6 +317,8 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
|
||||
private void enableFormattingOptions(boolean enable) {
|
||||
if (enable) {
|
||||
myCommentTypePanel.setEnabled(true);
|
||||
myBorderPanel.setEnabled(true);
|
||||
rbBlockComment.setEnabled(true);
|
||||
rbLineComment.setEnabled(true);
|
||||
cbPrefixLines.setEnabled(allowBlock);
|
||||
|
||||
Reference in New Issue
Block a user