mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
@override
This commit is contained in:
@@ -30,44 +30,54 @@ import javax.swing.*;
|
||||
public class CodeCompletionOptions extends BaseConfigurable implements SearchableConfigurable, EditorOptionsProvider, Configurable.NoScroll {
|
||||
private CodeCompletionPanel myPanel;
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myPanel != null && myPanel.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myPanel = new CodeCompletionPanel();
|
||||
return myPanel.myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("title.code.completion");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return IconLoader.getIcon("/general/configurableCodeCompletion.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
myPanel.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
myPanel.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
myPanel = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.code.completion";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.completion";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Runnable enableSearch(String option) {
|
||||
return null;
|
||||
|
||||
@@ -62,6 +62,7 @@ public class CodeCompletionPanel {
|
||||
|
||||
myCbAutocompletion.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
myAutocompletionDelayField.setEnabled(myCbAutocompletion.isSelected());
|
||||
}
|
||||
@@ -70,6 +71,7 @@ public class CodeCompletionPanel {
|
||||
|
||||
myCbAutopopupJavaDoc.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
myAutopopupJavaDocField.setEnabled(myCbAutopopupJavaDoc.isSelected());
|
||||
}
|
||||
@@ -78,6 +80,7 @@ public class CodeCompletionPanel {
|
||||
|
||||
myCbParameterInfoPopup.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
myParameterInfoDelayField.setEnabled(myCbParameterInfoPopup.isSelected());
|
||||
}
|
||||
|
||||
+7
@@ -39,14 +39,17 @@ public abstract class CodeStyleAbstractConfigurable implements Configurable, Opt
|
||||
myDisplayName = displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return myDisplayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myPanel = createPanel(myCloneSettings);
|
||||
myPanel.setModel(myModel);
|
||||
@@ -55,12 +58,14 @@ public abstract class CodeStyleAbstractConfigurable implements Configurable, Opt
|
||||
|
||||
protected abstract CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings);
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
if (myPanel != null) {
|
||||
myPanel.apply(mySettings);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (myPanel != null) {
|
||||
myPanel.reset(mySettings);
|
||||
@@ -73,10 +78,12 @@ public abstract class CodeStyleAbstractConfigurable implements Configurable, Opt
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myPanel != null && myPanel.isModified(mySettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
if (myPanel != null) {
|
||||
Disposer.dispose(myPanel);
|
||||
|
||||
@@ -105,6 +105,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
myUpdateAlarm.setActivationComponent(myEditor.getComponent());
|
||||
}
|
||||
myUserActivityWatcher.addUserActivityListener(new UserActivityListener() {
|
||||
@Override
|
||||
public void stateChanged() {
|
||||
somethingChanged();
|
||||
}
|
||||
@@ -183,6 +184,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
|
||||
final Project finalProject = ProjectUtil.guessCurrentProject(getPanel());
|
||||
CommandProcessor.getInstance().executeCommand(finalProject, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
replaceText(finalProject);
|
||||
}
|
||||
@@ -202,6 +204,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
|
||||
private void replaceText(final Project project) {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Document beforeReformat = null;
|
||||
@@ -412,6 +415,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
@Nullable
|
||||
public abstract JComponent getPanel();
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
myUpdateAlarm.cancelAllRequests();
|
||||
if (myEditor != null) {
|
||||
@@ -468,6 +472,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
setSomethingChanged(true);
|
||||
if (myEditor != null) {
|
||||
UiNotifyConnector.doWhenFirstShown(myEditor.getComponent(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
addUpdatePreviewRequest();
|
||||
}
|
||||
@@ -477,6 +482,7 @@ public abstract class CodeStyleAbstractPanel implements Disposable {
|
||||
|
||||
private void addUpdatePreviewRequest() {
|
||||
myUpdateAlarm.addComponentRequest(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
myUpdateAlarm.cancelAllRequests();
|
||||
|
||||
+23
@@ -52,6 +52,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
myLangSelector = new LanguageSelector();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myModel = ensureModel();
|
||||
|
||||
@@ -201,6 +202,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Configurable[] buildConfigurables() {
|
||||
myPanels = new ArrayList<CodeStyleConfigurableWrapper>();
|
||||
|
||||
@@ -223,6 +225,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
for (final CodeStyleSettingsProvider provider : providers) {
|
||||
if (provider.hasSettingsPage()) {
|
||||
myPanels.add(new CodeStyleConfigurableWrapper(provider, new CodeStyleSettingsPanelFactory() {
|
||||
@Override
|
||||
public NewCodeStyleSettingsPanel createPanel(final CodeStyleScheme scheme) {
|
||||
return new NewCodeStyleSettingsPanel(provider.createSettingsPage(scheme.getCodeStyleSettings(), ensureModel().getCloneSettings(scheme)));
|
||||
}
|
||||
@@ -239,24 +242,29 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
myRootSchemesPanel = new CodeStyleSchemesPanel(myModel);
|
||||
|
||||
myModel.addListener(new CodeStyleSettingsListener(){
|
||||
@Override
|
||||
public void currentSchemeChanged(final Object source) {
|
||||
if (source != myRootSchemesPanel) {
|
||||
myRootSchemesPanel.onSelectedSchemeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schemeListChanged() {
|
||||
myRootSchemesPanel.resetSchemesCombo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void currentSettingsChanged() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void usePerProjectSettingsOptionChanged() {
|
||||
myRootSchemesPanel.usePerProjectSettingsOptionChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schemeChanged(final CodeStyleScheme scheme) {
|
||||
//do nothing
|
||||
}
|
||||
@@ -265,14 +273,17 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return myModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return "Code Style";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return IconLoader.getIcon("/general/configurableCodeStyle.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle";
|
||||
}
|
||||
@@ -282,6 +293,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
//getActivePanel().selectTab(pageToSelect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
if (myModel != null) {
|
||||
boolean schemeListModified = myModel.isSchemeListModified();
|
||||
@@ -295,6 +307,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "preferences.sourceCode";
|
||||
@@ -321,6 +334,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
myInitialResetInvoked = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
String displayName = myProvider.getConfigurableDisplayName();
|
||||
@@ -329,10 +343,12 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return ensurePanel().getDisplayName(); // fallback for 8.0 API compatibility
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return ensurePanel().getHelpTopic();
|
||||
}
|
||||
@@ -344,10 +360,12 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
return ensurePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
boolean someSchemeModified = ensurePanel().isModified();
|
||||
if (someSchemeModified) {
|
||||
@@ -357,6 +375,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
return someSchemeModified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
CodeStyleSchemesConfigurable.this.apply();
|
||||
}
|
||||
@@ -367,6 +386,7 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (!myInitialResetInvoked) {
|
||||
try {
|
||||
@@ -382,15 +402,18 @@ public class CodeStyleSchemesConfigurable extends SearchableConfigurable.Parent.
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "preferences.sourceCode." + getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
if (myPanel != null) {
|
||||
myPanel.disposeUIResources();
|
||||
|
||||
@@ -28,11 +28,13 @@ public class CodeStyleSettingsUtilImpl extends CodeStyleSettingsUtil {
|
||||
* @param project
|
||||
* @return Returns true if settings were modified during editing session.
|
||||
*/
|
||||
@Override
|
||||
public boolean showCodeStyleSettings(Project project, final Class pageToSelect) {
|
||||
CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(project);
|
||||
CodeStyleSettings savedSettings = settingsManager.getCurrentSettings().clone();
|
||||
final CodeStyleSchemesConfigurable configurable = new CodeStyleSchemesConfigurable(project);
|
||||
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (pageToSelect != null) {
|
||||
configurable.selectPage(pageToSelect);
|
||||
|
||||
@@ -88,6 +88,7 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
|
||||
myRightMargin = settings.RIGHT_MARGIN;
|
||||
|
||||
myRightMarginField.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(final DocumentEvent e) {
|
||||
int valueFromControl = getRightMarginImpl();
|
||||
if (valueFromControl > 0) {
|
||||
@@ -106,25 +107,30 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void somethingChanged() {
|
||||
super.somethingChanged();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getRightMargin() {
|
||||
return myRightMargin;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected FileType getFileType() {
|
||||
return FileTypes.PLAIN_TEXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPreviewText() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void apply(CodeStyleSettings settings) {
|
||||
settings.LINE_SEPARATOR = getSelectedLineSeparator();
|
||||
|
||||
@@ -163,6 +169,7 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isModified(CodeStyleSettings settings) {
|
||||
if (!Comparing.equal(getSelectedLineSeparator(), settings.LINE_SEPARATOR)) {
|
||||
return true;
|
||||
@@ -177,10 +184,12 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
|
||||
return myIndentOptionsEditor.isModified(settings, settings.OTHER_INDENT_OPTIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPanel() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resetImpl(final CodeStyleSettings settings) {
|
||||
|
||||
String lineSeparator = settings.LINE_SEPARATOR;
|
||||
@@ -203,11 +212,13 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
|
||||
myIndentOptionsEditor.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EditorHighlighter createHighlighter(final EditorColorsScheme scheme) {
|
||||
//noinspection NullableProblems
|
||||
return EditorHighlighterFactory.getInstance().createEditorHighlighter(getFileType(), scheme, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void prepareForReformat(final PsiFile psiFile) {
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -30,17 +30,21 @@ import javax.swing.*;
|
||||
* @author yole
|
||||
*/
|
||||
public class GeneralCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
||||
@Override
|
||||
@NotNull
|
||||
public Configurable createSettingsPage(CodeStyleSettings settings, CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleAbstractConfigurable(settings, originalSettings, ApplicationBundle.message("title.general")) {
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
|
||||
return new GeneralCodeStylePanel(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return FileTypes.PLAIN_TEXT.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle.general";
|
||||
}
|
||||
|
||||
+1
@@ -276,6 +276,7 @@ public class InitialConfigurationDialog extends DialogWrapper {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
return myMainPanel;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void somethingChanged() {
|
||||
super.somethingChanged();
|
||||
update();
|
||||
@@ -136,6 +137,7 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
myIndentOptionsTabs.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(final ChangeEvent e) {
|
||||
final int selIndex = myIndentOptionsTabs.getSelectedIndex();
|
||||
if (selIndex != myLastSelectedTab) {
|
||||
@@ -162,10 +164,12 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getRightMargin() {
|
||||
return myRightMargin;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected FileType getFileType() {
|
||||
FileTypeIndentOptionsProvider provider = getSelectedIndentProvider();
|
||||
@@ -173,6 +177,7 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
return provider.getFileType();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPreviewText() {
|
||||
final FileTypeIndentOptionsProvider provider = getSelectedIndentProvider();
|
||||
if (provider != null) return provider.getPreviewText();
|
||||
@@ -195,6 +200,7 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
return providers.length == 0 ? null : providers[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(CodeStyleSettings settings) {
|
||||
settings.USE_SAME_INDENTS = myCbUseSameIndents.isSelected();
|
||||
if (!settings.USE_SAME_INDENTS) {
|
||||
@@ -212,6 +218,7 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isModified(CodeStyleSettings settings) {
|
||||
if (myCbUseSameIndents.isSelected() != settings.USE_SAME_INDENTS) {
|
||||
return true;
|
||||
@@ -232,10 +239,12 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPanel() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resetImpl(final CodeStyleSettings settings) {
|
||||
myCbUseSameIndents.setSelected(settings.USE_SAME_INDENTS);
|
||||
|
||||
@@ -251,11 +260,13 @@ public class OtherTabsAndIndentsPanel extends CodeStyleAbstractPanel {
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EditorHighlighter createHighlighter(final EditorColorsScheme scheme) {
|
||||
//noinspection NullableProblems
|
||||
return EditorHighlighterFactory.getInstance().createEditorHighlighter(getFileType(), scheme, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void prepareForReformat(final PsiFile psiFile) {
|
||||
final FileTypeIndentOptionsProvider provider = getSelectedIndentProvider();
|
||||
if (provider != null) {
|
||||
|
||||
+4
@@ -32,17 +32,21 @@ import javax.swing.*;
|
||||
* @author yole
|
||||
*/
|
||||
public class OtherTabsAndIndentsProvider extends CodeStyleSettingsProvider {
|
||||
@Override
|
||||
@NotNull
|
||||
public Configurable createSettingsPage(CodeStyleSettings settings, CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleAbstractConfigurable(settings, originalSettings, ApplicationBundle.message("title.other.tabs.and.indents")) {
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
|
||||
return new OtherTabsAndIndentsPanel(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return FileTypes.PLAIN_TEXT.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle.general";
|
||||
}
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class BlankLinesSettingsProvider extends CodeStyleSettingsProvider {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleBlankLinesConfigurable(settings, originalSettings);
|
||||
|
||||
+3
@@ -28,14 +28,17 @@ public class CodeStyleBlankLinesConfigurable extends CodeStyleAbstractConfigurab
|
||||
super(settings, cloneSettings, ApplicationBundle.message("title.blank.lines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
|
||||
return new CodeStyleBlankLinesPanel(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return StdFileTypes.JAVA.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle.blanklines";
|
||||
}
|
||||
|
||||
+7
@@ -167,18 +167,21 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
myOptions.add(option);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resetImpl(final CodeStyleSettings settings) {
|
||||
for (IntOption option : myOptions) {
|
||||
option.setValue(option.getFieldValue(settings));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(CodeStyleSettings settings) {
|
||||
for (IntOption option : myOptions) {
|
||||
option.setFieldValue(settings, option.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified(CodeStyleSettings settings) {
|
||||
for (IntOption option : myOptions) {
|
||||
if (option.getFieldValue(settings) != option.getValue()) {
|
||||
@@ -188,10 +191,12 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPanel() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showAllStandardOptions() {
|
||||
myAllOptionsAllowed = true;
|
||||
for (IntOption option : myOptions) {
|
||||
@@ -199,6 +204,7 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showStandardOptions(String... optionNames) {
|
||||
if (myIsFirstUpdate) {
|
||||
Collections.addAll(myAllowedOptions, optionNames);
|
||||
@@ -222,6 +228,7 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
showCustomOption(settingsClass, fieldName, title, groupName, null, null, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCustomOption(Class<? extends CustomCodeStyleSettings> settingsClass,
|
||||
String fieldName,
|
||||
String title,
|
||||
|
||||
+8
@@ -61,6 +61,7 @@ public class CodeStyleMainPanel extends JPanel implements LanguageSelectorListen
|
||||
myLangSelector = langSelector;
|
||||
|
||||
model.addListener(new CodeStyleSettingsListener(){
|
||||
@Override
|
||||
public void currentSchemeChanged(final Object source) {
|
||||
if (source != mySchemesPanel) {
|
||||
mySchemesPanel.onSelectedSchemeChanged();
|
||||
@@ -68,18 +69,22 @@ public class CodeStyleMainPanel extends JPanel implements LanguageSelectorListen
|
||||
onCurrentSchemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schemeListChanged() {
|
||||
mySchemesPanel.resetSchemesCombo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void currentSettingsChanged() {
|
||||
ensureCurrentPanel().onSomethingChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void usePerProjectSettingsOptionChanged() {
|
||||
mySchemesPanel.usePerProjectSettingsOptionChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schemeChanged(final CodeStyleScheme scheme) {
|
||||
ensurePanel(scheme).reset();
|
||||
}
|
||||
@@ -118,6 +123,7 @@ public class CodeStyleMainPanel extends JPanel implements LanguageSelectorListen
|
||||
public void onCurrentSchemeChanged() {
|
||||
myLayout.show(mySettingsPanel, WAIT_CARD);
|
||||
final Runnable replaceLayout = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!myIsDisposed) {
|
||||
ensureCurrentPanel().onSomethingChanged();
|
||||
@@ -133,6 +139,7 @@ public class CodeStyleMainPanel extends JPanel implements LanguageSelectorListen
|
||||
} else {
|
||||
myAlarm.cancelAllRequests();
|
||||
final Runnable request = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SwingUtilities.invokeLater(replaceLayout);
|
||||
}
|
||||
@@ -244,6 +251,7 @@ public class CodeStyleMainPanel extends JPanel implements LanguageSelectorListen
|
||||
return mySettingsPanels.get(scheme.getName()).isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void languageChanged(Language lang) {
|
||||
for (NewCodeStyleSettingsPanel panel : mySettingsPanels.values()) {
|
||||
panel.setLanguage(lang);
|
||||
|
||||
+2
@@ -48,9 +48,11 @@ public class CodeStyleSchemesPanel{
|
||||
myDefaultComboFont = myCombo.getFont();
|
||||
myBoldComboFont = myDefaultComboFont.deriveFont(Font.BOLD);
|
||||
myCombo.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (!myIsReset) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
onCombo();
|
||||
}
|
||||
|
||||
+3
@@ -28,14 +28,17 @@ public class CodeStyleSpacesConfigurable extends CodeStyleAbstractConfigurable {
|
||||
super(settings, cloneSettings, ApplicationBundle.message("title.spaces"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return StdFileTypes.JAVA.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
|
||||
return new CodeStyleSpacesPanel(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle.spaces";
|
||||
}
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ public class CodeStyleSpacesPanel extends OptionTreeWithPreviewPanel {
|
||||
return LanguageCodeStyleSettingsProvider.SettingsType.SPACING_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTables() {
|
||||
initBooleanField("SPACE_BEFORE_METHOD_PARENTHESES", ApplicationBundle.message("checkbox.spaces.method.declaration.parentheses"), SPACES_BEFORE_PARENTHESES);
|
||||
initBooleanField("SPACE_BEFORE_METHOD_CALL_PARENTHESES", ApplicationBundle.message("checkbox.spaces.method.call.parentheses"), SPACES_BEFORE_PARENTHESES);
|
||||
|
||||
+3
@@ -103,6 +103,7 @@ public class ManageCodeStyleSchemesDialog extends DialogWrapper {
|
||||
if (schemesManager.isExportAvailable()) {
|
||||
myExportButton.setVisible(true);
|
||||
myExportButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
CodeStyleScheme selected = getSelectedScheme();
|
||||
ExportSchemeAction.doExport((CodeStyleSchemeImpl)selected, schemesManager);
|
||||
@@ -117,9 +118,11 @@ public class ManageCodeStyleSchemesDialog extends DialogWrapper {
|
||||
if (schemesManager.isImportAvailable()) {
|
||||
myImportButton.setVisible(true);
|
||||
myImportButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
SchemesToImportPopup<CodeStyleScheme, CodeStyleSchemeImpl> popup =
|
||||
new SchemesToImportPopup<CodeStyleScheme, CodeStyleSchemeImpl>(parent) {
|
||||
@Override
|
||||
protected void onSchemeSelected(final CodeStyleSchemeImpl scheme) {
|
||||
if (scheme != null) {
|
||||
myModel.addScheme(scheme, true);
|
||||
|
||||
+8
@@ -84,6 +84,7 @@ public abstract class MultilanguageCodeStyleAbstractPanel extends CodeStyleAbstr
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setPanelLanguage(Language language) {
|
||||
|
||||
boolean languageProviderFound = false;
|
||||
@@ -167,6 +168,7 @@ public abstract class MultilanguageCodeStyleAbstractPanel extends CodeStyleAbstr
|
||||
return StdFileTypes.JAVA;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected EditorHighlighter createHighlighter(final EditorColorsScheme scheme) {
|
||||
FileType fileType = getFileType();
|
||||
@@ -181,8 +183,10 @@ public abstract class MultilanguageCodeStyleAbstractPanel extends CodeStyleAbstr
|
||||
final PsiDocumentManager manager = PsiDocumentManager.getInstance(project);
|
||||
final Document doc = manager.getDocument(psiFile);
|
||||
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doc.replaceString(0, doc.getTextLength(), text);
|
||||
manager.commitDocument(doc);
|
||||
@@ -228,20 +232,24 @@ public abstract class MultilanguageCodeStyleAbstractPanel extends CodeStyleAbstr
|
||||
updatePreview(true);
|
||||
}
|
||||
tabbedPane.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
onTabSelection((JTabbedPane)e.getSource());
|
||||
}
|
||||
});
|
||||
previewPanel.add(tabbedPane, BorderLayout.CENTER);
|
||||
previewPanel.addAncestorListener(new AncestorListener() {
|
||||
@Override
|
||||
public void ancestorAdded(AncestorEvent event) {
|
||||
selectCurrentLanguageTab();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ancestorRemoved(AncestorEvent event) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ancestorMoved(AncestorEvent event) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
+22
@@ -211,6 +211,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
|
||||
ListTreeTableModel model = new ListTreeTableModel(rootNode, COLUMNS);
|
||||
TreeTable treeTable = new TreeTable(model) {
|
||||
@Override
|
||||
public TreeTableCellRenderer createTableRenderer(TreeTableModel treeTableModel) {
|
||||
TreeTableCellRenderer tableRenderer = super.createTableRenderer(treeTableModel);
|
||||
UIUtil.setLineStyleAngled(tableRenderer);
|
||||
@@ -220,6 +221,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return tableRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableCellRenderer getCellRenderer(int row, int column) {
|
||||
TreePath treePath = getTree().getPathForRow(row);
|
||||
if (treePath == null) return super.getCellRenderer(row, column);
|
||||
@@ -230,6 +232,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return renderer == null ? super.getCellRenderer(row, column) : renderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableCellEditor getCellEditor(int row, int column) {
|
||||
TreePath treePath = getTree().getPathForRow(row);
|
||||
if (treePath == null) return super.getCellEditor(row, column);
|
||||
@@ -397,6 +400,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
super(clazz, fieldName, title, groupName, anchor, anchorFiledName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(CodeStyleSettings settings) {
|
||||
try {
|
||||
return field.getBoolean(getSettings(settings)) ? Boolean.TRUE : Boolean.FALSE;
|
||||
@@ -406,6 +410,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object value, CodeStyleSettings settings) {
|
||||
try {
|
||||
field.setBoolean(getSettings(settings), ((Boolean)value).booleanValue());
|
||||
@@ -445,6 +450,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object value, CodeStyleSettings settings) {
|
||||
try {
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
@@ -461,6 +467,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
|
||||
@SuppressWarnings({"HardCodedStringLiteral"})
|
||||
public final ColumnInfo TITLE = new ColumnInfo("TITLE") {
|
||||
@Override
|
||||
public Object valueOf(Object o) {
|
||||
if (o instanceof MyTreeNode) {
|
||||
MyTreeNode node = (MyTreeNode)o;
|
||||
@@ -469,6 +476,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getColumnClass() {
|
||||
return TreeTableModel.class;
|
||||
}
|
||||
@@ -479,6 +487,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
private final TableCellEditor myEditor = new MyValueEditor();
|
||||
private final TableCellRenderer myRenderer = new MyValueRenderer();
|
||||
|
||||
@Override
|
||||
public Object valueOf(Object o) {
|
||||
if (o instanceof MyTreeNode) {
|
||||
MyTreeNode node = (MyTreeNode)o;
|
||||
@@ -488,18 +497,22 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableCellRenderer getRenderer(Object o) {
|
||||
return myRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableCellEditor getEditor(Object item) {
|
||||
return myEditor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(Object o) {
|
||||
return (o instanceof MyTreeNode) && (((MyTreeNode)o).isEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object o, Object o1) {
|
||||
MyTreeNode node = (MyTreeNode)o;
|
||||
node.setValue(o1);
|
||||
@@ -511,6 +524,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
private final TreeCellRenderer myTitleRenderer = new TreeCellRenderer() {
|
||||
private final JLabel myLabel = new JLabel();
|
||||
|
||||
@Override
|
||||
public Component getTreeCellRendererComponent(JTree tree,
|
||||
Object value,
|
||||
boolean selected,
|
||||
@@ -586,6 +600,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
private final JCheckBox myCheckBox = new JCheckBox();
|
||||
private final JPanel myEmptyLabel = new JPanel();
|
||||
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
@@ -636,6 +651,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
|
||||
public MyValueEditor() {
|
||||
final ActionListener itemChoosen = new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myCurrentNode != null) {
|
||||
myCurrentNode.setValue(getCellEditorValue());
|
||||
@@ -649,6 +665,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
myOptionsEditor.putClientProperty("JComponent.sizeVariant", "small");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCellEditorValue() {
|
||||
if (myCurrentEditor == myOptionsEditor) {
|
||||
//new Alarm(Alarm.ThreadToUse.SWING_THREAD).addRequest(new Runnable() {
|
||||
@@ -666,6 +683,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
|
||||
final DefaultMutableTreeNode defaultNode = (DefaultMutableTreeNode)((TreeTable)table).getTree().
|
||||
getPathForRow(row).getLastPathComponent();
|
||||
@@ -693,12 +711,14 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myTreeTable.getTree().getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
applyNode(root, settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified(CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myTreeTable.getTree().getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
@@ -708,10 +728,12 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPanel() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resetImpl(final CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myTreeTable.getTree().getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
|
||||
+9
@@ -93,11 +93,13 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
updateOptionsTree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showAllStandardOptions() {
|
||||
myShowAllStandardOptions = true;
|
||||
updateOptions(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showStandardOptions(String... optionNames) {
|
||||
if (isFirstUpdate) {
|
||||
Collections.addAll(myAllowedOptions, optionNames);
|
||||
@@ -197,6 +199,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
|
||||
optionsTree.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (!optionsTree.isEnabled()) return;
|
||||
if (e.getKeyCode() == KeyEvent.VK_SPACE) {
|
||||
@@ -208,6 +211,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
});
|
||||
|
||||
optionsTree.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (!optionsTree.isEnabled()) return;
|
||||
TreePath treePath = optionsTree.getPathForLocation(e.getX(), e.getY());
|
||||
@@ -243,6 +247,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
protected abstract void initTables();
|
||||
|
||||
@Override
|
||||
protected void resetImpl(final CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myOptionsTree.getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
@@ -274,6 +279,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myOptionsTree.getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
@@ -296,6 +302,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
key.setValue(settings, childNode.isSelected() ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified(CodeStyleSettings settings) {
|
||||
TreeModel treeModel = myOptionsTree.getModel();
|
||||
TreeNode root = (TreeNode)treeModel.getRoot();
|
||||
@@ -390,6 +397,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
myCheckBox.setMargin(new Insets(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean isSelected, boolean expanded,
|
||||
boolean leaf, int row, boolean hasFocus) {
|
||||
if (value instanceof MyToggleTreeNode) {
|
||||
@@ -567,6 +575,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPanel() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @author yole
|
||||
*/
|
||||
public class SpacesSettingsProvider extends CodeStyleSettingsProvider {
|
||||
@Override
|
||||
@NotNull
|
||||
public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleSpacesConfigurable(settings, originalSettings);
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ public class WrappingAndBracesPanel extends OptionTableWithPreviewPanel {
|
||||
return LanguageCodeStyleSettingsProvider.SettingsType.WRAPPING_AND_BRACES_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTables() {
|
||||
addOption("KEEP_LINE_BREAKS", ApplicationBundle.message("wrapping.keep.line.breaks"), WRAPPING_KEEP);
|
||||
addOption("KEEP_FIRST_COLUMN_COMMENT", ApplicationBundle.message("wrapping.keep.comment.at.first.column"), WRAPPING_KEEP);
|
||||
|
||||
+4
@@ -29,17 +29,21 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
|
||||
public class WrappingAndBracesSettingsProvider extends CodeStyleSettingsProvider {
|
||||
@Override
|
||||
@NotNull
|
||||
public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleAbstractConfigurable(settings, originalSettings, ApplicationBundle.message("wrapping.and.braces")) {
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return StdFileTypes.JAVA.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
|
||||
return new WrappingAndBracesPanel(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.globalcodestyle.wrap";
|
||||
}
|
||||
|
||||
@@ -50,12 +50,14 @@ public class ClickNavigator {
|
||||
|
||||
public void addClickNavigatorToGeneralView(final Editor view) {
|
||||
view.getContentComponent().addMouseMotionListener(new MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
EditorUtil.setHandCursor(view);
|
||||
}
|
||||
});
|
||||
|
||||
CaretListener listener = new CaretListener() {
|
||||
@Override
|
||||
public void caretPositionChanged(CaretEvent e) {
|
||||
setSelectedItem(HighlighterColors.TEXT.getExternalName(), true);
|
||||
}
|
||||
@@ -97,6 +99,7 @@ public class ClickNavigator {
|
||||
addMouseMotionListener(view, highlighter, data, isBackgroundImportant);
|
||||
|
||||
CaretListener listener = new CaretListener() {
|
||||
@Override
|
||||
public void caretPositionChanged(CaretEvent e) {
|
||||
navigate(view, true, e.getNewPosition(), highlighter, data, isBackgroundImportant);
|
||||
}
|
||||
@@ -128,6 +131,7 @@ public class ClickNavigator {
|
||||
final SyntaxHighlighter highlighter,
|
||||
final HighlightData[] data, final boolean isBackgroundImportant) {
|
||||
view.getContentComponent().addMouseMotionListener(new MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
LogicalPosition pos = view.xyToLogicalPosition(new Point(e.getX(), e.getY()));
|
||||
navigate(view, false, pos, highlighter, data, isBackgroundImportant);
|
||||
|
||||
+11
@@ -48,14 +48,17 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return myType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EditorColorsScheme getScheme() {
|
||||
return myScheme;
|
||||
}
|
||||
@@ -100,6 +103,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
|
||||
public abstract void setExternalEffectType(EffectType type);
|
||||
|
||||
@Override
|
||||
public final void setForegroundColor(Color col) {
|
||||
super.setForegroundColor(col);
|
||||
if (isForegroundChecked) {
|
||||
@@ -109,6 +113,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setBackgroundColor(Color col) {
|
||||
super.setBackgroundColor(col);
|
||||
if (isBackgroundChecked) {
|
||||
@@ -118,6 +123,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorStripeColor(Color color) {
|
||||
super.setErrorStripeColor(color);
|
||||
if (isErrorStripeChecked) {
|
||||
@@ -128,6 +134,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setEffectColor(Color col) {
|
||||
super.setEffectColor(col);
|
||||
if (isEffectsColorChecked) {
|
||||
@@ -137,6 +144,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setEffectType(EffectType effectType) {
|
||||
super.setEffectType(effectType);
|
||||
setExternalEffectType(effectType);
|
||||
@@ -179,8 +187,10 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
setEffectType(getEffectType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract int getFontType();
|
||||
|
||||
@Override
|
||||
public abstract void setFontType(int type);
|
||||
|
||||
public boolean isFontEnabled() {
|
||||
@@ -203,6 +213,7 @@ public abstract class ColorAndFontDescription extends TextAttributes implements
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return false;
|
||||
}
|
||||
|
||||
+11
@@ -114,6 +114,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
panel.add(new TailPanel(), gbConstraints);
|
||||
|
||||
myCbBold.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -121,6 +122,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
}
|
||||
});
|
||||
myCbItalic.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -188,6 +190,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myEffectsColorChooser.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -198,6 +201,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myForegroundChooser.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -208,6 +212,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myCbForeground.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
myForegroundChooser.setEnabled(myCbForeground.isSelected());
|
||||
if (myActionListener != null) {
|
||||
@@ -219,6 +224,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myBackgroundChooser.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -228,6 +234,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
);
|
||||
myErrorStripeColorChooser.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (myActionListener != null) {
|
||||
myActionListener.actionPerformed(e);
|
||||
@@ -238,6 +245,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myCbBackground.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
myBackgroundChooser.setEnabled(myCbBackground.isSelected());
|
||||
if (myActionListener != null) {
|
||||
@@ -248,6 +256,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
);
|
||||
myCbErrorStripe.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
myErrorStripeColorChooser.setEnabled(myCbErrorStripe.isSelected());
|
||||
if (myActionListener != null) {
|
||||
@@ -260,6 +269,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
|
||||
myCbEffects.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
boolean checked = myCbEffects.isSelected();
|
||||
myEffectsColorChooser.setEnabled(checked);
|
||||
@@ -272,6 +282,7 @@ public class ColorAndFontDescriptionPanel extends JPanel {
|
||||
);
|
||||
|
||||
myEffectsCombo.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (!updatingEffects) {
|
||||
if (myActionListener != null) {
|
||||
|
||||
+64
@@ -93,6 +93,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
private final Disposable myDisposable = Disposer.newDisposable();
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.application.options.colors.ColorAndFontOptions");
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
boolean listModified = isSchemeListModified();
|
||||
boolean schemeModified = isSomeSchemeModified();
|
||||
@@ -151,6 +152,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
public String[] getSchemeNames() {
|
||||
ArrayList<MyColorScheme> schemes = new ArrayList<MyColorScheme>(mySchemes.values());
|
||||
Collections.sort(schemes, new Comparator<MyColorScheme>() {
|
||||
@Override
|
||||
public int compare(MyColorScheme o1, MyColorScheme o2) {
|
||||
if (isReadOnly(o1) && !isReadOnly(o2)) return -1;
|
||||
if (!isReadOnly(o1) && isReadOnly(o2)) return 1;
|
||||
@@ -218,6 +220,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
mySomeSchemesDeleted = mySomeSchemesDeleted || !deletedNewlyCreated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
if (!myApplyCompleted) {
|
||||
try {
|
||||
@@ -294,6 +297,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Configurable[] buildConfigurables() {
|
||||
myDisposeCompleted = false;
|
||||
initAll();
|
||||
@@ -330,12 +334,14 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
ColorSettingsPage[] pages = ColorSettingsPages.getInstance().getRegisteredPages();
|
||||
for (final ColorSettingsPage page : pages) {
|
||||
extensions.add(new ColorAndFontPanelFactoryEx() {
|
||||
@Override
|
||||
@NotNull
|
||||
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
|
||||
final SimpleEditorPreview preview = new SimpleEditorPreview(options, page);
|
||||
return NewColorAndFontPanel.create(preview, page.getDisplayName(), options, null, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPanelDisplayName() {
|
||||
return page.getDisplayName();
|
||||
@@ -379,6 +385,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
|
||||
private static class FontConfigurableFactory implements ColorAndFontPanelFactory {
|
||||
@Override
|
||||
@NotNull
|
||||
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
|
||||
FontEditorPreview previewPanel = new FontEditorPreview(options, true);
|
||||
@@ -390,6 +397,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPanelDisplayName() {
|
||||
return "Font";
|
||||
@@ -397,6 +405,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
|
||||
private static class ConsoleFontConfigurableFactory implements ColorAndFontPanelFactoryEx {
|
||||
@Override
|
||||
@NotNull
|
||||
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
|
||||
FontEditorPreview previewPanel = new FontEditorPreview(options, false) {
|
||||
@@ -413,6 +422,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPanelDisplayName() {
|
||||
return "Console Font";
|
||||
@@ -425,6 +435,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
|
||||
private class DiffColorsPageFactory implements ColorAndFontPanelFactory {
|
||||
@Override
|
||||
@NotNull
|
||||
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
|
||||
final DiffOptionsPanel optionsPanel = new DiffOptionsPanel(options);
|
||||
@@ -451,6 +462,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
return new NewColorAndFontPanel(schemesPanel, optionsPanel, previewPanel, DIFF_GROUP, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPanelDisplayName() {
|
||||
return DIFF_GROUP;
|
||||
@@ -529,10 +541,12 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
private static void initScopesDescriptors(ArrayList<EditorSchemeAttributeDescriptor> descriptions, MyColorScheme scheme) {
|
||||
Set<Pair<NamedScope,NamedScopesHolder>> namedScopes = new THashSet<Pair<NamedScope,NamedScopesHolder>>(new TObjectHashingStrategy<Pair<NamedScope,NamedScopesHolder>>() {
|
||||
@Override
|
||||
public int computeHashCode(final Pair<NamedScope, NamedScopesHolder> object) {
|
||||
return object.getFirst().getName().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Pair<NamedScope, NamedScopesHolder> o1, final Pair<NamedScope, NamedScopesHolder> o2) {
|
||||
return o1.getFirst().getName().equals(o2.getFirst().getName());
|
||||
}
|
||||
@@ -547,6 +561,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
List<Pair<NamedScope, NamedScopesHolder>> list = new ArrayList<Pair<NamedScope, NamedScopesHolder>>(namedScopes);
|
||||
|
||||
Collections.sort(list, new Comparator<Pair<NamedScope,NamedScopesHolder>>() {
|
||||
@Override
|
||||
public int compare(final Pair<NamedScope,NamedScopesHolder> o1, final Pair<NamedScope,NamedScopesHolder> o2) {
|
||||
return o1.getFirst().getName().compareToIgnoreCase(o2.getFirst().getName());
|
||||
}
|
||||
@@ -601,10 +616,12 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
array.add(descr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("title.colors.and.fonts");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return IconLoader.getIcon("/general/configurableColorsAndFonts.png");
|
||||
}
|
||||
@@ -634,6 +651,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
resetSchemesCombo(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() {
|
||||
if (!myInitResetInvoked) {
|
||||
try {
|
||||
@@ -691,6 +709,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
try {
|
||||
if (!myDisposeCompleted) {
|
||||
@@ -743,6 +762,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
initCheckedStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(EditorColorsScheme scheme) {
|
||||
if (scheme == null) scheme = getScheme();
|
||||
if (myAttributesToApply != null) {
|
||||
@@ -750,10 +770,12 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return !Comparing.equal(myAttributesToApply, getTextAttributes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isErrorStripeEnabled() {
|
||||
return true;
|
||||
}
|
||||
@@ -812,27 +834,34 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
initCheckedStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFontType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFontType(int type) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalEffectColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalEffectColor(Color color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalEffectType(EffectType type) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectType getExternalEffectType() {
|
||||
return EffectType.LINE_UNDERSCORE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalForeground() {
|
||||
if (myGetSetForeground == null) {
|
||||
return null;
|
||||
@@ -840,6 +869,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
return myGetSetForeground.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalForeground(Color col) {
|
||||
if (myGetSetForeground == null) {
|
||||
return;
|
||||
@@ -847,6 +877,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
myGetSetForeground.setColor(col);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalBackground() {
|
||||
if (myGetSetBackground == null) {
|
||||
return null;
|
||||
@@ -854,6 +885,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
return myGetSetBackground.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalBackground(Color col) {
|
||||
if (myGetSetBackground == null) {
|
||||
return;
|
||||
@@ -861,34 +893,42 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
myGetSetBackground.setColor(col);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalErrorStripe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalErrorStripe(Color col) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFontEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForegroundEnabled() {
|
||||
return myGetSetForeground != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBackgroundEnabled() {
|
||||
return myGetSetBackground != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEffectsColorEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myGetSetBackground != null && myGetSetBackground.isModified()
|
||||
|| myGetSetForeground != null && myGetSetForeground.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(EditorColorsScheme scheme) {
|
||||
if (myGetSetBackground != null) {
|
||||
myGetSetBackground.apply(scheme);
|
||||
@@ -899,6 +939,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.colors";
|
||||
}
|
||||
@@ -934,10 +975,12 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
initFonts();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
myName = name;
|
||||
}
|
||||
@@ -1003,27 +1046,33 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEditorFontName() {
|
||||
return myFontName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEditorFontSize() {
|
||||
return myFontSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLineSpacing() {
|
||||
return myLineSpacing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditorFontSize(int fontSize) {
|
||||
myFontSize = fontSize;
|
||||
initFonts();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineSpacing(float lineSpacing) {
|
||||
myLineSpacing = lineSpacing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditorFontName(String fontName) {
|
||||
myFontName = fontName;
|
||||
initFonts();
|
||||
@@ -1061,6 +1110,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
myConsoleLineSpacing = lineSpacing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
@@ -1078,11 +1128,13 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return getHelpTopic();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
@@ -1123,6 +1175,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
myFactory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return myFactory.getPanelDisplayName();
|
||||
@@ -1137,6 +1190,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
mySubPanel = myFactory.createPanel(ColorAndFontOptions.this);
|
||||
mySubPanel.reset(this);
|
||||
mySubPanel.addSchemesListener(new ColorAndFontSettingsListener.Abstract(){
|
||||
@Override
|
||||
public void schemeChanged(final Object source) {
|
||||
if (!myIsReset) {
|
||||
resetSchemesCombo(source);
|
||||
@@ -1156,18 +1210,22 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
return mySubPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
return createPanel().getPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
createPanel();
|
||||
for (MyColorScheme scheme : mySchemes.values()) {
|
||||
@@ -1192,10 +1250,12 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
ColorAndFontOptions.this.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (!mySubInitInvoked) {
|
||||
if (!myInitResetCompleted) {
|
||||
@@ -1208,6 +1268,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
if (mySubPanel != null) {
|
||||
mySubPanel.disposeUIResources();
|
||||
@@ -1215,15 +1276,18 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return ColorAndFontOptions.this.getId() + "." + getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return createPanel().showOption(option);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> processListOptions() {
|
||||
return createPanel().processListOptions();
|
||||
}
|
||||
|
||||
+5
@@ -27,19 +27,24 @@ public interface ColorAndFontSettingsListener extends EventListener {
|
||||
void fontChanged();
|
||||
|
||||
abstract class Abstract implements ColorAndFontSettingsListener {
|
||||
@Override
|
||||
public void selectedOptionChanged(final Object selected) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void schemeChanged(final Object source) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settingsChanged() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionInPreviewChanged(final String typeToSelect) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fontChanged() {
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -24,11 +24,13 @@ import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class FileStatusColorsPageFactory implements ColorAndFontPanelFactory {
|
||||
@Override
|
||||
@NotNull
|
||||
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
|
||||
return NewColorAndFontPanel.create(new PreviewPanel.Empty(), ColorAndFontOptions.FILE_STATUS_GROUP, options, collectFileTypes(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPanelDisplayName() {
|
||||
return ColorAndFontOptions.FILE_STATUS_GROUP;
|
||||
|
||||
@@ -61,6 +61,7 @@ public class FontEditorPreview implements PreviewPanel{
|
||||
|
||||
static void installTrafficLights(@NotNull EditorEx editor) {
|
||||
TrafficLightRenderer renderer = new TrafficLightRenderer(null, null,null){
|
||||
@Override
|
||||
protected DaemonCodeAnalyzerStatus getDaemonCodeAnalyzerStatus(boolean fillErrorsCount, SeverityRegistrar severityRegistrar) {
|
||||
DaemonCodeAnalyzerStatus status = new DaemonCodeAnalyzerStatus();
|
||||
status.errorAnalyzingFinished = true;
|
||||
@@ -99,10 +100,12 @@ public class FontEditorPreview implements PreviewPanel{
|
||||
return editor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getPanel() {
|
||||
return myEditor.getComponent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView() {
|
||||
EditorColorsScheme scheme = updateOptionsScheme(myOptions.getSelectedScheme());
|
||||
|
||||
@@ -115,13 +118,16 @@ public class FontEditorPreview implements PreviewPanel{
|
||||
return selectedScheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkSelectedHighlightType(Object description) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(@NotNull final ColorAndFontSettingsListener listener) {
|
||||
myDispatcher.addListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
EditorFactory editorFactory = EditorFactory.getInstance();
|
||||
editorFactory.releaseEditor(myEditor);
|
||||
|
||||
@@ -71,6 +71,7 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
add(schemesGroup, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOptionsList() {
|
||||
myIsInSchemeChange = true;
|
||||
|
||||
@@ -112,14 +113,17 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
getCurrentScheme().setLineSpacing(lineSpacing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable showOption(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyChangesToScheme() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectOption(final String typeToSelect) {
|
||||
}
|
||||
|
||||
@@ -176,6 +180,7 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
editorFontPanel.add(new TailPanel(), gbConstraints);
|
||||
|
||||
myFontNameButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
EditorColorsScheme current = getCurrentScheme();
|
||||
if (ColorAndFontOptions.isReadOnly(current) || ColorSettingsUtil.isSharedScheme(current)) {
|
||||
@@ -188,6 +193,7 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
});
|
||||
|
||||
myEditorFontSizeField.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
public void textChanged(DocumentEvent event) {
|
||||
if (myIsInSchemeChange) return;
|
||||
int fontSize = OptionsConstants.DEFAULT_EDITOR_FONT_SIZE;
|
||||
@@ -208,6 +214,7 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
});
|
||||
|
||||
myLineSpacingField.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
public void textChanged(DocumentEvent event) {
|
||||
if (myIsInSchemeChange) return;
|
||||
float lineSpacing = 1;
|
||||
@@ -299,6 +306,7 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
}
|
||||
|
||||
private class InitFontsRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
|
||||
|
||||
@@ -341,19 +349,23 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
super(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(ColorAndFontSettingsListener listener) {
|
||||
myDispatcher.addListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JPanel getPanel() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> processListOptions() {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
|
||||
+2
@@ -77,6 +77,7 @@ public class NewColorAndFontPanel extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectedOptionChanged(final Object selected) {
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
myPreviewPanel.blinkSelectedHighlightType(selected);
|
||||
@@ -85,6 +86,7 @@ public class NewColorAndFontPanel extends JPanel {
|
||||
|
||||
});
|
||||
mySchemesPanel.addListener(new ColorAndFontSettingsListener.Abstract() {
|
||||
@Override
|
||||
public void schemeChanged(final Object source) {
|
||||
myOptionsPanel.updateOptionsList();
|
||||
myPreviewPanel.updateView();
|
||||
|
||||
@@ -48,6 +48,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
myCategoryName = categoryName;
|
||||
|
||||
optionsPanel.setActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
myDispatcher.getMulticaster().settingsChanged();
|
||||
}
|
||||
@@ -56,12 +57,14 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
myOptionsList = new JBList();
|
||||
|
||||
myOptionsList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
if (!mySchemesProvider.areSchemesLoaded()) return;
|
||||
processListValueChanged();
|
||||
}
|
||||
});
|
||||
myOptionsList.setCellRenderer(new DefaultListCellRenderer(){
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (value instanceof ColorAndFontDescription) {
|
||||
@@ -84,6 +87,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
add(north, BorderLayout.NORTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(ColorAndFontSettingsListener listener) {
|
||||
myDispatcher.addListener(listener);
|
||||
}
|
||||
@@ -126,15 +130,18 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JPanel getPanel() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOptionsList() {
|
||||
fillOptionsList();
|
||||
processListValueChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable showOption(final String option) {
|
||||
final String lowerCaseOption = option.toLowerCase();
|
||||
DefaultListModel model = (DefaultListModel)myOptionsList.getModel();
|
||||
@@ -147,6 +154,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
o.toString().toLowerCase().contains(lowerCaseOption)) {
|
||||
final int i1 = i;
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ListScrollingUtil.selectItem(myOptionsList, i1);
|
||||
}
|
||||
@@ -159,6 +167,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyChangesToScheme() {
|
||||
Object selectedValue = myOptionsList.getSelectedValue();
|
||||
if (selectedValue instanceof ColorAndFontDescription) {
|
||||
@@ -167,6 +176,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectOption(final String typeToSelect) {
|
||||
DefaultListModel model = (DefaultListModel)myOptionsList.getModel();
|
||||
|
||||
@@ -182,6 +192,7 @@ public class OptionsPanelImpl extends JPanel implements OptionsPanel {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> processListOptions() {
|
||||
HashSet<String> result = new HashSet<String>();
|
||||
EditorSchemeAttributeDescriptor[] descriptions = myOptions.getCurrentDescriptions();
|
||||
|
||||
@@ -26,21 +26,26 @@ public interface PreviewPanel {
|
||||
void disposeUIResources();
|
||||
|
||||
class Empty implements PreviewPanel{
|
||||
@Override
|
||||
public Component getPanel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(@NotNull final ColorAndFontSettingsListener listener) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkSelectedHighlightType(final Object selected) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class SchemesPanel extends JPanel {
|
||||
add(schemesGroup, BorderLayout.CENTER);
|
||||
|
||||
mySchemeComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (mySchemeComboBox.getSelectedIndex() != -1) {
|
||||
EditorColorsScheme selected = myOptions.selectScheme((String)mySchemeComboBox.getSelectedItem());
|
||||
@@ -117,6 +118,7 @@ public class SchemesPanel extends JPanel {
|
||||
|
||||
JButton saveAsButton = new JButton(ApplicationBundle.message("button.save.as"));
|
||||
saveAsButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showSaveAsDialog();
|
||||
}
|
||||
@@ -127,6 +129,7 @@ public class SchemesPanel extends JPanel {
|
||||
|
||||
myDeleteButton = new JButton(ApplicationBundle.message("button.delete"));
|
||||
myDeleteButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (mySchemeComboBox.getSelectedIndex() != -1) {
|
||||
myOptions.removeScheme((String)mySchemeComboBox.getSelectedItem());
|
||||
@@ -141,6 +144,7 @@ public class SchemesPanel extends JPanel {
|
||||
if (schemesManager.isExportAvailable()) {
|
||||
myExportButton = new JButton("Share...");
|
||||
myExportButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
EditorColorsScheme selected = myOptions.getOriginalSelectedScheme();
|
||||
ExportSchemeAction
|
||||
@@ -158,9 +162,11 @@ public class SchemesPanel extends JPanel {
|
||||
JButton myImportButton = new JButton("Import Shared...");
|
||||
myImportButton.setMnemonic('I');
|
||||
myImportButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
SchemesToImportPopup<EditorColorsScheme, EditorColorsSchemeImpl> popup =
|
||||
new SchemesToImportPopup<EditorColorsScheme, EditorColorsSchemeImpl>(SchemesPanel.this) {
|
||||
@Override
|
||||
protected void onSchemeSelected(final EditorColorsSchemeImpl scheme) {
|
||||
if (scheme != null) {
|
||||
myOptions.addImportedScheme(scheme);
|
||||
|
||||
+4
@@ -31,9 +31,11 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
class ScopeColorsPageFactory implements ColorAndFontPanelFactory {
|
||||
@Override
|
||||
public NewColorAndFontPanel createPanel(ColorAndFontOptions options) {
|
||||
final JPanel scopePanel = createChooseScopePanel();
|
||||
return NewColorAndFontPanel.create(new PreviewPanel.Empty(){
|
||||
@Override
|
||||
public Component getPanel() {
|
||||
return scopePanel;
|
||||
}
|
||||
@@ -41,6 +43,7 @@ class ScopeColorsPageFactory implements ColorAndFontPanelFactory {
|
||||
}, ColorAndFontOptions.SCOPES_GROUP, options, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPanelDisplayName() {
|
||||
return ColorAndFontOptions.SCOPES_GROUP;
|
||||
}
|
||||
@@ -67,6 +70,7 @@ class ScopeColorsPageFactory implements ColorAndFontPanelFactory {
|
||||
gc.weighty = 1;
|
||||
panel.add(new JPanel(), gc);
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final OptionsEditor optionsEditor = OptionsEditor.KEY.getData(DataManager.getInstance().getDataContext());
|
||||
if (optionsEditor != null) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
class TailPanel extends JPanel {
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return new Dimension(0, 0);
|
||||
}
|
||||
|
||||
+12
@@ -40,50 +40,62 @@ public abstract class TextAttributesDescription extends ColorAndFontDescription
|
||||
initCheckedStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFontType() {
|
||||
return myAttributes.getFontType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFontType(int type) {
|
||||
myAttributes.setFontType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalEffectColor() {
|
||||
return myAttributes.getEffectColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectType getExternalEffectType() {
|
||||
return myAttributes.getEffectType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalEffectColor(Color color) {
|
||||
myAttributes.setEffectColor(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalEffectType(EffectType type) {
|
||||
myAttributes.setEffectType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalForeground() {
|
||||
return myAttributes.getForegroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalForeground(Color col) {
|
||||
myAttributes.setForegroundColor(col);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalBackground() {
|
||||
return myAttributes.getBackgroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getExternalErrorStripe() {
|
||||
return myAttributes.getErrorStripeColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalBackground(Color col) {
|
||||
myAttributes.setBackgroundColor(col);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalErrorStripe(Color col) {
|
||||
myAttributes.setErrorStripeColor(col);
|
||||
}
|
||||
|
||||
+7
@@ -33,23 +33,28 @@ public class AutoImportOptionsConfigurable extends CompositeConfigurable<AutoImp
|
||||
private JPanel myPanel;
|
||||
private JPanel myProvidersPanel;
|
||||
|
||||
@Override
|
||||
protected List<AutoImportOptionsProvider> createConfigurables() {
|
||||
return AbstractConfigurableEP.createConfigurables(AutoImportOptionsProviderEP.EP_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("auto.import");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.autoimport";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myProvidersPanel.removeAll();
|
||||
for (int i = 0; i < getConfigurables().size(); i++) {
|
||||
@@ -67,11 +72,13 @@ public class AutoImportOptionsConfigurable extends CompositeConfigurable<AutoImp
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.import";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+11
@@ -44,19 +44,23 @@ public class CodeFoldingConfigurable extends CompositeConfigurable<CodeFoldingOp
|
||||
private JPanel myRootPanel;
|
||||
private JPanel myFoldingPanel;
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("group.code.folding");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.code.folding";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myFoldingPanel.removeAll();
|
||||
for (CodeFoldingOptionsProvider provider : getConfigurables()) {
|
||||
@@ -67,11 +71,13 @@ public class CodeFoldingConfigurable extends CompositeConfigurable<CodeFoldingOp
|
||||
return myRootPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myCbFolding.isSelected() != EditorSettingsExternalizable.getInstance().isFoldingOutlineShown() ||
|
||||
super.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
EditorSettingsExternalizable.getInstance().setFoldingOutlineShown(myCbFolding.isSelected());
|
||||
super.apply();
|
||||
@@ -85,6 +91,7 @@ public class CodeFoldingConfigurable extends CompositeConfigurable<CodeFoldingOp
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (Pair<Editor, Project> each : toUpdate) {
|
||||
if (each.second == null || each.second.isDisposed()) {
|
||||
@@ -100,20 +107,24 @@ public class CodeFoldingConfigurable extends CompositeConfigurable<CodeFoldingOp
|
||||
}, ModalityState.NON_MODAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
myCbFolding.setSelected(EditorSettingsExternalizable.getInstance().isFoldingOutlineShown());
|
||||
super.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<CodeFoldingOptionsProvider> createConfigurables() {
|
||||
return AbstractConfigurableEP.createConfigurables(CodeFoldingOptionsProviderEP.EP_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.folding";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+8
@@ -66,6 +66,7 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
|
||||
public EditorAppearanceConfigurable() {
|
||||
myCbBlinkCaret.addActionListener(
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
myBlinkIntervalField.setEnabled(myCbBlinkCaret.isSelected());
|
||||
}
|
||||
@@ -165,19 +166,23 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("tab.editor.settings.appearance");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.appearance";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
for (UnnamedConfigurable provider : getConfigurables()) {
|
||||
myAddonPanel.add(provider.createComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
|
||||
@@ -192,15 +197,18 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
|
||||
super.disposeUIResources();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<UnnamedConfigurable> createConfigurables() {
|
||||
return AbstractConfigurableEP.createConfigurables(EP_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.appearance";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class EditorOptions implements SearchableConfigurable.Parent {
|
||||
private EditorOptionsPanel myEditorOptionsPanel;
|
||||
private Configurable[] myChildren;
|
||||
|
||||
@Override
|
||||
public Configurable[] getConfigurables() {
|
||||
if (myChildren == null) {
|
||||
final List<EditorOptionsProvider> configurables = AbstractConfigurableEP.createConfigurables(EditorOptionsProviderEP.EP_NAME);
|
||||
@@ -41,56 +42,68 @@ public class EditorOptions implements SearchableConfigurable.Parent {
|
||||
return myChildren;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("title.editor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return IconLoader.getIcon("/general/configurableEditor.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOwnContent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myEditorOptionsPanel = new EditorOptionsPanel();
|
||||
return myEditorOptionsPanel.getComponent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myEditorOptionsPanel != null && myEditorOptionsPanel.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
if (myEditorOptionsPanel != null) {
|
||||
myEditorOptionsPanel.apply();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (myEditorOptionsPanel != null) {
|
||||
myEditorOptionsPanel.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
myEditorOptionsPanel = null;
|
||||
|
||||
|
||||
+10
@@ -426,43 +426,53 @@ public class EditorOptionsPanel {
|
||||
}
|
||||
|
||||
public class MyConfigurable implements SearchableConfigurable {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "Editor.Behavior";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return ApplicationBundle.message("tab.editor.settings.behavior");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
return myBehaviourPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return EditorOptionsPanel.this.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
EditorOptionsPanel.this.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
EditorOptionsPanel.this.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
EditorOptionsPanel.this.disposeUIResources();
|
||||
}
|
||||
|
||||
+7
@@ -94,23 +94,28 @@ public class EditorSmartKeysConfigurable extends CompositeConfigurable<UnnamedCo
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<UnnamedConfigurable> createConfigurables() {
|
||||
return AbstractConfigurableEP.createConfigurables(EP_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return "Smart Keys";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.smartkey";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
if (!myAddonsInitialized) {
|
||||
myAddonsInitialized = true;
|
||||
@@ -230,11 +235,13 @@ public class EditorSmartKeysConfigurable extends CompositeConfigurable<UnnamedCo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.smartKeys";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+11
@@ -55,6 +55,7 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
}));
|
||||
myEditorTabPlacement.setRenderer(new MyTabsPlacementComboBoxRenderer(myEditorTabPlacement.getRenderer()));
|
||||
myEditorTabPlacement.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
revalidateSingleRowCheckbox();
|
||||
}
|
||||
@@ -88,23 +89,28 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
return "Editor Tabs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return "reference.settingsdialog.IDE.editor.tabs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
return myRootPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
UISettings uiSettings=UISettings.getInstance();
|
||||
|
||||
@@ -133,6 +139,7 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
UISettings uiSettings=UISettings.getInstance();
|
||||
|
||||
@@ -176,6 +183,7 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
final UISettings uiSettings = UISettings.getInstance();
|
||||
boolean isModified = isModified(myCbModifiedTabsMarkedWithAsterisk, uiSettings.MARK_MODIFIED_TABS_WITH_ASTERISK);
|
||||
@@ -195,6 +203,7 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
return isModified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
}
|
||||
|
||||
@@ -244,11 +253,13 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return "editor.preferences.tabs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Runnable enableSearch(final String option) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user