Extension SDK

oracle.jdevimpl.uieditor
Class UIEditor

java.lang.Object
  extended byoracle.ide.addin.AbstractView
      extended byoracle.ide.editor.AbstractEditor
          extended byoracle.jdevimpl.uieditor.UIEditor
All Implemented Interfaces:
ADAPaletteListener, Editor, Helpable, LayoutSelector, Observer, Subview, View

public final class UIEditor
extends AbstractEditor
implements ADAPaletteListener

Editor implementation whose visuals depict the GUI declared in a JavaSourceNode instance. This implementation presents a canvas upon which individual Component instances are parented in their specified layout as derived from the class member declarations and the property set statements found in the jbInit method.

Whenever this Editor is the active View, it will host additional menus in the View menu of the main menubar. A context menu is also offered allowing quick access to some actions.


Nested Class Summary
 
Nested classes inherited from class oracle.ide.editor.AbstractEditor
AbstractEditor.LayoutData
 
Field Summary
static java.lang.String MODEL_NAME
           
 
Fields inherited from class oracle.ide.editor.AbstractEditor
_context, _editorFrame, CUSTOM_BORDER
 
Fields inherited from class oracle.ide.addin.AbstractView
owner, SEPARATOR, viewListeners, viewSelectionListeners
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
UIEditor()
          Constructor.
 
Method Summary
 void activate()
          Respond to a user activation of this Editor via such actions as selecting our Tab from an EditorFrame.
 void addViewSelectionListener(ViewSelectionListener l)
          Add a ViewSelectionListener.
 void changeSelection(Element node, boolean isShift, boolean isCtrl)
           
 void changeSelection(oracle.jdevimpl.uieditor.uicanvas.ModelNode target, java.awt.Point offset, java.awt.Dimension size)
           
 void close()
          Closes the view
 void commit(java.lang.String caption)
           
 void deactivate()
          Respond to a user deactivate of this Editor via such actions as selecting another View.
 void defaultCreate(PaletteEvent e)
          Notify listeners that an Item has been selected using the ENTER key on the component palette.
 UIEditorCanvas getActiveCanvas()
           
 oracle.jdeveloper.cmt.CmtComponentModel getComponentModel()
           
 Controller getController()
          Get the Controller associated with this View.
 java.awt.Component getDefaultFocusComponent()
          This method is used to know what component should get the focus by default.
static LogPage getErrorLog()
           
 java.awt.Component getGUI()
          Get the GUI root for this View.
 HelpInfo getHelpInfo()
           
 java.lang.String getModelName()
           
 Element[] getSelection()
          Gets the selection context.
 oracle.jdeveloper.cmt.CmtSubcomponent[] getSubcomponents()
          Returns an array of CmtSubcomponents belonging to the current Component under design
 javax.swing.Icon getTabIcon()
          Get the Icon to use when displaying this View as a tab in a JTabbedPane host such as the EditorFrame.
 Toolbar getToolbar()
          Returns the toolbar associated with this view.
 boolean isSelected(Element element)
           
 void onPreferredLayoutActivate()
          Classes that extend AbstractEditor override this method to initialize their preferred layout when that layour becomes the active layout.
 void open()
          Display the GUI of the JavaSourceNode on the canvas area of this Editor.
 void open(oracle.jdeveloper.cmt.CmtComponentModel source)
          Open a given component for editing by registering a view reopens are ignored
 void setContext(Context context)
          Initialize based on the Element described by the incoming Context argument.
 void setSelection(Element[] elements)
           
 void sync()
           
 void update(java.lang.Object observed, UpdateMessage msg)
          Respond to a change in the JavaSourceNode node being depicted.
 
Methods inherited from class oracle.ide.editor.AbstractEditor
addPreferredLayoutListener, getContext, getContext, getContextMenu, getDependentDocuments, getDisplayName, getEditorFrame, getPreferredLayoutBaseName, getPreferredLayoutMap, getPreferredLayoutURL, getTabDescription, getTabLabel, getTitleLabel, getType, initializeActiveLayout, isReady, newId, owner, removePreferredLayoutListener, setOwner, setPreferredLayoutBaseName, setPreferredLayoutMap, setPreferredLayoutURL, setType
 
Methods inherited from class oracle.ide.addin.AbstractView
addViewListener, fireViewActivated, fireViewClosed, fireViewDeactivated, fireViewSelectionChanged, getId, isVisible, loadToolbar, loadToolbar, removeViewListener, removeViewSelectionListener, setId, setOwner, show, updateTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.addin.View
addViewListener, getId, removeViewListener, removeViewSelectionListener, updateTitle
 
Methods inherited from interface oracle.ide.addin.Subview
isVisible, show
 

Field Detail

MODEL_NAME

public static final java.lang.String MODEL_NAME
Constructor Detail

UIEditor

public UIEditor()
Constructor.

Method Detail

getController

public Controller getController()
Get the Controller associated with this View.

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

getGUI

public java.awt.Component getGUI()
Get the GUI root for this View.

Specified by:
getGUI in interface Subview
Returns:
the view's root graphical user interface component

getDefaultFocusComponent

public java.awt.Component getDefaultFocusComponent()
Description copied from interface: Editor
This method is used to know what component should get the focus by default. The returned component should be a child of the component returned by getGUI() or getGUI() itself and should be requestFocusable. By contract, getGUI() will always be called before getDefaultFocusComponent(). Note: This method has beem introduced because of the confusion about the View.activate() method. The activate() method tells the view that it became active but some classes used the method to actually request the focus. This resulted in the activate() method being called multiple times.

Specified by:
getDefaultFocusComponent in interface Editor
Overrides:
getDefaultFocusComponent in class AbstractEditor

getTabIcon

public javax.swing.Icon getTabIcon()
Get the Icon to use when displaying this View as a tab in a JTabbedPane host such as the EditorFrame.

Specified by:
getTabIcon in interface Editor
Overrides:
getTabIcon in class AbstractEditor
See Also:
oracle.ide.EditorFrame

setContext

public void setContext(Context context)
Initialize based on the Element described by the incoming Context argument.

Specified by:
setContext in interface Editor
Overrides:
setContext in class AbstractEditor
Parameters:
context - The representation of the JavaSourceNode node to be edited.
See Also:
Context

getHelpInfo

public HelpInfo getHelpInfo()
Specified by:
getHelpInfo in interface Helpable
Overrides:
getHelpInfo in class AbstractView

getToolbar

public Toolbar getToolbar()
Description copied from interface: View
Returns the toolbar associated with this view.

Specified by:
getToolbar in interface View
Overrides:
getToolbar in class AbstractView

getSelection

public Element[] getSelection()
Description copied from interface: View
Gets the selection context. Within a view multiple objects can be selected. This method returns a list of selected objects.

Specified by:
getSelection in interface View
Overrides:
getSelection in class AbstractView
Returns:
list of selected items in the view.

open

public void open()
Display the GUI of the JavaSourceNode on the canvas area of this Editor. The class members and their respective property sets, as found in jbInit, are read from the JavaSourceNode contained in the Element passed in via our setContext method.

Specified by:
open in interface Editor
See Also:
setContext(oracle.ide.addin.Context), JavaSourceNode

activate

public void activate()
Respond to a user activation of this Editor via such actions as selecting our Tab from an EditorFrame.

Specified by:
activate in interface View
Overrides:
activate in class AbstractView
See Also:
oracle.ide.EditorFrame

deactivate

public void deactivate()
Respond to a user deactivate of this Editor via such actions as selecting another View.

Specified by:
deactivate in interface View
Overrides:
deactivate in class AbstractView
See Also:
activate()

addViewSelectionListener

public void addViewSelectionListener(ViewSelectionListener l)
Description copied from interface: View
Add a ViewSelectionListener.

Specified by:
addViewSelectionListener in interface View
Overrides:
addViewSelectionListener in class AbstractView
Parameters:
l - the ViewSelectionListener to add.

sync

public void sync()

update

public void update(java.lang.Object observed,
                   UpdateMessage msg)
Respond to a change in the JavaSourceNode node being depicted.

Specified by:
update in interface Observer
Parameters:
observed - The JavaSourceNode being observed.
msg - what has changed.
See Also:
UpdateMessage

getActiveCanvas

public UIEditorCanvas getActiveCanvas()

getErrorLog

public static LogPage getErrorLog()

getModelName

public java.lang.String getModelName()

getComponentModel

public oracle.jdeveloper.cmt.CmtComponentModel getComponentModel()
                                                          throws oracle.jdeveloper.cmt.CmtParseException
Throws:
oracle.jdeveloper.cmt.CmtParseException

getSubcomponents

public oracle.jdeveloper.cmt.CmtSubcomponent[] getSubcomponents()
Returns an array of CmtSubcomponents belonging to the current Component under design


setSelection

public void setSelection(Element[] elements)

open

public void open(oracle.jdeveloper.cmt.CmtComponentModel source)
Open a given component for editing by registering a view reopens are ignored


close

public void close()
Description copied from interface: Subview
Closes the view

Specified by:
close in interface Subview
Overrides:
close in class AbstractEditor

isSelected

public boolean isSelected(Element element)

changeSelection

public void changeSelection(Element node,
                            boolean isShift,
                            boolean isCtrl)

changeSelection

public void changeSelection(oracle.jdevimpl.uieditor.uicanvas.ModelNode target,
                            java.awt.Point offset,
                            java.awt.Dimension size)

commit

public void commit(java.lang.String caption)

onPreferredLayoutActivate

public void onPreferredLayoutActivate()
Description copied from class: AbstractEditor
Classes that extend AbstractEditor override this method to initialize their preferred layout when that layour becomes the active layout.

Overrides:
onPreferredLayoutActivate in class AbstractEditor

defaultCreate

public void defaultCreate(PaletteEvent e)
Description copied from interface: ADAPaletteListener
Notify listeners that an Item has been selected using the ENTER key on the component palette.

Specified by:
defaultCreate in interface ADAPaletteListener
Parameters:
e - Associated PaletteEvent (Palette Object)

Extension SDK

 

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