| java.lang.Object org.netbeans.modules.visualweb.api.designerapi.DesignerServiceHack
All known Subclasses: org.netbeans.modules.visualweb.designer.jsf.DesignerServiceHackImpl,
DesignerServiceHack | abstract public class DesignerServiceHack (Code) | |
XXX Important note: Avoid using this service (module).
It hides cyclic dependency issue, i.e. it is an architectural flaw.
If you depend on this module, it indicates the problem, and it needs to be solved other way!
(E.g. There will be created appropriate api from designer module directly for some cases.
The other cases should use different approach)
This interface exposes services the page designer can perform.
The designer will register an implementation of this interface
in the system file system, so using org.openide.util.Lookup on
DesignerService.class you'll get an instance you can call these
methods on.
author: Tor Norbye |
Method Summary | |
abstract public boolean | canDrop(DataFlavor flavor) Return true iff we can drop the given transferable on the current
designer. | abstract public void | copyBoxForElement(Element fromElement, Element toElement) XXX Do not use, this is only temporary, until the markup impl is moved into designer,
or prepared better solution. | abstract public void | drop(Transferable transferable) | abstract public MarkupDesignBean | getCellBean(Object tableInfo, int row, int column) Return the bean for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The bean for the given cell, or null if thiscell is not a cell origin (e.g. | abstract public Element | getCellElement(Object tableInfo, int row, int column) Return the element for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The element for the given cell, or null if thiscell is not a cell origin (e.g. | abstract public int | getColSpan(Object tableInfo, int row, int column) | abstract public int | getColumnCount(Object tableInfo) Return the number of columns in the given table. | abstract public FileObject | getContextFileForFragmentFile(FileObject fragmentFile) | abstract public Image | getCssPreviewImage(String cssStyle, String[] cssStyleClasses, MarkupDesignBean bean, int width, int height) Compute a preview image of the requested size for the given DesignBean,
applying the given cssStyle string. | abstract public Image | getCssPreviewImage(Map<String, String> properties, URL base, int width, int height) Compute a preview image of the requested size for the given set
of CSS properties. | abstract public FileObject | getCurrentFile() Return the currently showing designer's FileObject. | public static DesignerServiceHack | getDefault() | abstract public FileObject | getExternalFormFileForElement(Element element) | abstract public Image | getPageBoxPreviewImage(DataObject dobj, int width, int height) Computes a preview image of the specified size for given DataObject .
the image or null if the specified DataObject is not a webform one. | abstract public int | getRowCount(Object tableInfo) Return the number of rows in the given table. | abstract public int | getRowSpan(Object tableInfo, int row, int column) | abstract public Object | getTableInfo(MarkupDesignBean bean) Compute table information for a given bean. | abstract public void | notifyCssEdited(DataObject dobj) Notify the designer that the given CSS file has been edited. |
DesignerServiceHack | public DesignerServiceHack()(Code) | | |
canDrop | abstract public boolean canDrop(DataFlavor flavor)(Code) | | Return true iff we can drop the given transferable on the current
designer. If no current page is showing, this will return null regardless
of the given transferable. Note also that this method returning true
is not a guarantee that a transferable of the given flavor will
be accepted; the actual transferable needs to be investigated since
for example some container components refuse children except for certain
subtypes, and this can't be inferred from all DataFlavors.
Note that flavor may be null if you only want to check if there's
a currently showing canvas that could -potentially- receive a drop.
Parameters: a - flavor to check if can be dropped on the canvas. Can be null tocheck if there's a visible designer accepting drops. |
copyBoxForElement | abstract public void copyBoxForElement(Element fromElement, Element toElement)(Code) | | XXX Do not use, this is only temporary, until the markup impl is moved into designer,
or prepared better solution.
|
drop | abstract public void drop(Transferable transferable)(Code) | | Drop the given Transferable somewhere on the form (it will use the
topmost form)
Parameters: transferable - The transferable to be dropped somewhere on the designer |
getCellBean | abstract public MarkupDesignBean getCellBean(Object tableInfo, int row, int column)(Code) | | Return the bean for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The bean for the given cell, or null if thiscell is not a cell origin (e.g. it is a continued cell viaa colspan or rowspan.) |
getCellElement | abstract public Element getCellElement(Object tableInfo, int row, int column)(Code) | | Return the element for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The element for the given cell, or null if thiscell is not a cell origin (e.g. it is a continued cell viaa colspan or rowspan.) |
getColSpan | abstract public int getColSpan(Object tableInfo, int row, int column)(Code) | | Return the colspan for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The colspan for the given cell. |
getColumnCount | abstract public int getColumnCount(Object tableInfo)(Code) | | Return the number of columns in the given table.
Parameters: tableInfo - See getTableInfo The number of actual columns shown in the table |
getContextFileForFragmentFile | abstract public FileObject getContextFileForFragmentFile(FileObject fragmentFile)(Code) | | |
getCssPreviewImage | abstract public Image getCssPreviewImage(String cssStyle, String[] cssStyleClasses, MarkupDesignBean bean, int width, int height)(Code) | | Compute a preview image of the requested size for the given DesignBean,
applying the given cssStyle string.
cssStyleClasses: THIS HAS NOT YET BEEN IMPLEMENTED!
|
getCssPreviewImage | abstract public Image getCssPreviewImage(Map<String, String> properties, URL base, int width, int height)(Code) | | Compute a preview image of the requested size for the given set
of CSS properties. The visual elements included in the preview depends
on the CSS properties present. For example, if the property map
includes only a background color, the preview will simply be a rectangle
showing that color. If the property map has a property related to
text (such as color, or font size, or even a text transform), some
sample text will be included, and so on.
Parameters: properties - A map containing String keys and String values, wherethe keys represent CSS property names (these must be lower case)and the values represent values for the CSS properties, using validCSS syntax. NOTE: Shorthand properties (see the CSS spec)should NOT be passed in as keys; instead you must pass in the individualCSS properties for the shorthand property. Use theDesignContext.convertCssStyleToMap method to split a Stylestring if necessary. Parameters: base - A base url to resolve relative urls against. You typically passin the URL of the stylesheet here Parameters: width - The requested width of the preview image Parameters: height - The requested height of the preview image |
getCurrentFile | abstract public FileObject getCurrentFile()(Code) | | Return the currently showing designer's FileObject.
This will return the FileObject for the JSP or HTML file being edited,
not the corresponding Page Bean's Java file.
You can for example find out the current project by passing this
file to org.netbeans.api.project.FileOwnerQuery.
The current jsp/html file being edited, or null if there is nocurrently open AND showing designer. |
getExternalFormFileForElement | abstract public FileObject getExternalFormFileForElement(Element element)(Code) | | |
getPageBoxPreviewImage | abstract public Image getPageBoxPreviewImage(DataObject dobj, int width, int height)(Code) | | Computes a preview image of the specified size for given DataObject .
the image or null if the specified DataObject is not a webform one. |
getRowCount | abstract public int getRowCount(Object tableInfo)(Code) | | Return the number of rows in the given table.
Parameters: tableInfo - See getTableInfo The number of actual rows shown in the table |
getRowSpan | abstract public int getRowSpan(Object tableInfo, int row, int column)(Code) | | Return the rowspan for the cell at the given row or column
Parameters: tableInfo - See getTableInfo Parameters: row - The row number (virtual, not in the model.) Parameters: col - The column number (virtual, not in the model.) The rowspan for the given cell. |
getTableInfo | abstract public Object getTableInfo(MarkupDesignBean bean)(Code) | | Compute table information for a given bean. NOTE: The bean
must be a visible bean in the designer.
The return value is an opaque object that clients should
not attempt to interpret; however it can be passed to multiple
other methods in this interface to compute specific information
about the table. This allows the expensive table computation
to be performed only once and then various pieces extracted from it
at low cost.
|
notifyCssEdited | abstract public void notifyCssEdited(DataObject dobj)(Code) | | Notify the designer that the given CSS file has been edited. This should
be called for every edit and is intended to be a lightweight call.
(In particular, this should not only be called when the file becomes modified
since the designer is always reflecting the current buffer contents, not the
last saved version, so even when an already modified file is modified again
we need to be notified in order to update the designer view if ncessary
(e.g. if visible)
|
|
|