|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.core.commands.common.EventManager org.eclipse.jface.action.AbstractAction org.eclipse.jface.action.Action com.ibm.designer.domino.xsp.api.palette.XPagesPaletteDropActionDelegate
public class XPagesPaletteDropActionDelegate
A generic drop action delegate used by the XPages editor when dropping controls from the Controls Palette onto an XPage. This drop action takes care of ensuring that a namespace definition exists on the page for the tag that is being dropped. This drop action also populates the tag being dropped onto the page with all of the default attributes that are defined as required by that tag. This drop action also ensure that a unique id is defined for the tag (or var if the tag is a data source). Finally this drop action takes care of formatting the newly inserted tag correctly.
Field Summary |
---|
Fields inherited from interface org.eclipse.jface.action.IAction |
---|
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
---|---|
XPagesPaletteDropActionDelegate()
Creates a new instance of this class. |
Method Summary | |
---|---|
protected org.w3c.dom.Element |
createElement(org.w3c.dom.Document doc,
java.lang.String prefix)
Creates a new DOM element. |
protected void |
fillDefaultProperties(org.w3c.dom.Element element)
Populates the element with default values for properties that are defined as 'required' in the FacesRegistry. |
protected FacesDefinition |
findGlobalDefAndAddDependency()
Determines if the tag (returned from getUri() and getTagName() ) belongs to
a library that has not yet been added as a dependency of the current application. |
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
org.eclipse.gef.commands.CommandStack |
getCommandStack()
Returns the GEF CommandStack for the current editor. |
org.eclipse.swt.widgets.Control |
getControl()
Returns the palette control. |
DesignerProject |
getDesignerProject()
Returns the DesignerProject that represents the current application. |
org.w3c.dom.Document |
getDocument()
Returns the document associated with the current XPage |
org.eclipse.ui.IEditorPart |
getEditorPart()
Returns the editor part for the currently active editor. |
org.eclipse.swt.dnd.DropTargetEvent |
getEvent()
Returns the event information about the current drop action. |
protected FacesDefinition |
getFacesDefinition()
Returns the faces definition for the control being dropped onto the page. |
FacesRegistry |
getFacesRegistry()
|
org.w3c.dom.Node |
getFocusedNode()
Returns the node that has focus when the drop action occurred. |
org.eclipse.swt.graphics.Point |
getPosition()
Returns a point that represents the editor location where the drop is to occur |
protected java.lang.String |
getPrefix()
Returns the prefix for the tag that is to be inserted. |
org.w3c.dom.ranges.Range |
getRange()
Returns the range of nodes currently selected. |
org.w3c.dom.Node |
getSelectedNodeFromSource()
If the editor is in source mode (e.g. |
java.lang.String |
getTagName()
Returns the tag name (XML local name) of the tag being dropped from the palette. |
java.lang.String |
getUri()
Returns the URI that corresponds to the tag/control being dropped. |
void |
run()
This method is responsible for executing the command that inserts the item being dropped from the palette onto the page. |
void |
setAdapter(java.lang.Object adapter)
Used internally by the drop action delegate code. |
void |
setCommandStack(org.eclipse.gef.commands.CommandStack commandStack)
Sets the GEF CommandStack that is to be used for the current operation |
void |
setControl(org.eclipse.swt.widgets.Control control)
Sets the control that may be used later in the drop operation to surface further UI, such as a dialog box. |
void |
setDesignerProject(DesignerProject designerProject)
Sets the DesignerProject for the current action. |
void |
setDocument(org.w3c.dom.Document document)
Sets the DOM document for the current operation. |
void |
setEditorPart(org.eclipse.ui.IEditorPart editor)
Sets the editor associated with this action. |
void |
setTagName(java.lang.String tagName)
Set the tag name that is to be inserted in the page. |
void |
setUri(java.lang.String uri)
Set the URI corresponding to the tag that is to be inserted in the page. |
Methods inherited from class org.eclipse.jface.action.Action |
---|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
Methods inherited from class org.eclipse.jface.action.AbstractAction |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.action.IAction |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public XPagesPaletteDropActionDelegate()
Method Detail |
---|
protected org.w3c.dom.Element createElement(org.w3c.dom.Document doc, java.lang.String prefix)
doc
- the XPage documentprefix
- the tag prefix based on the namespace URI
protected void fillDefaultProperties(org.w3c.dom.Element element)
element
- the element that is about to be inserted into the XPageprotected FacesDefinition findGlobalDefAndAddDependency() throws java.lang.IllegalArgumentException
getUri()
and getTagName()
) belongs to
a library that has not yet been added as a dependency of the current application. If the tag
is a member of a library that is not a dependency of this application, then the user will be
prompted to add the library as a dependency of the current application. If the user declines
this operation (cancels) then an IllegalArgumentException is generated.
java.lang.IllegalArgumentException
- throws IllegalArgumentException if the user cancels when prompted to add the new external
library as a dependency of the current application.public java.lang.Object getAdapter(java.lang.Class adapter)
public org.eclipse.gef.commands.CommandStack getCommandStack()
public org.eclipse.swt.widgets.Control getControl()
Composite c = new Composite(control.getShell, SWT.NONE);
).
public DesignerProject getDesignerProject()
DesignerProject
public org.w3c.dom.Document getDocument()
public org.eclipse.ui.IEditorPart getEditorPart()
public org.eclipse.swt.dnd.DropTargetEvent getEvent()
protected FacesDefinition getFacesDefinition()
public FacesRegistry getFacesRegistry()
public org.w3c.dom.Node getFocusedNode()
public org.eclipse.swt.graphics.Point getPosition()
protected java.lang.String getPrefix()
getUri()
public org.w3c.dom.ranges.Range getRange()
public org.w3c.dom.Node getSelectedNodeFromSource()
public java.lang.String getTagName()
public java.lang.String getUri()
public void run()
createElement(Document, String)
is called by the run method, clients may override this method
to create their own element. Similarly clients may override fillDefaultProperties(Element)
in
order to add default properties to the tag being inserted.
createElement(Document, String)
which is to be inserted at the drop targetfillDefaultProperties(Element)
)
run
in interface org.eclipse.jface.action.IAction
run
in class org.eclipse.jface.action.Action
public final void setAdapter(java.lang.Object adapter)
adapter
- public void setCommandStack(org.eclipse.gef.commands.CommandStack commandStack)
commandStack
- public void setControl(org.eclipse.swt.widgets.Control control)
control
- public void setDesignerProject(DesignerProject designerProject)
designerProject
- a DesignerProject representing the current ApplicationDesignerProject
public void setDocument(org.w3c.dom.Document document)
document
- public void setEditorPart(org.eclipse.ui.IEditorPart editor)
editor,
- may not be null
java.lang.NullPointerException
- throws a NullPointerException if the IEditorPart parameter is NULLpublic void setTagName(java.lang.String tagName)
tagName
- public void setUri(java.lang.String uri)
uri
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |