mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UI for copying code style settings from other languages and predefined styles
This commit is contained in:
+1
-10
@@ -19,7 +19,7 @@
|
||||
<color color="-16777216"/>
|
||||
</border>
|
||||
<children>
|
||||
<grid id="3fa8b" layout-manager="GridLayoutManager" row-count="2" column-count="10" same-size-horizontally="false" same-size-vertically="true" hgap="-1" vgap="-1">
|
||||
<grid id="3fa8b" layout-manager="GridLayoutManager" row-count="2" column-count="9" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="4" right="0"/>
|
||||
<constraints/>
|
||||
<properties/>
|
||||
@@ -103,15 +103,6 @@
|
||||
<text value="Copy to Project"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e501" class="javax.swing.JButton" binding="myPredefinedButton">
|
||||
<constraints>
|
||||
<grid row="1" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="false"/>
|
||||
<text value="Predefined..."/>
|
||||
</properties>
|
||||
</component>
|
||||
<hspacer id="6f6d">
|
||||
<constraints>
|
||||
<grid row="1" column="8" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
|
||||
+1
-23
@@ -50,7 +50,6 @@ public class CodeStyleSchemesPanel{
|
||||
private JPanel myPanel;
|
||||
private JButton myExportAsGlobalButton;
|
||||
private JButton myCopyToProjectButton;
|
||||
public JButton myPredefinedButton;
|
||||
private JBScrollPane myJBScrollPane;
|
||||
private boolean myIsReset = false;
|
||||
private NewCodeStyleSettingsPanel mySettingsPanel;
|
||||
@@ -153,14 +152,6 @@ public class CodeStyleSchemesPanel{
|
||||
}
|
||||
});
|
||||
|
||||
myPredefinedButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
selectPredefinedStyle();
|
||||
}
|
||||
});
|
||||
|
||||
myJBScrollPane.setBorder(null);
|
||||
}
|
||||
|
||||
@@ -321,18 +312,5 @@ public class CodeStyleSchemesPanel{
|
||||
mySettingsPanel = settingsPanel;
|
||||
}
|
||||
|
||||
public void setPredefinedEnabled(boolean isEnabled) {
|
||||
myPredefinedButton.setEnabled(isEnabled);
|
||||
}
|
||||
|
||||
private void selectPredefinedStyle() {
|
||||
Language selectedLanguage = mySettingsPanel.getSelectedLanguage();
|
||||
if (selectedLanguage == null) return;
|
||||
PredefinedCodeStylesDialog dialog = new PredefinedCodeStylesDialog(myPredefinedButton, selectedLanguage);
|
||||
dialog.show();
|
||||
if (dialog.isOK()) {
|
||||
PredefinedCodeStyle codeStyle = dialog.getSelectedStyle();
|
||||
if (codeStyle != null) mySettingsPanel.applyPredefinedSettings(codeStyle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user