|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.windows.CloneableOpenSupport
Simple support for an openable objects.
Can be used either as an OpenCookie
,
ViewCookie
, or CloseCookie
,
depending on which cookies the subclass implements.
Nested Class Summary | |
static interface |
CloneableOpenSupport.Env
Abstract interface that is used by CloneableOpenSupport to talk to outside world. |
Field Summary | |
protected CloneableTopComponent.Ref |
allEditors
All opened editors on this file. |
protected CloneableOpenSupport.Env |
env
the environment that provides connection to outside world |
Constructor Summary | |
CloneableOpenSupport(CloneableOpenSupport.Env env)
New support for a given environment. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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.
Constructor Detail |
public CloneableOpenSupport(CloneableOpenSupport.Env env)
env
- environment to take all date from/toMethod Detail |
public 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.
OpenCookie
,
openCloneableTopComponent()
public void view()
open()
.
ViewCookie
public void edit()
open()
.
EditCookie
public boolean close()
true
if every component is successfully closed or false
if the user cancelled the requestCloseCookie
protected boolean close(boolean ask)
ask
- true if we should ask user
protected boolean canClose()
true
.
true
if everything can be closedprotected final CloneableTopComponent openCloneableTopComponent()
protected abstract CloneableTopComponent createCloneableTopComponent()
protected abstract String messageOpening()
protected abstract String messageOpened()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |