public abstract class AbstractExternalSystemSettings<SS extends AbstractExternalSystemSettings<SS,PS,L>,PS extends ExternalProjectSettings,L extends ExternalSystemSettingsListener<PS>> extends java.lang.Object implements Disposable
AbstractExternalSystemSettings.State
annotation configured as necessary.Modifier and Type | Class and Description |
---|---|
static interface |
AbstractExternalSystemSettings.State<S> |
Disposable.Parent
Modifier | Constructor and Description |
---|---|
protected |
AbstractExternalSystemSettings(Topic<L> topic,
Project project) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkSettings(PS old,
PS current)
Is assumed to check if given old settings external system-specific state differs from the given new one
and
notify listeners in case of the positive answer. |
protected abstract void |
copyExtraSettingsFrom(SS settings) |
void |
copyFrom(SS settings) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
protected void |
doSubscribe(L listener,
Disposable parentDisposable)
Generic subscribe implementation
|
protected void |
fillState(AbstractExternalSystemSettings.State<PS> state) |
Topic<L> |
getChangesTopic() |
PS |
getLinkedProjectSettings(java.lang.String linkedProjectPath) |
java.util.Collection<PS> |
getLinkedProjectsSettings() |
Project |
getProject() |
L |
getPublisher() |
void |
linkProject(PS settings) |
protected void |
loadState(AbstractExternalSystemSettings.State<PS> state) |
void |
setLinkedProjectsSettings(java.util.Collection<? extends PS> settings) |
boolean |
showSelectiveImportDialogOnInitialImport() |
abstract void |
subscribe(ExternalSystemSettingsListener<PS> listener)
Deprecated.
use/implements
subscribe(ExternalSystemSettingsListener, Disposable) instead |
void |
subscribe(ExternalSystemSettingsListener<PS> listener,
Disposable parentDisposable)
Every time particular external system setting is changed corresponding message is sent via ide
messaging sub-system.
|
boolean |
unlinkExternalProject(java.lang.String linkedProjectPath)
Un-links given external project from the current ide project.
|
public void dispose()
Disposable
dispose
in interface Disposable
public Project getProject()
public boolean showSelectiveImportDialogOnInitialImport()
public void subscribe(ExternalSystemSettingsListener<PS> listener, Disposable parentDisposable)
ExternalSystemSettingsListener
interface and is specific to external sub-system implementation.
However, it's possible that a client wants to perform particular actions based only on ExternalSystemSettingsListener
facilities. There is no way for such external system-agnostic client to create external system-specific listener
implementation then.
That's why this method allows to wrap given 'generic listener' into external system-specific one.listener
- target generic listener to wrap to external system-specific implementationparentDisposable
- is a disposable to unsubscribe from external system settings events@Deprecated public abstract void subscribe(ExternalSystemSettingsListener<PS> listener)
subscribe(ExternalSystemSettingsListener, Disposable)
insteadprotected void doSubscribe(L listener, Disposable parentDisposable)
public void copyFrom(SS settings)
protected abstract void copyExtraSettingsFrom(SS settings)
public java.util.Collection<PS> getLinkedProjectsSettings()
public PS getLinkedProjectSettings(java.lang.String linkedProjectPath)
public void linkProject(PS settings) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean unlinkExternalProject(java.lang.String linkedProjectPath)
linkedProjectPath
- path of external project to be unlinkedtrue
if there was an external project with the given config path linked to the current
ide project;
false
otherwisepublic void setLinkedProjectsSettings(java.util.Collection<? extends PS> settings)
protected abstract void checkSettings(PS old, PS current)
notify
listeners in case of the positive answer.old
- old settings statecurrent
- current settings statepublic L getPublisher()
protected void fillState(AbstractExternalSystemSettings.State<PS> state)
protected void loadState(AbstractExternalSystemSettings.State<PS> state)