public interface QueryController
Typically a Query UI should provide at least a query criteria editor available when creating new queries or modifying existing ones. In case it isn't possible to create or modify a query on the client it is possible to provide no QueryController and no UI at all - e.g. an immutable server defined query with no remote api to modify the criteria.
When editing or creating a Query, the UI is presented in an
TopComponent in the editor area. Fire PROP_CHANGED
to notify the Query
TopComponent that the UI state changed, QueryController.isChanged()
will be called
accordingly to determine if the IDE-s general SaveAction should be enabled.
On save or TopComponent close are then the saveChanges()
and discardUnsavedChanges()
methods called accordingly.
Please note, that the results of an query are always presented in the TaskDashboard, but eventually, in case the need appears, it is also possible for the bugtracking plugin implementation to provide a customized result view - e.g a table listing more attributes than then TasksDashboard does.
Modifier and Type | Interface and Description |
---|---|
static class |
QueryController.QueryMode
The mode in which this controllers component is shown.
|
Modifier and Type | Field and Description |
---|---|
static String |
PROP_CHANGED
Fired when the data presented in the Query UI were changed by the user.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Registers a PropertyChangeListener.
|
void |
closed()
Called when the component returned by this controller was closed.
|
boolean |
discardUnsavedChanges()
This method is called when Discard was chosen on close of an Query TopComponent.
|
JComponent |
getComponent(QueryController.QueryMode mode)
Returns a visual Query component.
|
HelpCtx |
getHelpCtx()
Returns the help context associated with this controllers visual component
|
boolean |
isChanged()
Determines whether the state of the UI has changed and is supposed to be saved.
|
void |
opened()
Called when the component returned by this controller was opened.
|
boolean |
providesMode(QueryController.QueryMode mode)
Determines if the Query provides an Editor or a Result view.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Unregisters a PropertyChangeListener.
|
boolean |
saveChanges(String name)
This method is called when the general IDE Save button is pressed or when
Save was chosen on close of an Query TopComponent.
|
static final String PROP_CHANGED
boolean providesMode(QueryController.QueryMode mode)
mode
- true
if the given mode is provided by the particular
implementation, otherwise false
JComponent getComponent(QueryController.QueryMode mode)
mode
- HelpCtx getHelpCtx()
void opened()
void closed()
boolean saveChanges(String name)
name
- in case the Query wasn't saved yet a new name is provided. Otherwise might be null.true
in case the save worked, otherwise false
boolean discardUnsavedChanges()
true
in case the discard worked, otherwise false
boolean isChanged()
true
in case there are changes to be saved, otherwise false
void addPropertyChangeListener(PropertyChangeListener l)
l
- a PropertyChangeListenervoid removePropertyChangeListener(PropertyChangeListener l)
l
- a PropertyChangeListener