public abstract class PerFileConfigurableBase<T> extends java.lang.Object implements SearchableConfigurable, Configurable.NoScroll
Modifier and Type | Class and Description |
---|---|
protected static interface |
PerFileConfigurableBase.Value<T> |
SearchableConfigurable.Delegate, SearchableConfigurable.Merged, SearchableConfigurable.Parent
Configurable.Composite, Configurable.NoMargin, Configurable.NoScroll, Configurable.TopComponentController, Configurable.TopComponentProvider, Configurable.VariableProjectAppLevel, Configurable.WithEpDependencies
Modifier and Type | Field and Description |
---|---|
protected static Key<java.lang.Boolean> |
ADD_PROJECT_MAPPING |
protected static Key<java.lang.String> |
DESCRIPTION |
protected static Key<java.lang.String> |
EMPTY_TEXT |
protected static Key<java.lang.String> |
MAPPING_TITLE |
protected PerFileMappings<T> |
myMappings |
protected Project |
myProject |
protected static Key<java.lang.String> |
NULL_TEXT |
protected static Key<java.lang.Boolean> |
ONLY_DIRECTORIES |
protected static Key<java.lang.String> |
OVERRIDE_QUESTION |
protected static Key<java.lang.String> |
OVERRIDE_TITLE |
protected static Key<java.lang.Boolean> |
SORT_VALUES |
protected static Key<java.lang.String> |
TARGET_TITLE |
APPLICATION_CONFIGURABLE, PROJECT_CONFIGURABLE
Modifier | Constructor and Description |
---|---|
protected |
PerFileConfigurableBase(Project project,
PerFileMappings<T> mappings) |
Modifier and Type | Method and Description |
---|---|
protected T |
adjustChosenValue(java.lang.Object target,
T chosen) |
void |
apply()
Stores the settings from the Swing form to the configurable component.
|
protected boolean |
canEditTarget(java.lang.Object target,
T value) |
protected boolean |
canRemoveTarget(java.lang.Object target) |
protected ActionGroup |
createActionListGroup(java.lang.Object target,
Consumer<? super T> onChosen) |
protected javax.swing.JPanel |
createActionPanel(java.lang.Object target,
PerFileConfigurableBase.Value<T> value) |
javax.swing.JComponent |
createComponent()
Creates new Swing form that enables user to configure the settings.
|
protected javax.swing.JComponent |
createDefaultMappingComponent() |
protected AnAction |
createValueAction(java.lang.Object target,
PerFileConfigurableBase.Value<T> value) |
protected JBPopup |
createValueEditorActionListPopup(java.lang.Object target,
java.lang.Runnable onDispose,
DataContext dataContext,
Consumer<? super T> onChosen) |
protected JBPopup |
createValueEditorPopup(java.lang.Object target,
T value,
java.lang.Runnable onDispose,
DataContext dataContext,
Consumer<? super T> onChosen,
java.lang.Runnable onCommit) |
protected int[] |
findRow(VirtualFile file,
boolean strict,
boolean all) |
protected javax.swing.Icon |
getActionListIcon(java.lang.Object target,
T t) |
protected java.lang.String |
getClearValueText(java.lang.Object target) |
protected java.util.List<Trinity<java.lang.String,java.util.function.Supplier<T>,Consumer<T>>> |
getDefaultMappings() |
java.lang.String |
getId()
Unique configurable id.
|
T |
getNewMapping(VirtualFile file) |
protected java.util.Map<VirtualFile,T> |
getNewMappings() |
protected java.lang.String |
getNullValueText(java.lang.Object target) |
protected abstract <S> java.lang.Object |
getParameter(Key<S> key) |
protected java.lang.String |
getToolTipFor(T value) |
protected java.util.Collection<T> |
getValueVariants(java.lang.Object target) |
boolean |
isModified()
Indicates whether the Swing form was modified or not.
|
protected void |
renderDefaultValue(java.lang.Object target,
ColoredTextContainer renderer) |
protected void |
renderTarget(java.lang.Object target,
ColoredTextContainer renderer) |
protected abstract void |
renderValue(java.lang.Object target,
T t,
ColoredTextContainer renderer) |
void |
reset()
Loads the settings from the configurable component to the Swing form.
|
void |
selectFile(VirtualFile virtualFile) |
void |
selectFile(VirtualFile virtualFile,
boolean addIfMissing) |
protected void |
selectRows(int[] rows,
boolean convertModelRowsToView) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enableSearch, getOriginalClass
getDisplayName, getHelpTopic, getPreferredFocusedComponent, isModified, isModified, isModified, isModified
cancel, disposeUIResources
protected static final Key<java.lang.String> DESCRIPTION
protected static final Key<java.lang.String> TARGET_TITLE
protected static final Key<java.lang.String> MAPPING_TITLE
protected static final Key<java.lang.String> EMPTY_TEXT
protected static final Key<java.lang.String> OVERRIDE_QUESTION
protected static final Key<java.lang.String> OVERRIDE_TITLE
protected static final Key<java.lang.String> NULL_TEXT
protected static final Key<java.lang.Boolean> ADD_PROJECT_MAPPING
protected static final Key<java.lang.Boolean> ONLY_DIRECTORIES
protected static final Key<java.lang.Boolean> SORT_VALUES
protected final Project myProject
protected final PerFileMappings<T> myMappings
protected PerFileConfigurableBase(Project project, PerFileMappings<T> mappings)
public java.lang.String getId()
SearchableConfigurable
getId
in interface SearchableConfigurable
ConfigurableEP.id
protected abstract <S> java.lang.Object getParameter(Key<S> key)
protected java.util.List<Trinity<java.lang.String,java.util.function.Supplier<T>,Consumer<T>>> getDefaultMappings()
protected boolean canRemoveTarget(java.lang.Object target)
protected boolean canEditTarget(java.lang.Object target, T value)
protected abstract void renderValue(java.lang.Object target, T t, ColoredTextContainer renderer)
protected void renderDefaultValue(java.lang.Object target, ColoredTextContainer renderer)
public javax.swing.JComponent createComponent()
UnnamedConfigurable
Also this place is designed to allocate resources (subscriptions/listeners etc.)
createComponent
in interface UnnamedConfigurable
null
if it cannot be createdUnnamedConfigurable.disposeUIResources()
protected java.lang.String getToolTipFor(T value)
protected javax.swing.JComponent createDefaultMappingComponent()
public T getNewMapping(VirtualFile file)
public boolean isModified()
UnnamedConfigurable
isModified
in interface UnnamedConfigurable
true
if the settings were modified, false
otherwisepublic void apply() throws ConfigurationException
UnnamedConfigurable
apply
in interface UnnamedConfigurable
ConfigurationException
- if values cannot be appliedpublic void reset()
UnnamedConfigurable
reset
in interface UnnamedConfigurable
protected void selectRows(int[] rows, boolean convertModelRowsToView)
protected java.util.Map<VirtualFile,T> getNewMappings()
public void selectFile(VirtualFile virtualFile)
public void selectFile(VirtualFile virtualFile, boolean addIfMissing)
protected int[] findRow(VirtualFile file, boolean strict, boolean all)
protected javax.swing.JPanel createActionPanel(java.lang.Object target, PerFileConfigurableBase.Value<T> value)
protected void renderTarget(java.lang.Object target, ColoredTextContainer renderer)
protected final AnAction createValueAction(java.lang.Object target, PerFileConfigurableBase.Value<T> value)
protected JBPopup createValueEditorPopup(java.lang.Object target, T value, java.lang.Runnable onDispose, DataContext dataContext, Consumer<? super T> onChosen, java.lang.Runnable onCommit)
protected final JBPopup createValueEditorActionListPopup(java.lang.Object target, java.lang.Runnable onDispose, DataContext dataContext, Consumer<? super T> onChosen)
protected javax.swing.Icon getActionListIcon(java.lang.Object target, T t)
protected java.lang.String getClearValueText(java.lang.Object target)
protected java.lang.String getNullValueText(java.lang.Object target)
protected java.util.Collection<T> getValueVariants(java.lang.Object target)
protected ActionGroup createActionListGroup(java.lang.Object target, Consumer<? super T> onChosen)