T
- The actual scheme type.public abstract class AbstractSchemeActions<T extends Scheme>
extends java.lang.Object
A standard set of scheme actions: copy, reset, rename, etc. used in SimpleSchemesPanel
. More actions can be added via
addAdditionalActions(List)
method. Available actions depend on SchemesModel
. If schemes model supports both IDE and
project schemes, copyToIDE(Scheme)
and copyToProject(Scheme)
must be overridden to do the actual job, default
implementation for the methods does nothing.
Import and export actions are available only if there are importer/exporter implementations for the actual scheme type.
SimpleSchemesPanel
,
SchemesModel
,
SchemeImporter
,
SchemeExporter
Modifier and Type | Field and Description |
---|---|
protected AbstractSchemesPanel<T,?> |
mySchemesPanel |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSchemeActions(AbstractSchemesPanel<T,?> schemesPanel) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdditionalActions(java.util.List<? super AnAction> defaultActions) |
protected void |
copyToIDE(T scheme)
Copy the scheme to IDE (application).
|
protected void |
copyToProject(T scheme)
Copy the scheme to project.
|
protected abstract void |
duplicateScheme(T scheme,
java.lang.String newName)
Creates a copy of the scheme with a different name.
|
protected void |
exportScheme(Project project,
T scheme,
java.lang.String exporterName)
Export the scheme using the given exporter name.
|
protected void |
exportScheme(T scheme,
java.lang.String exporterName)
Deprecated.
Use
exportScheme(Project, Scheme, String) instead. |
java.util.Collection<AnAction> |
getActions() |
protected T |
getCurrentScheme() |
protected SchemesModel<T> |
getModel() |
protected java.util.Collection<java.lang.String> |
getSchemeImportersNames() |
AbstractSchemesPanel<T,?> |
getSchemesPanel() |
protected abstract java.lang.Class<T> |
getSchemeType() |
protected void |
importScheme(java.lang.String importerName)
Import a scheme using the given importer name.
|
protected abstract void |
onSchemeChanged(T scheme)
Make necessary configurable updates when another scheme has been selected.
|
protected abstract void |
renameScheme(T scheme,
java.lang.String newName)
Change scheme's name to the new one.
|
protected abstract void |
resetScheme(T scheme)
Reset scheme's settings to their default values (presets).
|
protected final AbstractSchemesPanel<T extends Scheme,?> mySchemesPanel
protected AbstractSchemeActions(AbstractSchemesPanel<T,?> schemesPanel)
protected java.util.Collection<java.lang.String> getSchemeImportersNames()
public final java.util.Collection<AnAction> getActions()
protected void addAdditionalActions(java.util.List<? super AnAction> defaultActions)
protected void importScheme(java.lang.String importerName)
importerName
- The importer name.SchemeImporter
,
SchemeImporterEP
protected abstract void resetScheme(T scheme)
scheme
- The scheme to reset.protected abstract void duplicateScheme(T scheme, java.lang.String newName)
scheme
- The scheme to copy.newName
- New name.@Deprecated protected void exportScheme(T scheme, java.lang.String exporterName)
exportScheme(Project, Scheme, String)
instead.protected void exportScheme(Project project, T scheme, java.lang.String exporterName)
scheme
- The scheme to export.exporterName
- The exporter name.SchemeExporter
,
SchemeExporterEP
protected abstract void onSchemeChanged(T scheme)
scheme
- The new current scheme.protected abstract void renameScheme(T scheme, java.lang.String newName)
scheme
- The scheme to rename.newName
- New scheme name.protected void copyToProject(T scheme)
scheme
- The scheme to copy.protected void copyToIDE(T scheme)
scheme
- The scheme to copy.protected SchemesModel<T> getModel()
protected final T getCurrentScheme()
protected abstract java.lang.Class<T> getSchemeType()
public final AbstractSchemesPanel<T,?> getSchemesPanel()