| java.lang.Object org.netbeans.modules.visualweb.designer.jsf.FacesDndSupport
All known Subclasses: org.netbeans.modules.visualweb.designer.jsf.DomSynchronizer,
FacesDndSupport | class FacesDndSupport (Code) | | Support of DnD for FacesModel .
XXX Originaly in the designer, then moved into insync, and then into designer/jsf.
author: Peter Zavadsky author: Tor Norbye (old original code) |
Inner Class :public interface Location | |
Inner Class :public interface UpdateSuspender | |
Inner Class :public static class DropInfo | |
Method Summary | |
public void | addPropertyChangeListener(PropertyChangeListener l) | public boolean | canImport(JComponent comp, DataFlavor[] flavors, Transferable transferable) XXX The JComponent has to be replaced by element. | public int | computeActions(DesignBean droppee, Transferable transferable) | public void | fireRefreshNeeded(boolean refreshAll) | public String[] | getClasses(DisplayItem[] items) | public static MarkupPosition | getDefaultMarkupPositionUnderParent(DesignBean parent) | public static DataFlavor | getImportFlavor(DataFlavor[] flavors) XXX This method is a consequence of not having swing component tree
corresponding to css boxes,
that's why we can't get in TransferHander.canImport(JComponent, DataFlavor[])
the notion above which jsf component the drag/drop is.
It needs to be changed later, or at least hacked here. | public void | handleLinks(DesignBean droppee, List beans, UpdateSuspender updateSuspender) | public boolean | importData(Designer designer, JComponent comp, Transferable t, Point canvasPos, Node documentPosNode, int documentPosOffset, Dimension dropSize, boolean isGrid, Element droppeeElement, DesignBean droppeeBean, DesignBean defaultParent, UpdateSuspender updateSuspender, int dropAction) | public void | importString(Designer designer, String string, Point canvasPos, Node documentPosNode, int documentPosOffset, Dimension dropSize, boolean isGrid, Element droppeeElement, DesignBean droppeeBean, DesignBean defaultParent, UpdateSuspender updateSuspender) | public static boolean | isImage(String extension) | public static boolean | isStylesheet(String extension) | public void | moveBeans(DesignBean[] beans, DesignBean parent, MarkupPosition pos, UpdateSuspender updateSuspender) Move the given beans to the given parent and markup position. | public void | notifyBeansDesigner(DesignBean[] designBeans, DesignBean select) | public DesignBean[] | pasteBeans(Transferable t, DesignBean parent, MarkupPosition pos, Point location, UpdateSuspender updateSuspender) Paste the beans in the given transferable to the given parent
and markup position. | public int | processLinks(Element origElement, Class[] classes, List beans, boolean selectFirst, boolean handleLinks, boolean showLinkTarget, UpdateSuspender updateSuspender) Multi-function method dealing with link handling for components.
I used to have separate methods which accomplished various aspects of link
handling, but these would vary slightly in how they handled certain aspects
and as a result inconsistent handling would result. | public void | removePropertyChangeListener(PropertyChangeListener l) |
DROP_DENIED | final public static int DROP_DENIED(Code) | | State indicating that a drop is not allowed
|
DROP_LINKED | final public static int DROP_LINKED(Code) | | State indicating that the drop is allowed and the bean will be
parented by one of the beans under the cursor
|
DROP_PARENTED | final public static int DROP_PARENTED(Code) | | State indicating that the drop is allowed and will cause a link
|
PROPERTY_DROP_TARGET | final public static String PROPERTY_DROP_TARGET(Code) | | |
PROPERTY_INLINE_EDIT | final public static String PROPERTY_INLINE_EDIT(Code) | | |
PROPERTY_REFRESH | final public static String PROPERTY_REFRESH(Code) | | |
PROPERTY_SELECTED_DESIGN_BEAN | final public static String PROPERTY_SELECTED_DESIGN_BEAN(Code) | | |
FacesDndSupport | public FacesDndSupport(JsfForm jsfForm)(Code) | | Creates a new instance of FacesDnDSupport
|
canImport | public boolean canImport(JComponent comp, DataFlavor[] flavors, Transferable transferable)(Code) | | XXX The JComponent has to be replaced by element. so it is possible
to react exactly.
This method indicates if a component would accept an import of the given
set of data flavors prior to actually attempting to import it.
Parameters: comp - The component to receive the transfer. Thisargument is provided to enable sharing of TransferHandlers bymultiple components. Parameters: flavors - The data formats available true if the data can be inserted into the component, false otherwise. |
fireRefreshNeeded | public void fireRefreshNeeded(boolean refreshAll)(Code) | | |
getImportFlavor | public static DataFlavor getImportFlavor(DataFlavor[] flavors)(Code) | | XXX This method is a consequence of not having swing component tree
corresponding to css boxes,
that's why we can't get in TransferHander.canImport(JComponent, DataFlavor[])
the notion above which jsf component the drag/drop is.
It needs to be changed later, or at least hacked here. For that reason
this method usage is not sufficient for correct evaluation.
Try to find a flavor that can be used to import a Transferable.
The set of usable flavors are tried in the following order:
- First, an attempt is made to find a flavor matching the content type
of the EditorKit for the component.
- Second, an attempt to find a text/plain flavor is made.
- Third, an attempt to find a flavor representing a String reference
in the same VM is made.
- Lastly, DataFlavor.stringFlavor is searched for.
|
handleLinks | public void handleLinks(DesignBean droppee, List beans, UpdateSuspender updateSuspender)(Code) | | Handle links where the target is a possibly nonvisual bean so has no element
|
importData | public boolean importData(Designer designer, JComponent comp, Transferable t, Point canvasPos, Node documentPosNode, int documentPosOffset, Dimension dropSize, boolean isGrid, Element droppeeElement, DesignBean droppeeBean, DesignBean defaultParent, UpdateSuspender updateSuspender, int dropAction)(Code) | | |
importString | public void importString(Designer designer, String string, Point canvasPos, Node documentPosNode, int documentPosOffset, Dimension dropSize, boolean isGrid, Element droppeeElement, DesignBean droppeeBean, DesignBean defaultParent, UpdateSuspender updateSuspender)(Code) | | |
isImage | public static boolean isImage(String extension)(Code) | | Return true if the extension indicates that this is an image
|
isStylesheet | public static boolean isStylesheet(String extension)(Code) | | |
processLinks | public int processLinks(Element origElement, Class[] classes, List beans, boolean selectFirst, boolean handleLinks, boolean showLinkTarget, UpdateSuspender updateSuspender)(Code) | | Multi-function method dealing with link handling for components.
I used to have separate methods which accomplished various aspects of link
handling, but these would vary slightly in how they handled certain aspects
and as a result inconsistent handling would result. Thus, all the logic is handled
by the same method -- both "previewing" what links are available as well as actually
handling the linking. The flags control the behaviors.
Parameters: origElement - The first/innermost element to start with when searchingthe bean hierarchy for DesignBean and MarkupMouseRegions willing to linkthe given beans or bean classes. Parameters: classes - Array of classes to be checked for link eligibility. This isseparate from beans because we often want to check if linking is possiblebefore we actually have created beans -- such as when we're about todrag & drop. Obviously in this case we can't perform linking. Thisparameter can be null but then beans must not be null. Parameters: beans - Can be null, but if not, should correspond exactly to the classesparameter -- same length, same order, etc. This list must be specifiedif handleLinks is true; you can't link on just class names. Parameters: selectFirst - If set, don't ask the user which target to use if there are multiplepossibilities; just pick the first one. If not set, all eligible link handlersin the parent chain up from the original element will be checked, and if more thanone is willing to link, the user will be presented with a list and asked to choose. Parameters: handleLinks - If true, actually perform the linking. Parameters: showLinkTarget - If true, highlihght the link target and region. Also sets therecentDropTarget field. DROP_DENIED if no beans/classes were linkable for any mouse regions orDesignBeans; otherwise returns DROP_LINKED. If showLinkTarget is set, recentDropTargetwill be set to the most recent such eligible DesignBean. |
|
|