Extension SDK 9.0.5

oracle.jdeveloper.uieditor
Class AbstractCanvas

java.lang.Object
  extended byoracle.ide.addin.AbstractView
      extended byoracle.ide.explorer.AbstractExplorer
          extended byoracle.jdeveloper.uieditor.AbstractCanvas
All Implemented Interfaces:
ContextMenuListener, ControllerProvider, java.util.EventListener, Explorer, Helpable, UIEditorCanvas, View, ViewSelectionListener

public abstract class AbstractCanvas
extends AbstractExplorer
implements UIEditorCanvas, ViewSelectionListener, ContextMenuListener

AbstractCanvas provides an implementation of UIEditorCanvas based upon AbstractExplorer which provides a default implementation for all UIEditorCanvas behavior. Integrators are encouraged to extend this class for any UIEditorCanvas introduced.

See Also:
UIEditorCanvas, AbstractExplorer

Field Summary
protected  UIEditor editor
          UIEditor to which this canvas is associated.
protected  CmtModel model
          Current model being rendered by this canvas.
protected static IdeAction SERIALIZE_ACTION
          IdeAction for serializing a selected GUI control.
static javax.swing.JMenuItem SERIALIZE_ITEM
          Item to appear in main menu for serializing a selected GUI control.
static int X_MARGIN
          The horizontal inset to use when redering a GUI on a UIEditorCanvas.
static int Y_MARGIN
          The vertical inset to use when rendering a GUI on a UIEditorCanvas.
 
Fields inherited from class oracle.ide.explorer.AbstractExplorer
defaultDocument, defaultProject, defaultTitle, defaultWorkspace
 
Fields inherited from class oracle.ide.addin.AbstractView
owner, SEPARATOR, viewListeners, viewSelectionListeners
 
Fields inherited from interface oracle.ide.explorer.Explorer
CLOSED, HIDDEN, SHOWN
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
protected AbstractCanvas()
          Constructor.
 
Method Summary
 void close()
          Respond to the associated UIEditor closing.
 Context getContext()
          Get the Context.
 Context getContext(java.util.EventObject e)
          Get the Context relative to the given event.
 Controller getController()
          Gets the Controller associated with this view.
 java.awt.Component getDefaultFocusComponent()
          Get the Component that should reciev focus upon activation of this canvas.
 CmtModel getModel()
          Get the current model being rendered.
 Element[] getSelection()
          Get the current selection.
 UIEditor getUIEditor()
          Get the UIEditor associated with this UIEditorCanvas.
 boolean handleDefaultAction(Context context)
          Handle the default action of the UIEditor ContextMenu.
 void poppingDown(ContextMenu cMenu)
          Respond to the UIEditor ContextMenu popping down.
 void poppingUp(ContextMenu cMenu)
          Respond to the UIEditor ContextMenu popping up.
 void setContext(Context context)
          Set the Context.
 void setModel(CmtModel model)
          Set the current model to render.
 void setOwner(View owner)
          Set the owning View.
 void stateChanged(int state)
          Respond to a change of state between hidden, shown or closed.
 void viewSelectionChanged(ViewSelectionEvent e)
          Respond to a ViewSelectionEvent in our associated UIEditor by firing our own ViewSelectionEvent reflecting the new selection.
 
Methods inherited from class oracle.ide.explorer.AbstractExplorer
getContextMenu, getTitle
 
Methods inherited from class oracle.ide.addin.AbstractView
activate, addViewListener, addViewSelectionListener, deactivate, fireViewActivated, fireViewClosed, fireViewDeactivated, fireViewSelectionChanged, getHelpInfo, getId, getToolbar, isVisible, loadToolbar, loadToolbar, newId, owner, removeViewListener, removeViewSelectionListener, setId, setToolbarVisible, show, updateTitle, updateToolbarActions, updateVisibleActions, updateVisibleActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.explorer.Explorer
getTitle
 
Methods inherited from interface oracle.ide.addin.View
activate, addViewListener, addViewSelectionListener, deactivate, getContextMenu, getGUI, getId, getToolbar, isVisible, owner, removeViewListener, removeViewSelectionListener, setToolbarVisible, show, updateTitle, updateVisibleActions
 
Methods inherited from interface oracle.ide.help.Helpable
getHelpInfo
 

Field Detail

X_MARGIN

public static final int X_MARGIN
The horizontal inset to use when redering a GUI on a UIEditorCanvas.

See Also:
Constant Field Values

Y_MARGIN

public static final int Y_MARGIN
The vertical inset to use when rendering a GUI on a UIEditorCanvas.

See Also:
Constant Field Values

SERIALIZE_ITEM

public static javax.swing.JMenuItem SERIALIZE_ITEM
Item to appear in main menu for serializing a selected GUI control.


SERIALIZE_ACTION

protected static IdeAction SERIALIZE_ACTION
IdeAction for serializing a selected GUI control.


editor

protected UIEditor editor
UIEditor to which this canvas is associated.


model

protected CmtModel model
Current model being rendered by this canvas.

Constructor Detail

AbstractCanvas

protected AbstractCanvas()
Constructor. Protected access to prevent direct creation.

Method Detail

getUIEditor

public final UIEditor getUIEditor()
Get the UIEditor associated with this UIEditorCanvas.

Specified by:
getUIEditor in interface UIEditorCanvas
Returns:
the UIEditor associated with this UIEditorCanvas

getController

public Controller getController()
Gets the Controller associated with this view. By default returns null.

Specified by:
getController in interface ControllerProvider
Overrides:
getController in class AbstractExplorer
Returns:
the Controller associated with this view.

getContext

public final Context getContext()
Get the Context.

Specified by:
getContext in interface View
Overrides:
getContext in class AbstractView
Returns:
the Context.
See Also:
getContext(EventObject)

getContext

public Context getContext(java.util.EventObject e)
Get the Context relative to the given event. This is useful when processing input events such as MouseEvent.

Specified by:
getContext in interface View
Parameters:
e - the event to be considered.
Returns:
the Context.
See Also:
getContext()

setContext

public void setContext(Context context)
Set the Context. If the View of the Context is a UIEditor, then it will be stored in the editor member.

Specified by:
setContext in interface Explorer
Overrides:
setContext in class AbstractExplorer
Parameters:
context - the Context to depict.
See Also:
editor, getContext(), getContext(EventObject)

setOwner

public void setOwner(View owner)
Set the owning View. Will add this as a ContextMenuListener to the ContextMenu of the given View.

Specified by:
setOwner in interface Explorer
Overrides:
setOwner in class AbstractExplorer
Parameters:
owner - the owning View.
See Also:
AbstractView.owner, ContextMenuListener

getSelection

public Element[] getSelection()
Get the current selection.

Specified by:
getSelection in interface View
Overrides:
getSelection in class AbstractView
Returns:
the current selection.

getModel

public CmtModel getModel()
Get the current model being rendered.

Specified by:
getModel in interface UIEditorCanvas
Returns:
the current model being rendered.
See Also:
model, setModel(oracle.jdeveloper.cmt.CmtModel)

setModel

public void setModel(CmtModel model)
Set the current model to render.

Specified by:
setModel in interface UIEditorCanvas
Parameters:
model - the model to render.
See Also:
model, getModel()

getDefaultFocusComponent

public java.awt.Component getDefaultFocusComponent()
Get the Component that should reciev focus upon activation of this canvas.

Specified by:
getDefaultFocusComponent in interface UIEditorCanvas
Returns:
the Component to receive focus.

viewSelectionChanged

public void viewSelectionChanged(ViewSelectionEvent e)
Respond to a ViewSelectionEvent in our associated UIEditor by firing our own ViewSelectionEvent reflecting the new selection.

Specified by:
viewSelectionChanged in interface ViewSelectionListener
Parameters:
e - ViewSelectionEvent upon the UIEditor

stateChanged

public void stateChanged(int state)
Respond to a change of state between hidden, shown or closed. Add/Remove self as a ViewSelectionListener upon our associated UIEditor.

Specified by:
stateChanged in interface Explorer
Overrides:
stateChanged in class AbstractExplorer
Parameters:
state - the new state.
See Also:
editor, ViewSelectionListener

close

public void close()
Respond to the associated UIEditor closing. Remove self as both a ViewSelectionListener and a ContextMenuListener.

Specified by:
close in interface View
Overrides:
close in class AbstractView
See Also:
ViewSelectionListener, ContextMenuListener

poppingUp

public void poppingUp(ContextMenu cMenu)
Respond to the UIEditor ContextMenu popping up. By default does nothing.

Specified by:
poppingUp in interface ContextMenuListener
Parameters:
cMenu - the ContextMenu popping up.

poppingDown

public void poppingDown(ContextMenu cMenu)
Respond to the UIEditor ContextMenu popping down. By default does nothing.

Specified by:
poppingDown in interface ContextMenuListener
Parameters:
cMenu - the ContextMenu popping up.

handleDefaultAction

public boolean handleDefaultAction(Context context)
Handle the default action of the UIEditor ContextMenu. By default does nothing.

Specified by:
handleDefaultAction in interface ContextMenuListener
Parameters:
context - the Context upon which to perform the default action.
Returns:
true if action has been handled.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.