mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup
This commit is contained in:
+13
-12
@@ -145,19 +145,20 @@ public class CodeStyleSchemesPanel {
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
ManageSchemesComboAction manageSchemesComboAction = new ManageSchemesComboAction(new CodeStyleSchemesActions(myModel) {
|
||||
@NotNull
|
||||
@Override
|
||||
protected JComponent getParentComponent() {
|
||||
return myPanel;
|
||||
}
|
||||
ManageSchemesComboAction<CodeStyleScheme> manageSchemesComboAction =
|
||||
new ManageSchemesComboAction<>(new CodeStyleSchemesActions(myModel) {
|
||||
@NotNull
|
||||
@Override
|
||||
protected JComponent getParentComponent() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected CodeStyleScheme getCurrentScheme() {
|
||||
return getSelectedScheme();
|
||||
}
|
||||
});
|
||||
@Nullable
|
||||
@Override
|
||||
protected CodeStyleScheme getCurrentScheme() {
|
||||
return getSelectedScheme();
|
||||
}
|
||||
});
|
||||
myManageButton = manageSchemesComboAction.createCombo();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,13 +87,14 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent {
|
||||
panel.add(mySchemeComboBox,
|
||||
new GridBagConstraints(gridx++, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new JBInsets(0, 0, 5, 10),
|
||||
0, 0));
|
||||
ManageSchemesComboAction schemesComboAction = new ManageSchemesComboAction(new ColorSchemeActions(this, myOptions) {
|
||||
@Nullable
|
||||
@Override
|
||||
protected EditorColorsScheme getCurrentScheme() {
|
||||
return myOptions.getScheme(getSelectedSchemeName());
|
||||
}
|
||||
});
|
||||
ManageSchemesComboAction<EditorColorsScheme> schemesComboAction =
|
||||
new ManageSchemesComboAction<>(new ColorSchemeActions(this, myOptions) {
|
||||
@Nullable
|
||||
@Override
|
||||
protected EditorColorsScheme getCurrentScheme() {
|
||||
return myOptions.getScheme(getSelectedSchemeName());
|
||||
}
|
||||
});
|
||||
JButton manageButton = schemesComboAction.createCombo();
|
||||
panel.add(manageButton,
|
||||
new GridBagConstraints(gridx++, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new JBInsets(0, 0, 5, 5),
|
||||
|
||||
@@ -22,16 +22,17 @@ import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.actionSystem.ex.ComboBoxAction;
|
||||
import com.intellij.application.options.DefaultSchemeActions;
|
||||
import com.intellij.openapi.options.Scheme;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ManageSchemesComboAction extends ComboBoxAction {
|
||||
public class ManageSchemesComboAction<T extends Scheme> extends ComboBoxAction {
|
||||
|
||||
private Collection<AnAction> myActions;
|
||||
|
||||
public ManageSchemesComboAction(@NotNull DefaultSchemeActions schemeActions) {
|
||||
public ManageSchemesComboAction(@NotNull DefaultSchemeActions<T> schemeActions) {
|
||||
myActions = schemeActions.getActions();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user