public abstract class CloneableOpenSupport extends Object
OpenCookie
,
ViewCookie
, or CloseCookie
,
depending on which cookies the subclass implements.Modifier and Type | Class and Description |
---|---|
static interface |
CloneableOpenSupport.Env
Abstract interface that is used by CloneableOpenSupport to
talk to outside world.
|
Modifier and Type | Field and Description |
---|---|
protected CloneableTopComponent.Ref |
allEditors
All opened editors on this file.
|
protected CloneableOpenSupport.Env |
env
the environment that provides connection to outside world
|
Constructor and Description |
---|
CloneableOpenSupport(CloneableOpenSupport.Env env)
New support for a given environment.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterRedirect(CloneableOpenSupport redirectedTo)
Called to notify that another redirected CloneableOpenSupport was opened instead of this one.
|
protected boolean |
canClose()
Should test whether all data is saved, and if not, prompt the user
to save.
|
boolean |
close()
Closes all components.
|
protected boolean |
close(boolean ask)
Closes all opened windows.
|
protected abstract CloneableTopComponent |
createCloneableTopComponent()
A method to create a new component.
|
void |
edit()
Focuses existing component to view, or if none exists creates new.
|
protected abstract String |
messageOpened()
Message to display when an object has been opened.
|
protected abstract String |
messageOpening()
Message to display when an object is being opened.
|
void |
open()
Opens and focuses or just focuses already opened
CloneableTopComponent . |
protected CloneableTopComponent |
openCloneableTopComponent()
Simply open for an editor.
|
void |
view()
Focuses existing component to view, or if none exists creates new.
|
protected CloneableOpenSupport.Env env
protected CloneableTopComponent.Ref allEditors
final
.
Internally the instance is used as WeakListener
on Env
validity changes.
Changing the instance in subclasses would lead to breaking
of that listening, thus to errorneous behaviour.public CloneableOpenSupport(CloneableOpenSupport.Env env)
env
- environment to take all date from/topublic void open()
CloneableTopComponent
.
Note: The actual processing of this method is scheduled into AWT thread in case it is called from other than the AWT thread.
public void view()
CloneableOpenSupport.open()
.Viewable.view()
public void edit()
CloneableOpenSupport.open()
.Editable.edit()
public boolean close()
true
if every component is successfully closed or false
if the user cancelled the requestClosable.close()
protected boolean close(boolean ask)
ask
- true if we should ask userprotected boolean canClose()
true
.true
if everything can be closedprotected final CloneableTopComponent openCloneableTopComponent()
protected abstract CloneableTopComponent createCloneableTopComponent()
protected abstract String messageOpening()
protected abstract String messageOpened()
protected void afterRedirect(CloneableOpenSupport redirectedTo)
redirectedTo
- redirected instance which was opened instead of this one