|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JInternalFrame | +--kiwi.ui.WorkspaceEditor
An abstract class that defines common behavior for all workspace editors.
This class should be extended to provide the appropriate user interface and
behavior for editing a specific type of problem domain object. Editors
are managed by a WorkspaceManager
, which provides some
rudimentary inter-editor coordination, persistence support, and other
useful facilities.
WorkspaceManager
, Serialized FormInner classes inherited from class javax.swing.JInternalFrame |
JInternalFrame.AccessibleJInternalFrame,
JInternalFrame.JDesktopIcon |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
protected Object |
object
The problem domain object associated with this editor. |
Fields inherited from class javax.swing.JInternalFrame |
closable,
CONTENT_PANE_PROPERTY,
desktopIcon,
FRAME_ICON_PROPERTY,
frameIcon,
GLASS_PANE_PROPERTY,
iconable,
IS_CLOSED_PROPERTY,
IS_ICON_PROPERTY,
IS_MAXIMUM_PROPERTY,
IS_SELECTED_PROPERTY,
isClosed,
isIcon,
isMaximum,
isSelected,
LAYERED_PANE_PROPERTY,
maximizable,
MENU_BAR_PROPERTY,
resizable,
ROOT_PANE_PROPERTY,
rootPane,
rootPaneCheckingEnabled,
title,
TITLE_PROPERTY |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
WorkspaceEditor()
Construct a new WorkspaceEditor with a default window title. |
|
WorkspaceEditor(String title)
Construct a new editable WorkspaceEditor with the given
window title. |
|
WorkspaceEditor(String title,
boolean editable)
Construct a new WorkspaceEditor with the given window
title and editable mode. |
Method Summary | |
void |
actionPerformed(ActionEvent evt)
Handle events. |
void |
beginFocus()
Give keyboard focus to the first text input component in this editor. |
protected abstract Component |
buildEditingUI()
Build the editing UI. |
protected JMenuBar |
buildMenuBar()
Construct the menu bar for this editor. |
void |
copy()
Invoke a copy action on this editor. |
void |
cut()
Invoke a cut action on this editor. |
protected void |
fireStateChanged()
Fire an editor state changed event. |
Object |
getObject()
Get the current problem domain object associated with this editor, or null if there is no object associated with the editor. |
protected WorkspaceManager |
getWorkspaceManager()
Get the WorkspaceManager for this editor. |
boolean |
hasUnsavedChanges()
Determine if this editor is displaying unsaved changes. |
boolean |
isEditable()
Determine if the editor is editable. |
void |
paste()
Invoke a paste action on this editor. |
protected void |
registerMouseInputComponent(Component c)
Register a mouse input component. |
protected void |
registerTextInputComponent(JTextComponent c)
Register a text input component. |
abstract boolean |
save()
Persist the edits made in this editor. |
protected void |
setChangesMade(boolean flag)
Set the changes made flag on this editor. |
protected void |
setComment(String comment)
Set the comment that appears in the top portion of the editor. |
void |
setObject(Object object)
Set the problem domain object to be associated with this editor. |
protected void |
startEditing()
Start editing in this editor. |
protected void |
stopEditing()
Start editing in this editor. |
protected abstract void |
updateEditingUI()
Update the editing UI. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected Object object
Constructor Detail |
public WorkspaceEditor()
WorkspaceEditor
with a default window title.
It is created as editable.public WorkspaceEditor(String title)
WorkspaceEditor
with the given
window title.title
- The title for the editor's window.public WorkspaceEditor(String title, boolean editable)
WorkspaceEditor
with the given window
title and editable mode.title
- The title for the editor's window.editable
- A flag specifying whether the editor will be editable.Method Detail |
protected final WorkspaceManager getWorkspaceManager()
WorkspaceManager
for this editor. The method will
return null if the editor has not yet been added to a workspace
(that is, a JDesktopPane
).protected abstract Component buildEditingUI()
protected abstract void updateEditingUI()
protected void setComment(String comment)
protected JMenuBar buildMenuBar()
public final void beginFocus()
registerTextInputComponent()
.public void actionPerformed(ActionEvent evt)
public final Object getObject()
setObject(java.lang.Object)
public final void setObject(Object object)
updateEditingUI()
.object
- The new object to be associated with this editor.getObject()
public final boolean hasUnsavedChanges()
setChangesMade(boolean)
protected final void setChangesMade(boolean flag)
flag
- The new value for the flag.hasUnsavedChanges()
public abstract boolean save()
public final boolean isEditable()
protected final void registerTextInputComponent(JTextComponent c)
c
- The component to register.registerMouseInputComponent(java.awt.Component)
protected final void registerMouseInputComponent(Component c)
c
- The component to register.registerTextInputComponent(javax.swing.text.JTextComponent)
protected void startEditing()
stopEditing()
protected void stopEditing()
startEditing()
public final void copy()
public final void cut()
public final void paste()
protected final void fireStateChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |