Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.jdeveloper.uieditor
Class AbstractCanvas

java.lang.Object
  extended by oracle.ide.view.View
      extended by oracle.ide.explorer.Explorer
          extended by oracle.jdeveloper.uieditor.UIEditorCanvas
              extended by oracle.jdeveloper.uieditor.AbstractCanvas
All Implemented Interfaces:
java.util.EventListener, ContextMenuListener, ControllerProvider, Helpable, ViewSelectionListener
Direct Known Subclasses:
UICanvas

public abstract class AbstractCanvas
extends UIEditorCanvas
implements ViewSelectionListener, ContextMenuListener

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

See Also:
UIEditorCanvas, Explorer

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.Explorer
CLOSED, defaultNode, defaultProject, defaultWorkspace, HIDDEN, SHOWN
 
Fields inherited from class oracle.ide.view.View
EMPTY_SELECTION, PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
protected AbstractCanvas()
          Constructor.
 
Method Summary
 void close()
          Respond to the associated UIEditor closing.
 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.
protected  Element[] getSelectionFromUI()
          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 menuWillHide(ContextMenu cMenu)
          Respond to the UIEditor ContextMenu popping down.
 void menuWillShow(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.Explorer
getContextMenu, getTitle
 
Methods inherited from class oracle.ide.view.View
activate, addViewListener, addViewSelectionListener, addViewStateListener, deactivate, fireViewCollapsed, fireViewExpanded, fireViewSelectionChanged, getContext, getGUI, getHelpInfo, getId, getSelection, getTabName, getToolbar, getViewWithoutDecoration, isVisible, loadLayout, loadManifestToolbar, loadManifestToolbar, newId, owner, removeViewListener, removeViewSelectionListener, removeViewStateListener, saveLayout, scheduleUpdateSelection, setId, setToolbarVisible, show, toString, updateSelection, updateSelectionImpl, updateTitle, updateToolbarActions, updateVisibleActions, updateVisibleActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 class 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 Explorer
Returns:
the Controller associated with this view.

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.

Overrides:
getContext in class View
Parameters:
e - the event to be considered.
Returns:
the Context.
See Also:
View.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.

Overrides:
setContext in class Explorer
Parameters:
context - the Context to depict.
See Also:
editor, View.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.

Overrides:
setOwner in class Explorer
Parameters:
owner - the owning View.
See Also:
oracle.ide.addin.View#owner(), oracle.ide.addin.ContextMenuListener

getSelectionFromUI

protected Element[] getSelectionFromUI()
Get the current selection.

Overrides:
getSelectionFromUI in class View
Returns:
the current selection.

getModel

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

Specified by:
getModel in class 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 class 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 class 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.

Overrides:
stateChanged in class Explorer
Parameters:
state - the new state.
See Also:
editor, oracle.ide.addin.ViewSelectionListener

close

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

Overrides:
close in class View
See Also:
oracle.ide.addin.ViewSelectionListener, oracle.ide.addin.ContextMenuListener

menuWillShow

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

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

menuWillHide

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

Specified by:
menuWillHide 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.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

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