JBoss Tools SVN: r7421 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-04-08 11:03:01 -0400 (Tue, 08 Apr 2008)
New Revision: 7421
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/toolBar/toolBar.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1969, styles added, size attributes fixed, itemSeparator height fixed.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/toolBar/toolBar.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/toolBar/toolBar.css 2008-04-08 14:52:32 UTC (rev 7420)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/toolBar/toolBar.css 2008-04-08 15:03:01 UTC (rev 7421)
@@ -1,5 +1,17 @@
+.dr-toolbar-ext {
+ border:1px solid;
+ border-color:#C4C0B9;
+ padding:0px;
+ background-color:#D4CFC7;
+ background-position:top left;
+ background-repeat:repeat-x;
+}
-.dr-toolbar-ext{
-border:1px solid;border-color:#C4C0B9;padding:0px;background-color:#D4CFC7;background-position:top left;background-repeat:repeat-x;}
.dr-toolbar-int{
-font-size:11px;color:#000000;font-weight:bold;font-family:Arial, Verdana, sans-serif;padding:2px 10px 2px 10px;white-space:nowrap;}
\ No newline at end of file
+ font-size:11px;
+ color:#000000;
+ font-weight:bold;
+ font-family:Arial, Verdana, sans-serif;
+ padding:2px 10px 2px 10px;
+ white-space:nowrap;
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2008-04-08 14:52:32 UTC (rev 7420)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2008-04-08 15:03:01 UTC (rev 7421)
@@ -28,14 +28,22 @@
import org.w3c.dom.NodeList;
public class RichFacesToolBarGroupTemplate extends VpeAbstractTemplate {
- public static final String TAG_NAME = "toolBarGroup";
- public static final String ATTR_ITEMSEPARATOR_NAME = "itemSeparator";
+ public static final String TAG_NAME = "toolBarGroup"; //$NON-NLS-1$
+ public static final String ATTR_ITEMSEPARATOR_NAME = "itemSeparator"; //$NON-NLS-1$
+ public static final String ATTR_LOCATION_NAME = "location"; //$NON-NLS-1$
+ public static final String ATTR_LOCATION_RIGHT_VALUE = "right"; //$NON-NLS-1$
+
+ private static final String TOOLBAR_PARENT_WARNING = "Parent should be toolBar"; //$NON-NLS-1$
- public static final String ATTR_LOCATION_NAME = "location";
+ private static final String CSS_DR_TOOLBAR_INT = "dr-toolbar-int"; //$NON-NLS-1$
+ private static final String CSS_RICH_TOOLBAR_ITEM = "rich-toolbar-item"; //$NON-NLS-1$
- public static final String ATTR_LOCATION_RIGHT_VALUE = "right";
+ private static final String SPACE = " "; //$NON-NLS-1$
+ private static final String EMPTY = ""; //$NON-NLS-1$
+ private static final String GROUP_TABLE_STYLE = "border: 0px none; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; width: 100%; height: 100%"; //$NON-NLS-1$
+
private class SourceToolBarGroupItem {
private Node toolBarGroupItem;
private String itemSeparator;
@@ -138,8 +146,8 @@
Element sourceElement = (Element)sourceNode;
String itemSeparator = sourceElement.getAttribute(ATTR_ITEMSEPARATOR_NAME);
- if (!sourceNode.getParentNode().getNodeName().endsWith(":" + RichFacesToolBarTemplate.TAG_NAME)) {
- visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument, "Parent should be toolBar");
+ if (!sourceNode.getParentNode().getNodeName().endsWith(":" + RichFacesToolBarTemplate.TAG_NAME)) { //$NON-NLS-1$
+ visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument, TOOLBAR_PARENT_WARNING);
creationData = new VpeCreationData(visualNode);
} else {
itemSeparator = RichFacesToolBarTemplate.checkAndUpdateItemSeparatorName(itemSeparator);
@@ -149,7 +157,7 @@
visualNode = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- visualNode.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "border: 0px none; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;");
+ visualNode.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, GROUP_TABLE_STYLE);
nsIDOMElement body = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
nsIDOMElement row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
row.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN, HtmlComponentUtil.HTML_ATTR_VALIGN_MIDDLE_VALUE);
@@ -162,13 +170,30 @@
nsIDOMElement cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
if (toolBarGroupItem.isItem()) {
- ComponentUtil.correctAttribute(sourceElement, cell,
- RichFacesToolBarTemplate.CONTENTCLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-toolbar-int rich-toolbar-item", "dr-toolbar-int rich-toolbar-item");
- ComponentUtil.correctAttribute(sourceElement, cell,
- RichFacesToolBarTemplate.CONTENTSTYLE_ATTR_NAME,
- HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
-
+
+ Node parentNode = sourceElement.getParentNode();
+
+ String styleClass = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ String style = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ if (null == styleClass) {
+ styleClass = EMPTY;
+ }
+ if (null == style) {
+ style = EMPTY;
+ }
+ if ((null != parentNode) && (parentNode instanceof Element)) {
+ String contentClass = ((Element)parentNode).getAttribute(RichFacesToolBarTemplate.CONTENTCLASS_ATTR_NAME);
+ String contentStyle = ((Element)parentNode).getAttribute(RichFacesToolBarTemplate.CONTENTSTYLE_ATTR_NAME);
+ if (null != contentClass) {
+ styleClass += SPACE + contentClass;
+ }
+ if (null != contentStyle) {
+ style += SPACE + contentStyle;
+ }
+ }
+ styleClass += SPACE + CSS_DR_TOOLBAR_INT + SPACE + CSS_RICH_TOOLBAR_ITEM;
+ cell.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ cell.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
childrenInfo.addSourceChild(toolBarGroupItem.getToolBarGroupItem());
@@ -181,6 +206,7 @@
.getSeparatorImageUrlString(toolBarGroupItem.getItemSeparator());
nsIDOMElement separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(separatorImage, separatorImageUrl);
+ visualNode.appendChild(separatorImage);
cell.appendChild(separatorImage);
}
@@ -202,7 +228,7 @@
return null;
}
- String parentNodeName = prefix + ":" + RichFacesToolBarTemplate.TAG_NAME;
+ String parentNodeName = prefix + ":" + RichFacesToolBarTemplate.TAG_NAME; //$NON-NLS-1$
Node parent = sourceNode.getParentNode();
while (parent != null) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2008-04-08 14:52:32 UTC (rev 7420)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2008-04-08 15:03:01 UTC (rev 7421)
@@ -28,29 +28,36 @@
import org.w3c.dom.NodeList;
public class RichFacesToolBarTemplate extends VpeAbstractTemplate {
- public static final String TAG_NAME = "toolBar";
+ public static final String TAG_NAME = "toolBar"; //$NON-NLS-1$
- public static final String ITEM_SEPARATOR_NONE = "none";
- public static final String ITEM_SEPARATOR_LINE = "line";
- public static final String ITEM_SEPARATOR_GRID = "grid";
- public static final String ITEM_SEPARATOR_DISC = "disc";
- public static final String ITEM_SEPARATOR_SQUARE = "square";
+ public static final String ITEM_SEPARATOR_NONE = "none"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_LINE = "line"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_GRID = "grid"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_DISC = "disc"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_SQUARE = "square"; //$NON-NLS-1$
- public static final String ITEM_SEPARATOR_LINE_URL = "toolBar/separatorLine.gif";
- public static final String ITEM_SEPARATOR_GRID_URL = "toolBar/separatorGrid.gif";
- public static final String ITEM_SEPARATOR_DISC_URL = "toolBar/separatorDisc.gif";
- public static final String ITEM_SEPARATOR_SQUARE_URL = "toolBar/separatorSquare.gif";
+ public static final String ITEM_SEPARATOR_LINE_URL = "toolBar/separatorLine.gif"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_GRID_URL = "toolBar/separatorGrid.gif"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_DISC_URL = "toolBar/separatorDisc.gif"; //$NON-NLS-1$
+ public static final String ITEM_SEPARATOR_SQUARE_URL = "toolBar/separatorSquare.gif"; //$NON-NLS-1$
- public static final String EXCEPTION_ATTR_STYLE_VALUE = "color: red; font-weight:bold;";
+ public static final String EXCEPTION_ATTR_STYLE_VALUE = "color: red; font-weight:bold;"; //$NON-NLS-1$
- static final String CONTENTCLASS_ATTR_NAME = "contentClass";
- static final String CONTENTSTYLE_ATTR_NAME = "contentStyle";
- static final String STYLECLASS_ATTR_NAME = "styleClass";
- static final String STYLE_ATTR_NAME = "style";
- static final String ITEMSEPARATOR_ATTR_NAME = "itemSeparator";
- static final String SEPARATORCLASS_ATTR_NAME = "separatorClass";
- static final String WIDTH_ATTR_NAME = "width";
- static final String HEIGHT_ATTR_NAME = "height";
+ static final String CONTENTCLASS_ATTR_NAME = "contentClass"; //$NON-NLS-1$
+ static final String CONTENTSTYLE_ATTR_NAME = "contentStyle"; //$NON-NLS-1$
+ static final String STYLECLASS_ATTR_NAME = "styleClass"; //$NON-NLS-1$
+ static final String STYLE_ATTR_NAME = "style"; //$NON-NLS-1$
+ static final String ITEMSEPARATOR_ATTR_NAME = "itemSeparator"; //$NON-NLS-1$
+ static final String SEPARATORCLASS_ATTR_NAME = "separatorClass"; //$NON-NLS-1$
+ static final String WIDTH_ATTR_NAME = "width"; //$NON-NLS-1$
+ static final String HEIGHT_ATTR_NAME = "height"; //$NON-NLS-1$
+
+ private static final String CSS_DR_TOOLBAR_INT = "dr-toolbar-int"; //$NON-NLS-1$
+ private static final String CSS_DR_TOOLBAR_EXT = "dr-toolbar-ext"; //$NON-NLS-1$
+ private static final String CSS_RICH_TOOLBAR = "rich-toolbar"; //$NON-NLS-1$
+ private static final String CSS_RICH_TOOLBAR_ITEM = "rich-toolbar-item"; //$NON-NLS-1$
+
+ private static final String SPACE = " "; //$NON-NLS-1$
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
VpeCreationData creationData = null;
@@ -63,21 +70,22 @@
SourceToolBarItems sourceToolBarItems = new SourceToolBarItems(sourceNode, itemSeparator);
String itemSeparatorImageUrl = getSeparatorImageUrlString(sourceToolBarItems.getItemSeparator());
- ComponentUtil.setCSSLink(pageContext, "toolBar/toolBar.css", "richFacesToolBar");
+ ComponentUtil.setCSSLink(pageContext, "toolBar/toolBar.css", "richFacesToolBar"); //$NON-NLS-1$ //$NON-NLS-2$
visualNode = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
ComponentUtil.correctAttribute(sourceElement, visualNode,
WIDTH_ATTR_NAME,
- HtmlComponentUtil.HTML_WIDTH_ATTR, null, "100%");
+ HtmlComponentUtil.HTML_WIDTH_ATTR, null, "100%"); //$NON-NLS-1$
ComponentUtil.correctAttribute(sourceElement, visualNode,
HEIGHT_ATTR_NAME,
HtmlComponentUtil.HTML_HEIGHT_ATTR, null, null);
ComponentUtil.correctAttribute(sourceElement, visualNode,
- STYLECLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-toolbar-ext rich-toolbar", "dr-toolbar-ext rich-toolbar");
+ STYLECLASS_ATTR_NAME, HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_DR_TOOLBAR_EXT + SPACE + CSS_RICH_TOOLBAR,
+ CSS_DR_TOOLBAR_EXT + SPACE + CSS_RICH_TOOLBAR);
- String style = ComponentUtil.getHeaderBackgoundImgStyle() + ";";
+ String style = ComponentUtil.getHeaderBackgoundImgStyle() + ";"; //$NON-NLS-1$
ComponentUtil.correctAttribute(sourceElement, visualNode,
STYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR, style, style);
@@ -99,13 +107,15 @@
cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
if (toolBarItem.isItem()) {
ComponentUtil.correctAttribute(sourceElement, cell,
- CONTENTCLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-toolbar-int rich-toolbar-item", "dr-toolbar-int rich-toolbar-item");
+ CONTENTCLASS_ATTR_NAME,
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_DR_TOOLBAR_INT + SPACE + CSS_RICH_TOOLBAR_ITEM,
+ CSS_DR_TOOLBAR_INT + SPACE + CSS_RICH_TOOLBAR_ITEM);
ComponentUtil.correctAttribute(sourceElement, cell,
CONTENTSTYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR,
- toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null,
- toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null);
+ toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null, //$NON-NLS-1$
+ toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null); //$NON-NLS-1$
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
@@ -113,11 +123,13 @@
} else {
if (itemSeparatorImageUrl != null) {
cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- cell.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, HtmlComponentUtil.HTML_ALIGN_CENTER_VALUE);
+ cell.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR,
+ HtmlComponentUtil.HTML_ALIGN_CENTER_VALUE);
ComponentUtil.correctAttribute(sourceElement, cell,
SEPARATORCLASS_ATTR_NAME,
HtmlComponentUtil.HTML_CLASS_ATTR, null, null);
- nsIDOMElement separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement separatorImage = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(separatorImage, itemSeparatorImageUrl);
cell.appendChild(separatorImage);
}
@@ -128,7 +140,7 @@
// Empty column
cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- cell.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%");
+ cell.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%"); //$NON-NLS-1$
row.appendChild(cell);
iterator = sourceToolBarItems.getRightItemsIterator();
@@ -138,12 +150,12 @@
if (toolBarItem.isItem()) {
ComponentUtil.correctAttribute(sourceElement, cell,
CONTENTCLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-toolbar-int rich-toolbar-item", "dr-toolbar-int rich-toolbar-item");
+ HtmlComponentUtil.HTML_CLASS_ATTR, CSS_DR_TOOLBAR_INT + SPACE + CSS_RICH_TOOLBAR_ITEM, CSS_DR_TOOLBAR_INT + SPACE + CSS_RICH_TOOLBAR_ITEM);
ComponentUtil.correctAttribute(sourceElement, cell,
CONTENTSTYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR,
- toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null,
- toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null);
+ toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null, //$NON-NLS-1$
+ toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null); //$NON-NLS-1$
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
@@ -374,7 +386,7 @@
if (toolBarItem.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) toolBarItem;
- this.isToolBarGroupItem = element.getNodeName().endsWith(":" + RichFacesToolBarGroupTemplate.TAG_NAME);
+ this.isToolBarGroupItem = element.getNodeName().endsWith(":" + RichFacesToolBarGroupTemplate.TAG_NAME); //$NON-NLS-1$
if (isToolBarGroupItem()) {
isToolBarItemLocationRight = RichFacesToolBarGroupTemplate
.ATTR_LOCATION_RIGHT_VALUE
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-04-08 14:52:32 UTC (rev 7420)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-04-08 15:03:01 UTC (rev 7421)
@@ -204,8 +204,8 @@
<vpe:template class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesToolBarTemplate"
children="yes" modify="no">
<vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
</vpe:resize>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
17 years, 8 months
JBoss Tools SVN: r7420 - trunk/struts/docs/struts_tools_ref_guide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-04-08 10:52:32 -0400 (Tue, 08 Apr 2008)
New Revision: 7420
Removed:
trunk/struts/docs/struts_tools_ref_guide/en/modules/struts_tools.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - the chapter was splited into several ones
Deleted: trunk/struts/docs/struts_tools_ref_guide/en/modules/struts_tools.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/struts_tools.xml 2008-04-08 14:49:46 UTC (rev 7419)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/struts_tools.xml 2008-04-08 14:52:32 UTC (rev 7420)
@@ -1,944 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="struts_tools">
- <?dbhtml filename="struts_tools.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Developer Studio</keyword>
- <keyword>Eclipse</keyword>
- <keyword>Struts Tools</keyword>
- <keyword>Java</keyword>
- <keyword>JBoss</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Struts support</title>
-
- <section id="WorkingWithStrutsProjects866">
-
- <title>Working with Projects</title>
-
- <para>JBoss Developer Studio provides the following functionality when working with
- Struts:</para>
-
- <itemizedlist>
- <listitem>
- <para>Create new <property>Struts projects</property></para>
- </listitem>
- <listitem>
- <para>Import (open) existing Struts projects. You can import any
- project structure</para>
- </listitem>
- <listitem>
- <para>Add <property>Struts capabilities</property> to any existing
- Eclipse project</para>
- </listitem>
- <listitem>
- <para>Import and add Struts capabilities to any existing project
- created outside Eclipse.</para>
- </listitem>
- </itemizedlist>
-
-
- <section id="CreatingANewStrutsProjec745t">
-
- <title>Creating a New Struts Project</title>
-
-
- <para>JBoss Developer Studio includes a New Struts Project Wizard that
- radically simplifies the process for getting started with a new
- Struts project. You just need to follow these steps:</para>
- <itemizedlist>
- <listitem>
- <para>Select<emphasis>
- <property>File > New > Project...</property>
- </emphasis> from the menu bar. Then, select <emphasis>
- <property>JBoss Tools Web > Struts > Struts
- Project</property>
- </emphasis> in this dialog box. Click <emphasis>
- <property>Next</property>:
- </emphasis></para>
- </listitem>
- </itemizedlist>
- <figure>
- <title>Selecting Struts Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem>
- <para>On this form, provide the <property>Project
- Name</property>. You can also select where to create
- the project or use the default path.</para>
- <para>Next to <property>Struts Environment</property> set
- which Struts version to use.</para>
- </listitem>
- </itemizedlist>
-
- <figure>
- <title>Creating Struts Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <tip>
- <title>Tip:</title>
- <para>Don't put spaces in project names since some OS could
- experience problems with their processing and searching
- these files.</para>
- </tip>
-
- <para>You can select the KickStart template, then the project created will
- include a simple Hello World type application that is ready to run.</para>
-
- <figure>
- <title>Choosing Struts Template </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_3_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <itemizedlist>
- <listitem>
- <para>Next, you register this application with the current
- servlet container defined for your workspace (JBoss
- AS, by default) in order to allow you to test your
- application more easily while still developing it. A
- new entry will be added in the servlet container
- configuration file to enable running the application
- in-place (called null deployment or link
- deployment). Uncheck the <emphasis role="italic">
- <property>"Target
- Server"</property>
- </emphasis> check box if for some reason you
- don't want to register your application at
- this point.</para>
- </listitem>
- </itemizedlist>
- <figure>
- <title>Registering The Project at Server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem>
- <para>On the next form, you can select the TLD files to
- include in this project:</para>
- </listitem>
- </itemizedlist>
- <figure>
- <title>Selecting Tag Libraries</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>After the project is created, you should have the following project
- structure (if you used the KickStart template):</para>
-
- <figure>
- <title>Project Structure</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <tip>
- <title>Tip:</title>
- <para>If you want to hide the jar files from Web App Libraries in
- view, select the down-pointing arrow in the upper right
- corner, select <emphasis>Filters...</emphasis>, check the
- box next to Name filter patterns (matching names will be
- hidden), and type *.jar into the field. Then, click OK.
- </para>
- </tip>
- </section>
- <section id="ImportingAnExistingStrutsProjectWithAnyStructure9653">
-
- <title>Importing an Existing Struts Project with Any Structure</title>
-
- <para>For detailed information on migration projects to JBoss Developer
- Studio see <ulink
- url="../../../Exadel-migration/en/html_single/index.html"
- >Migration Guide</ulink>.</para>
-
- </section>
- <section id="AddingStrutsCapabilityToAnExistingWebApplication532">
-
- <title>Adding Struts Capability to an Existing Web Application</title>
-
- <para>With JBoss Developer Studio you can add <property>Struts
- capabilities</property> (including Struts libraries, tag libraries
- and a Struts configuration file) to any existing Web application
- project in your Eclipse workspace. By adding a Struts Nature to your
- project, you can now edit files using JBoss Developer Studio
- editors, such as the Struts configuration editor and the JBoss Tools
- JSP editor.</para>
- <para>To add Struts Nature to your existing Project right-click the project
- and select <emphasis>
- <property>JBoss Tools > Add Struts Capabilities</property>
- </emphasis> from the context menu. This will start the process of
- adding all necessary libraries and files to make this a Web Struts
- project.</para>
-
- <figure>
- <title>Adding Struts Capabilities</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>In the wizard you should point to location of your deployment
- descriptor file web.xml and name of the project.</para>
-
- <figure>
- <title>Choosing Project Location</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>After hitting <emphasis>
- <property>Next</property>, </emphasis> you will see the
- following screen. This screen simply means that you need to add at
- least one Struts module to your project to make this project a
- Struts project. Adding a Struts module means that a new
- struts-config.xml will be added to your project and registered in
- the web.xml file. In addition, all required Struts libraries will be
- added. To add a Struts module, select the <emphasis>
- <property>Add Struts Support</property>
- </emphasis> button.</para>
- <figure>
- <title>Project Modules</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_9.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Here you can select what Struts <property>Version</property>,
- <property>Servlet Class</property>, <property>URL
- Pattern</property> and <property>TLD</property>s to add to this
- project.</para>
-
- <figure>
- <title>Selecting Struts Support Options</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_10.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>When done, you will see the default Struts module configuration
- information. See how to Edit <link
- linkend="SupportForMultipleStrutsModules75">Struts
- modules</link>.</para>
-
- <figure>
- <title>Project Configuration Information</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_11.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>On the last screen you can set the different folders for your project
- as well as register this application with a servlet container. If
- you want the libraries (.jar files) will be automatically added to
- your project, click on the checkbox <emphasis>
- <property>Add Libraries</property>.</emphasis></para>
-
- <figure>
- <title>Registering the Project at Server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_12.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>When done, you can open end edit the struts-config.xml file using
- usefull Struts configuration file editor provided by JBDS. (The
- Struts configuration is shown below in the Tree viewer).</para>
-
- <figure>
- <title>Struts-config.xml File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_13.png"
- scale="75"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="GraphicalEditorForStrutsConfigurationFiles564">
-
- <title>Graphical Editor for Struts Configuration Files</title>
-
- <para>The Struts configuration file editor has three modes with different
- representation of <emphasis>
- <property>struts-config.xml</property>: </emphasis>Diagram, Tree and
- Source. The modes can be selected via the tabs at the bottom of the editor.
- Any changes made in one mode are immediately visible when you switch to any
- other mode.</para>
-
- <para>When working in Source view, you always have all the following features
- available:</para>
- <itemizedlist>
- <listitem>
- <para>Content Assist</para>
- </listitem>
- <listitem>
- <para>Open On Selection</para>
- </listitem>
- <listitem>
- <para>File Folding</para>
- </listitem>
- </itemizedlist>
- <section id="StrutsDiagramMode453">
-
- <title>Diagram Mode</title>
-
- <para>The Diagram mode graphically displays the Web flow of the application
- defined in the Struts configuration file.</para>
-
- <figure>
- <title>Diagram Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_14.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The Diagram mode allows to edit navigation in your Struts application.
- Just by right-clicking anywhere on the diagram, you can use a
- context menu to create the building blocks of a Struts application:</para>
- <itemizedlist>
- <listitem>
- <para>Actions</para>
- </listitem>
- <listitem>
- <para>Global forwards</para>
- </listitem>
- <listitem>
- <para>Global exceptions</para>
- </listitem>
- <listitem>
- <para>JSP Pages</para>
- </listitem>
- </itemizedlist>
-
- <figure>
- <title>Diagram Context Menu</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_15.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Along the upper-left side of the editor is a stack of seven icons for
- changing the behavior of the cursor in the diagram. </para>
-
- <figure>
- <title>Editor Icons</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_16.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The first icon switches to the default regular selection cursor, the
- second to the marquee selection cursor and the third to the new
- connection cursor. The last four icons switch the cursor to an
- insert cursor for each type of Struts build block listed above (and
- in the order listed).</para>
-
- <para>For instance, clicking on the first of these four icons (the one with
- the gears) will switch the cursor to insert actions. Clicking
- anywhere in the diagram with this cursor has the same effect as
- right-click and selecting <emphasis>
- <property>Add > Action...</property>
- </emphasis> from the context menu with the regular cursor active.
- It's just more efficient to use this cursor if
- you're adding more than one action at once.</para>
-
-
- </section>
- <section id="StrutsTreeMode42">
-
- <title>Tree Mode</title>
-
- <para>The Tree mode represents the different elements of the Struts
- application that are organized into functional categories on the
- left-hand side and a form for editing the properties of currently
- selected items on the right-hand side.</para>
-
- <figure>
- <title>Tree Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_17.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can also right-click on any node in the category tree and perform
- appropriate operations through a context menu. For instance, by
- right-clicking on the action-mappings category node, you can add new
- actions to the application.</para>
-
- <figure>
- <title>Tree Context Menu</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_18.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="StrutsSourceMode9655">
-
- <title>Source Mode</title>
-
- <para>In the Source mode, you have complete editing control of the
- underlying XML coding.</para>
-
- <figure>
- <title>Source Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_19.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can take advantage of <link
- linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData"
- >code assist</link>.</para>
-
- <figure>
- <title>Code Assist</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_20.png"
- scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The editor will also immediately flag any errors.</para>
-
- <figure>
- <title>Errors in Source Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_21.png"
- scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Finally, you can use the Outline view with the editor to easily
- navigate through the file.</para>
-
- <figure>
- <title>Outline View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_22.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
-
- <para>Find more information about editor features <link linkend="editors_features"
- >here</link>.</para>
-
- </section>
-
- <section id="GraphicalEditorForTilesFiles132">
-
- <title>Graphical Editor for Tiles Files</title>
-
- <para>The Tiles configuration file editor has three main modes: Tree, Diagram and
- Source. The modes can be selected via the tabs at the bottom of the editor.
- Any changes made in one mode are immediately visible when you switch to any
- other mode.</para>
-
- <para>When working in Source view, you always have all following features available:</para>
- <itemizedlist>
- <listitem>
- <para>Content Assist</para>
- </listitem>
- <listitem>
- <para>Open On Selection</para>
- </listitem>
- </itemizedlist>
- <section id="CreateNewTilesFile1422">
-
- <title>Create New Tiles File</title>
-
- <para>To create new Tiles files, right click any folder and select <emphasis>
- <property>New > Tiles File</property>. </emphasis></para>
- <figure>
- <title>Creating a New Tiles File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_23.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="StrutsTreeView896">
-
- <title>Tree Mode</title>
-
- <para>The Tree mode represents the different elements of the Tiles file that
- are organized into functional categories on the left-hand side and a
- form for editing the properties of currently selected items on the
- right-hand side.</para>
- <figure>
- <title>Tree Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_24.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>To edit the file, simply right click any node and select among the
- available actions.</para>
- <figure>
- <title>Editing in Tiles Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_25.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="StrutsDiagramView4643">
-
- <title>Diagram Mode</title>
-
- <para>The Diagram mode allows you to create complex Tiles files in the form
- of a diagram.</para>
- <figure>
- <title>Diagram Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_26.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>To create new definitions, simply right click anywhere in the diagram.</para>
- <figure>
- <title>Creating New Definition</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_27.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can also use the Diagram toolbar to make editing easier.</para>
- <figure>
- <title>Diagram Toolbar</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_28.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> It contains four icons for changing the cursor state. The first one
- is the default cursor state for selecting existing nodes. The second
- icon is marquee selector. The third is used for creating new
- connections and the last one is for adding definition template to
- the content.</para>
- </section>
- <section id="StrutsSource75">
-
- <title>Source</title>
-
- <para>The other mode of the <property>Tiles editor</property> is the Source
- mode that gives you full control over the source. Any changes here
- will immediately appear in other modes when you switch to them.</para>
- <figure>
- <title>Source Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_29.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para><link linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData"
- >Code assist</link> is available in the Source mode.</para>
- <figure>
- <title>Code Assist</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_30.png"
- scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Any errors are immediately reported as shown below:</para>
- <figure>
- <title>Errors Reporting</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_31.png"
- scale="75"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can also use the Outline view together with the editor's
- Source mode. It provides an easier navigation through the file.</para>
- <figure>
- <title>Outline View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_32.png"
- scale="85"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="GraphicalEditorForStrutsValidationFiles86">
-
- <title>Graphical Editor for Struts Validation Files</title>
-
- <para>Providing full support for development Struts applications JBoss Developer
- Studio comes with a visual validation editor. To create a new validation
- file, right click any folder in Project Explorer and select <emphasis>
- <property>File > New > Other...</property>
- </emphasis>from the context menu and then <emphasis>
- <property>JBoss Tools Web > Struts > Validation File</property>.
- </emphasis></para>
- <figure>
- <title>Creating New Validation File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_33.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The validation editor works with five modes: Formsets, Validators, Constants
- and standard Tree and Source that you can easily switch over using tabs at
- the bottom of the editor.</para>
- <para>The Formsets mode shows forms and their elements on the left side and the
- dialogue for defining their validation rules on the right side.</para>
- <figure>
- <title>Formsets Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_34.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The Constants mode let you set constant values for your validation rules.</para>
- <figure>
- <title>Constansts Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_35.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The validation file can also be viewed in a Tree mode.</para>
- <figure>
- <title>Tree Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_36.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>At any point you have full control over the source by switching to the Source
- mode. Any editing in this mode will immediately be available in other modes
- of the editor.</para>
- <figure>
- <title>Source Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_37.png" scale="85"
- />
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can also open your own custom or Struts-standard <emphasis>
- <property>validation-rules.xml</property>
- </emphasis> file.</para>
- <para>The Validators mode shows the validation rules for a selected validator. You
- can of course add your own rules.</para>
- <figure>
- <title>Validators Mode</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_38.png" scale="75"
- />
- </imageobject>
- </mediaobject>
- </figure>
- <para>Here are the validation rules shown in the Source mode.</para>
- <figure>
- <title>Validation Rules</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_39.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="SupportForMultipleStrutsModules75">
-
- <title>Support for Multiple Struts Modules</title>
-
- <para>JBoss Developer Studio supports working with Struts projects that have
- multiple modules. You can easily do the following:</para>
- <itemizedlist>
- <listitem>
- <para>Add new modules</para>
- </listitem>
- <listitem>
- <para>Edit modules for an existing project or during Struts project
- import</para>
- </listitem>
- </itemizedlist>
-
- <section id="WhenImportingAStrutsProject432">
-
- <title>When Importing a Struts Project</title>
-
- <para>During Struts project import, if the project has multiple modules, you
- will see a screen with all existing modules. You can select each
- module and edit its details.</para>
-
- <figure>
- <title>Configuring Project Modules</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_40.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="EditingModulesInAnExistingProject1">
-
- <title>Editing Modules in an Existing Project</title>
- <para>To edit modules in an existing project, right click the project and
- select <emphasis>
- <property>JBoss Tools > Modules Configuration</property>.
- </emphasis></para>
- <figure>
- <title>Choosing Modules Configuration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_41.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>You will see the same screen as above where you will be able to select
- a module and edit its details.</para>
- <figure>
- <title>Modules Configuration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_42.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="AddingNewModules1">
-
- <title>Adding New Modules</title>
-
- <para>Adding a new module is very simple. First switch to Web Project view.
- Expand your project to the Configuration folder. Under that folder
- you should see the current modules. Right click on Configuration and
- select <emphasis>
- <property>New > Struts Config</property>. </emphasis></para>
- <figure>
- <title>Adding New Modules</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_43.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>You will see the screen below. You can specify a new module name and
- also add the new Struts configuration file to web.xml file.</para>
- <figure>
- <title>Adding New Modules</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_44.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="CodeGenerationForActionFormBeanForwardAndExceptionClasses1">
-
- <title>Code Generation for Action, FormBean, Forward and Exception Classes</title>
-
- <para>JBoss Developer Studio comes with a <property>code generation</property>
- feature. You can generate stub code for Struts Actions, FormBeans, Forwards
- and Exceptions.</para>
-
- <para>The code generation in JBoss Developer Studio is based on Velocity templates
- which can be modified for your use. The templates are located at <emphasis>
- <property> {RedHatDeveloperStudioHome} > templates >
- codegeneration</property>. </emphasis></para>
-
- <para>There are a number of ways to invoke code generation. One is simply
- right-clicking the Struts diagram and selecting <emphasis>
- <property>Generate Java Code....</property>
- </emphasis></para>
-
- <figure>
- <title>Selecting Generate Java Code</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_45.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>On this screen you can select for which elements to generate code. If you
- select Next you will be able to specify more options for each of the
- categories you selected.</para>
-
- <figure>
- <title>Generate - Step 1</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_46.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <tip>
- <title>Tip:</title>
- <para>please be careful not to override your existing files.</para>
- </tip>
-
- <para>When generation is complete, a result window will appear letting you know how
- many classes were generated:</para>
-
- <figure>
- <title>Generation Finished</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_47.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You don't always have to generate code for all elements at once. You
- can invoke generation for just an individual Struts artifact as well.
- Right-click an element on the diagram of the Struts configuration file and
- select <emphasis>
- <property>Generate Java Code...</property>
- </emphasis> from the context menu.</para>
-
- <figure>
- <title>Generation For Individual Struts Artifact</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_48.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The same can be done from within the Tree viewer for the editor of the Struts
- configuration file.</para>
-
- <figure>
- <title>Generation in Struts Config Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_49.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="StrutsConfigurationFileDebugger097">
-
- <title>Struts Configuration File Debugger</title>
-
- <para>JBoss Developer Studio comes with <property>Struts configuration file
- debugger</property>. It allows you to set break points on Struts diagram and
- then simply launch the server in debug mode.</para>
-
- <para>Simply right click an Action or a page and select Add <emphasis>
- <property>Breakpoint</property>. </emphasis></para>
- <figure>
- <title>Adding Breakpoint</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_50.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="CustomizablePageLinksRecognizer1">
-
- <title>Customizable Page Links Recognizer</title>
-
- <para><property>Custom page links</property> allow you to define custom Struts page
- links that will be recognizable in the Struts application diagram. You can
- define these links by selecting <emphasis>
- <property>Window > Preferences</property>
- </emphasis> from the menu bar and then selecting <emphasis>
- <property>JBoss Tools > Web > Struts > Customization</property>
- </emphasis> from the Preferences dialog box.</para>
- <figure>
- <title>Customization Panel</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts/struts_51.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
-
- <section>
- <title>Relevant Resources Links</title>
- <para>Find out necessary information on <ulink url="http://struts.apache.org/"
- >Struts technology</ulink> if you don't know enough.</para>
- </section>
-</chapter>
17 years, 8 months
JBoss Tools SVN: r7419 - trunk/struts/docs/struts_tools_ref_guide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-04-08 10:49:46 -0400 (Tue, 08 Apr 2008)
New Revision: 7419
Added:
trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/config_file_debugger.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/modules.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/page_links_recognizer.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/project_verification.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/rel_resources_links.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - reorganizing tthe guide structure; organizing new chapters
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="code_generation">
+ <?dbhtml filename="code_generation.html"?>
+
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Code Generation</title>
+
+ <para>JBoss Tools comes with a <property>code generation</property>
+ feature. You can generate stub code for Struts Actions, FormBeans, Forwards
+ and Exceptions.</para>
+
+ <para>The code generation that JBoss tooling provides is based on Velocity templates
+ which can be modified for your use. The templates are located at <emphasis>
+ <property> {JBossStudioHome} > templates >
+ codegeneration</property>. </emphasis></para>
+
+ <para>There are a number of ways to invoke code generation. One is simply
+ right-clicking the Struts diagram and selecting <emphasis>
+ <property>Generate Java Code....</property>
+ </emphasis></para>
+
+ <figure>
+ <title>Selecting Generate Java Code</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_45.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On this screen you can select for which elements to generate code. If you
+ select Next you will be able to specify more options for each of the
+ categories you selected.</para>
+
+ <figure>
+ <title>Generate - Step 1</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_46.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <tip>
+ <title>Tip:</title>
+ <para>please be careful not to override your existing files.</para>
+ </tip>
+
+ <para>When generation is complete, a result window will appear letting you know how
+ many classes were generated:</para>
+
+ <figure>
+ <title>Generation Finished</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_47.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You don't always have to generate code for all elements at once. You
+ can invoke generation for just an individual Struts artifact as well.
+ Right-click an element on the diagram of the Struts configuration file and
+ select <emphasis>
+ <property>Generate Java Code...</property>
+ </emphasis> from the context menu.</para>
+
+ <figure>
+ <title>Generation For Individual Struts Artifact</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_48.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The same can be done from within the Tree viewer for the editor of the Struts
+ configuration file.</para>
+
+ <figure>
+ <title>Generation in Struts Config Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_49.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+</chapter>
\ No newline at end of file
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/config_file_debugger.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/config_file_debugger.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/config_file_debugger.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="config_file_debugger">
+ <?dbhtml filename="config_file_debugger.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Struts Configuration File Debugger</title>
+
+ <para>JBoss Tools come with <property>Struts configuration file
+ debugger</property>. It allows you to set break points on Struts diagram and
+ then simply launch the server in debug mode.</para>
+
+ <para>Simply right click an Action or a page and select Add <emphasis>
+ <property>Breakpoint</property>. </emphasis></para>
+ <figure>
+ <title>Adding Breakpoint</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_50.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+</chapter>
\ No newline at end of file
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="editors">
+ <?dbhtml filename="editors.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Editors</title>
+
+ <section id="struts_config_editor">
+
+ <title>Graphical Editor for Struts Configuration Files</title>
+
+ <para>The Struts configuration file editor has three modes with different representation of <emphasis>
+ <property>struts-config.xml</property>: </emphasis>Diagram, Tree and Source. The
+ modes can be selected via the tabs at the bottom of the editor. Any changes made in one
+ mode are immediately visible when you switch to any other mode.</para>
+
+ <para>When working in Source view, you always have all the following features available:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Content Assist</para>
+ </listitem>
+ <listitem>
+ <para>Open On Selection</para>
+ </listitem>
+ <listitem>
+ <para>File Folding</para>
+ </listitem>
+ </itemizedlist>
+ <section id="StrutsDiagramMode453">
+
+ <title>Diagram Mode</title>
+
+ <para>The Diagram mode graphically displays the Web flow of the application defined in
+ the Struts configuration file.</para>
+
+ <figure>
+ <title>Diagram Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_14.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The Diagram mode allows to edit navigation in your Struts application. Just by
+ right-clicking anywhere on the diagram, you can use a context menu to create the
+ building blocks of a Struts application:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Actions</para>
+ </listitem>
+ <listitem>
+ <para>Global forwards</para>
+ </listitem>
+ <listitem>
+ <para>Global exceptions</para>
+ </listitem>
+ <listitem>
+ <para>JSP Pages</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Diagram Context Menu</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_15.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Along the upper-left side of the editor is a stack of seven icons for changing the
+ behavior of the cursor in the diagram. </para>
+
+ <figure>
+ <title>Editor Icons</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_16.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The first icon switches to the default regular selection cursor, the second to the
+ marquee selection cursor and the third to the new connection cursor. The last four
+ icons switch the cursor to an insert cursor for each type of Struts build block
+ listed above (and in the order listed).</para>
+
+ <para>For instance, clicking on the first of these four icons (the one with the gears)
+ will switch the cursor to insert actions. Clicking anywhere in the diagram with this
+ cursor has the same effect as right-click and selecting <emphasis>
+ <property>Add > Action...</property>
+ </emphasis> from the context menu with the regular cursor active. It's just
+ more efficient to use this cursor if you're adding more than one action at
+ once.</para>
+
+
+ </section>
+ <section id="StrutsTreeMode42">
+
+ <title>Tree Mode</title>
+
+ <para>The Tree mode represents the different elements of the Struts application that are
+ organized into functional categories on the left-hand side and a form for editing
+ the properties of currently selected items on the right-hand side.</para>
+
+ <figure>
+ <title>Tree Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_17.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also right-click on any node in the category tree and perform appropriate
+ operations through a context menu. For instance, by right-clicking on the
+ action-mappings category node, you can add new actions to the application.</para>
+
+ <figure>
+ <title>Tree Context Menu</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_18.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="StrutsSourceMode9655">
+
+ <title>Source Mode</title>
+
+ <para>In the Source mode, you have complete editing control of the underlying XML
+ coding.</para>
+
+ <figure>
+ <title>Source Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_19.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can take advantage of <link
+ linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData">code assist</link>.</para>
+
+ <figure>
+ <title>Code Assist</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_20.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The editor will also immediately flag any errors.</para>
+
+ <figure>
+ <title>Errors in Source Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_21.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Finally, you can use the Outline view with the editor to easily navigate through
+ the file.</para>
+
+ <figure>
+ <title>Outline View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_22.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <para>Find more information about editor features <link linkend="editors_features"
+ >here</link>.</para>
+
+ </section>
+
+ <section id="GraphicalEditorForTilesFiles132">
+
+ <title>Graphical Editor for Tiles Files</title>
+
+ <para>The Tiles configuration file editor has three main modes: Tree, Diagram and Source.
+ The modes can be selected via the tabs at the bottom of the editor. Any changes made in
+ one mode are immediately visible when you switch to any other mode.</para>
+
+ <para>When working in Source view, you always have all following features available:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Content Assist</para>
+ </listitem>
+ <listitem>
+ <para>Open On Selection</para>
+ </listitem>
+ </itemizedlist>
+ <section id="CreateNewTilesFile1422">
+
+ <title>Create New Tiles File</title>
+
+ <para>To create new Tiles files, right click any folder and select <emphasis>
+ <property>New > Tiles File</property>. </emphasis></para>
+ <figure>
+ <title>Creating a New Tiles File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_23.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="StrutsTreeView896">
+
+ <title>Tree Mode</title>
+
+ <para>The Tree mode represents the different elements of the Tiles file that are
+ organized into functional categories on the left-hand side and a form for editing
+ the properties of currently selected items on the right-hand side.</para>
+ <figure>
+ <title>Tree Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_24.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To edit the file, simply right click any node and select among the available
+ actions.</para>
+ <figure>
+ <title>Editing in Tiles Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="StrutsDiagramView4643">
+
+ <title>Diagram Mode</title>
+
+ <para>The Diagram mode allows you to create complex Tiles files in the form of a
+ diagram.</para>
+ <figure>
+ <title>Diagram Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_26.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To create new definitions, simply right click anywhere in the diagram.</para>
+ <figure>
+ <title>Creating New Definition</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_27.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also use the Diagram toolbar to make editing easier.</para>
+ <figure>
+ <title>Diagram Toolbar</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_28.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> It contains four icons for changing the cursor state. The first one is the
+ default cursor state for selecting existing nodes. The second icon is marquee
+ selector. The third is used for creating new connections and the last one is for
+ adding definition template to the content.</para>
+ </section>
+ <section id="StrutsSource75">
+
+ <title>Source</title>
+
+ <para>The other mode of the <property>Tiles editor</property> is the Source mode that
+ gives you full control over the source. Any changes here will immediately appear in
+ other modes when you switch to them.</para>
+ <figure>
+ <title>Source Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_29.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para><link linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData">Code
+ assist</link> is available in the Source mode.</para>
+ <figure>
+ <title>Code Assist</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_30.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Any errors are immediately reported as shown below:</para>
+ <figure>
+ <title>Errors Reporting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_31.png" scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also use the Outline view together with the editor's Source mode.
+ It provides an easier navigation through the file.</para>
+ <figure>
+ <title>Outline View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_32.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+
+ <section id="GraphicalEditorForStrutsValidationFiles86">
+
+ <title>Graphical Editor for Struts Validation Files</title>
+
+ <para>Providing full support for development Struts applications JBoss Tools comes with a
+ visual validation editor. To create a new validation file, right click any folder in
+ Project Explorer and select <emphasis>
+ <property>File > New > Other...</property>
+ </emphasis>from the context menu and then <emphasis>
+ <property>JBoss Tools Web > Struts > Validation File</property>. </emphasis></para>
+ <figure>
+ <title>Creating New Validation File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_33.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The validation editor works with five modes: Formsets, Validators, Constants and
+ standard Tree and Source that you can easily switch over using tabs at the bottom of the
+ editor.</para>
+ <para>The Formsets mode shows forms and their elements on the left side and the dialogue for
+ defining their validation rules on the right side.</para>
+ <figure>
+ <title>Formsets Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_34.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The Constants mode let you set constant values for your validation rules.</para>
+ <figure>
+ <title>Constansts Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_35.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The validation file can also be viewed in a Tree mode.</para>
+ <figure>
+ <title>Tree Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_36.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>At any point you have full control over the source by switching to the Source mode.
+ Any editing in this mode will immediately be available in other modes of the editor.</para>
+ <figure>
+ <title>Source Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_37.png" scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also open your own custom or Struts-standard <emphasis>
+ <property>validation-rules.xml</property>
+ </emphasis> file.</para>
+ <para>The Validators mode shows the validation rules for a selected validator. You can of
+ course add your own rules.</para>
+ <figure>
+ <title>Validators Mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_38.png" scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Here are the validation rules shown in the Source mode.</para>
+ <figure>
+ <title>Validation Rules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_39.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+</chapter>
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/modules.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/modules.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/modules.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="modules">
+ <?dbhtml filename="modules.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Modules</title>
+
+ <para>JBoss Tools support working with Struts projects that have
+ multiple modules. You can easily do the following:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Add new modules</para>
+ </listitem>
+ <listitem>
+ <para>Edit modules for an existing project or during Struts project
+ import</para>
+ </listitem>
+ </itemizedlist>
+ <para>Now, let's discuss this functionality in more detail.</para>
+ <section id="WhenImportingAStrutsProject432">
+
+ <title>When Importing a Struts Project</title>
+
+ <para>During Struts project import, if the project has multiple modules, you
+ will see a screen with all existing modules. You can select each
+ module and edit its details.</para>
+
+ <figure>
+ <title>Configuring Project Modules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_40.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="EditingModulesInAnExistingProject1">
+
+ <title>Editing Modules in an Existing Project</title>
+ <para>To edit modules in an existing project, right click the project and
+ select <emphasis>
+ <property>JBoss Tools > Modules Configuration</property>.
+ </emphasis></para>
+ <figure>
+ <title>Choosing Modules Configuration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_41.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You will see the same screen as above where you will be able to select
+ a module and edit its details.</para>
+ <figure>
+ <title>Modules Configuration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_42.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="AddingNewModules1">
+
+ <title>Adding New Modules</title>
+
+ <para>Adding a new module is very simple. First switch to Web Project view.
+ Expand your project to the Configuration folder. Under that folder
+ you should see the current modules. Right click on Configuration and
+ select <emphasis>
+ <property>New > Struts Config</property>. </emphasis></para>
+ <figure>
+ <title>Adding New Modules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_43.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You will see the screen below. You can specify a new module name and
+ also add the new Struts configuration file to web.xml file.</para>
+ <figure>
+ <title>Adding New Modules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_44.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+</chapter>
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/page_links_recognizer.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/page_links_recognizer.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/page_links_recognizer.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="page_links_recognizer">
+ <?dbhtml filename="page_links_recognizer.html"?>
+
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Customizable Page Links Recognizer</title>
+
+ <para><property>Custom page links</property> allow you to define custom Struts page
+ links that will be recognizable in the Struts application diagram. You can
+ define these links by selecting <emphasis>
+ <property>Window > Preferences</property>
+ </emphasis> from the menu bar and then selecting <emphasis>
+ <property>JBoss Tools > Web > Struts > Customization</property>
+ </emphasis> from the Preferences dialog box.</para>
+ <figure>
+ <title>Customization Panel</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_51.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+</chapter>
\ No newline at end of file
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/project_verification.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/project_verification.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/project_verification.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="project_verification">
+ <?dbhtml filename="project_verification.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Struts Project Verification</title>
+
+ <para>JBoss Tools provide the same functionality for Struts
+ projects. To configure Struts project verification select <emphasis>
+ <property>Window > Preferences</property>
+ </emphasis> from the menu bar, select <emphasis>
+ <property>JBoss Tools > Web > Verification</property>
+ </emphasis> from the Preferences dialog box and then expand the
+ Struts Rules node.</para>
+ <figure>
+ <title>Struts Rules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_8.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Suppose you are working in the Source viewer for a Struts
+ configuration file as shown below:</para>
+ <figure>
+ <title>Struts Configuration File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_9.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>While typing a class name or entering it from the graphical editor,
+ you might make a minor typo (like <emphasis role="italic">
+ <property>"sample.GreetingAction1"</property>
+ </emphasis> instead of <emphasis role="italic">
+ <property>"sample.GreetingAction"</property>
+ </emphasis>). After saving the file,
+ <property>verification</property> checks to make sure everything is
+ correct and finds the error below:</para>
+ <figure>
+ <title>Error Reporting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_10.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Notice that the Package Explorer View shows a marked folder and a
+ marked file where the error is.</para>
+ <para>You can place the cursor over the line with the error to view a
+ detailed error message:</para>
+ <figure>
+ <title>Error Message</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_11.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The verification also checks to make sure you have specified the
+ correct JSP page for the forward:</para>
+ <figure>
+ <title>JSP Page Verification</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_12.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Once you place the cursor over the line, you can see the error
+ message:</para>
+ <figure>
+ <title>Error Message</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_13.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You can always invoke the verification by switching to the Diagram
+ viewer, right-clicking and selecting <emphasis>
+ <property>Verify</property>
+ </emphasis> from the context menu:</para>
+ <figure>
+ <title>Verify Command</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_14.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+</chapter>
\ No newline at end of file
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="projects">
+ <?dbhtml filename="projects.html"?>
+
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Projects</title>
+
+ <para>JBoss Tools provides the following functionality when working with Struts:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Create new <property>Struts projects</property></para>
+ </listitem>
+ <listitem>
+ <para>Import (open) existing Struts projects. You can import any project
+ structure</para>
+ </listitem>
+ <listitem>
+ <para>Add <property>Struts capabilities</property> to any existing Eclipse
+ project</para>
+ </listitem>
+ <listitem>
+ <para>Import and add Struts capabilities to any existing project created outside
+ Eclipse.</para>
+ </listitem>
+ </itemizedlist>
+ <para>Now, we'll focus on all these points more fully.</para>
+
+ <section id="CreatingANewStrutsProjec745t">
+
+ <title>Creating a New Struts Project</title>
+
+
+ <para>JBoss Tools provides a New Struts Project Wizard that radically simplifies the process
+ for getting started with a new Struts project. You just need to follow these steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Select<emphasis>
+ <property>File > New > Project...</property>
+ </emphasis> from the menu bar. Then, select <emphasis>
+ <property>JBoss Tools Web > Struts > Struts Project</property>
+ </emphasis> in this dialog box. Click <emphasis>
+ <property>Next</property>: </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Selecting Struts Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>On this form, provide the <property>Project Name</property>. You can also
+ select where to create the project or use the default path.</para>
+ <para>Next to <property>Struts Environment</property> set which Struts version to
+ use.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Creating Struts Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <tip>
+ <title>Tip:</title>
+ <para>Don't put spaces in project names since some OS could experience problems
+ with their processing and searching these files.</para>
+ </tip>
+
+ <para>You can select the KickStart template, then the project created will include a simple
+ Hello World type application that is ready to run.</para>
+
+ <figure>
+ <title>Choosing Struts Template </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_3_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Next, you register this application with the current servlet container defined
+ for your workspace (JBoss AS, by default) in order to allow you to test your
+ application more easily while still developing it. A new entry will be added in
+ the servlet container configuration file to enable running the application
+ in-place (called null deployment or link deployment). Uncheck the <emphasis
+ role="italic">
+ <property>"Target Server"</property>
+ </emphasis> check box if for some reason you don't want to register
+ your application at this point.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Registering The Project at Server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>On the next form, you can select the TLD files to include in this
+ project:</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Selecting Tag Libraries</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>After the project is created, you should have the following project structure (if you
+ used the KickStart template):</para>
+
+ <figure>
+ <title>Project Structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <tip>
+ <title>Tip:</title>
+ <para>If you want to hide the jar files from Web App Libraries in view, select the
+ down-pointing arrow in the upper right corner, select
+ <emphasis>Filters...</emphasis>, check the box next to Name filter patterns
+ (matching names will be hidden), and type *.jar into the field. Then, click OK.
+ </para>
+ </tip>
+ </section>
+ <section id="ImportingAnExistingStrutsProjectWithAnyStructure9653">
+
+ <title>Importing an Existing Struts Project with Any Structure</title>
+
+ <para>For detailed information on migration projects to JBoss Developer Studio see <ulink
+ url="../../../Exadel-migration/en/html_single/index.html">Migration Guide</ulink>.</para>
+
+ </section>
+ <section id="AddingStrutsCapabilityToAnExistingWebApplication532">
+
+ <title>Adding Struts Capability to an Existing Web Application</title>
+
+ <para>Here, we'll consider how to add Struts functionality (Struts libraries, tag
+ libraries and a Struts configuration file) to any existing Web application project in
+ your Eclipse workspace.</para>
+
+ <para>By adding a Struts Nature to your project, you can now edit files using JBoss Tools
+ editors, such as the <link linkend="struts_config_editor">Struts configuration
+ editor</link> and the JBoss Tools JSP editor. To take advantage of this just right-click
+ the project and select <emphasis>
+ <property>JBoss Tools > Add Struts Capabilities</property>
+ </emphasis> from the context menu. This will start the process of adding all necessary
+ libraries and files to make a Web Struts project from your one.</para>
+
+ <figure>
+ <title>Adding Struts Capabilities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the wizard you should point to location of your deployment descriptor file web.xml
+ and name of the project.</para>
+
+ <figure>
+ <title>Choosing Project Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After hitting <emphasis>
+ <property>Next</property>, </emphasis> you will see the following screen. This
+ screen simply means that you need to add at least one Struts module to your project to
+ make this project a Struts project. Adding a Struts module means that a new
+ struts-config.xml will be added to your project and registered in the web.xml file. In
+ addition, all required Struts libraries will be added. To add a Struts module, select
+ the <emphasis>
+ <property>Add Struts Support</property>
+ </emphasis> button.</para>
+ <figure>
+ <title>Project Modules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_9.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Here you can select what Struts <property>Version</property>, <property>Servlet
+ Class</property>, <property>URL Pattern</property> and <property>TLD</property>s to add
+ to this project.</para>
+
+ <figure>
+ <title>Selecting Struts Support Options</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_10.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>When done, you will see the default Struts module configuration information. See how
+ to Edit <link linkend="SupportForMultipleStrutsModules75">Struts modules</link>.</para>
+
+ <figure>
+ <title>Project Configuration Information</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_11.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On the last screen you can set the different folders for your project as well as
+ register this application with a servlet container. If you want the libraries (.jar
+ files) will be automatically added to your project, click on the checkbox <emphasis>
+ <property>Add Libraries</property>.</emphasis></para>
+
+ <figure>
+ <title>Registering the Project at Server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_12.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>When done, you can open end edit the struts-config.xml file using usefull Struts
+ configuration file editor provided by JBDS. (The Struts configuration is shown below in
+ the Tree viewer).</para>
+
+ <figure>
+ <title>Struts-config.xml File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts/struts_13.png" scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+</chapter>
Added: trunk/struts/docs/struts_tools_ref_guide/en/modules/rel_resources_links.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/rel_resources_links.xml (rev 0)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/rel_resources_links.xml 2008-04-08 14:49:46 UTC (rev 7419)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="rel_resources_links">
+ <?dbhtml filename="rel_resources_links.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Struts Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Relevant Resources Links</title>
+
+ <para>Find out necessary information on <ulink url="http://struts.apache.org/">Struts
+ technology</ulink> if you don't know enough.</para>
+
+</chapter>
17 years, 8 months
JBoss Tools SVN: r7418 - trunk/struts/docs/struts_tools_ref_guide/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-04-08 10:47:50 -0400 (Tue, 08 Apr 2008)
New Revision: 7418
Modified:
trunk/struts/docs/struts_tools_ref_guide/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - reorganizing tthe guide structure; organizing new chapters
Modified: trunk/struts/docs/struts_tools_ref_guide/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-04-08 14:24:50 UTC (rev 7417)
+++ trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-04-08 14:47:50 UTC (rev 7418)
@@ -4,8 +4,14 @@
[
<!ENTITY introduction SYSTEM "modules/introduction.xml">
-<!ENTITY struts_tools SYSTEM "modules/struts_tools.xml">
-<!ENTITY struts_project_verification SYSTEM "modules/struts_project_verification.xml">
+<!ENTITY projects SYSTEM "modules/projects.xml">
+<!ENTITY editors SYSTEM "modules/editors.xml">
+<!ENTITY modules SYSTEM "modules/modules.xml">
+<!ENTITY code_generation SYSTEM "modules/code_generation.xml">
+<!ENTITY config_file_debugger SYSTEM "modules/config_file_debugger.xml">
+<!ENTITY page_links_recognizer SYSTEM "modules/page_links_recognizer.xml">
+<!ENTITY project_verification SYSTEM "modules/project_verification.xml">
+<!ENTITY rel_resources_links SYSTEM "modules/rel_resources_links.xml">
]>
<book>
<bookinfo>
@@ -22,6 +28,12 @@
<toc/>
&introduction;
- &struts_tools;
- &struts_project_verification;
+ &projects;
+ &editors;
+ &modules;
+ &code_generation;
+ &config_file_debugger;
+ &page_links_recognizer;
+ &project_verification;
+ &rel_resources_links;
</book>
\ No newline at end of file
17 years, 8 months
JBoss Tools SVN: r7417 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 10:24:50 -0400 (Tue, 08 Apr 2008)
New Revision: 7417
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
Log:
JBIDE-893
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2008-04-08 14:24:43 UTC (rev 7416)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2008-04-08 14:24:50 UTC (rev 7417)
@@ -141,6 +141,7 @@
public boolean saveLayout(XModelObject object) {
if(isLight) return true;
+ if(object == null || !object.isActive()) return false;
XModelObjectLoaderUtil util = new XModelObjectLoaderUtil();
try {
XModelObject process = object.getChildByPath(ELM_PROCESS);
17 years, 8 months
JBoss Tools SVN: r7416 - trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 10:24:43 -0400 (Tue, 08 Apr 2008)
New Revision: 7416
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/MetaModelTest.java
Log:
JBIDE-893
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/MetaModelTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/MetaModelTest.java 2008-04-08 14:24:36 UTC (rev 7415)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/MetaModelTest.java 2008-04-08 14:24:43 UTC (rev 7416)
@@ -35,7 +35,6 @@
import org.jboss.tools.common.model.event.XModelTreeListener;
import org.jboss.tools.common.model.loaders.XObjectLoader;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -280,13 +279,11 @@
int errors = 0;
for (int i = 0; i < entities.length; i++) {
XModelEntityImpl entity = (XModelEntityImpl)meta.getEntity(entities[i]);
- Class cls = entity.getImplementingClass();
- if(cls != null) {
+ if(entity.hasObjectImplementation()) {
XModelObject object = model.createModelObject(entity.getName(), null);
if(object == null) {
errors++;
- String error = entity.getName() + ":" + cls.getName();
- sb.append(entity.getName()).append(" - ").append(error).append("\n");
+ sb.append(entity.getName()).append("\n");
}
}
}
@@ -318,8 +315,7 @@
errors++;
sb.append(entity.getName()).append(" - ").append(error).append("\n");
} else {
- Class cls = entity.getLoadingClass();
- if(cls == null) continue;
+ if(!entity.hasObjectLoader()) continue;
XModelObject object = XModelObjectLoaderUtil.createValidObject(model, entity.getName());
if(object == null) {
continue;
17 years, 8 months
JBoss Tools SVN: r7415 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common: meta/impl and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 10:24:36 -0400 (Tue, 08 Apr 2008)
New Revision: 7415
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/XModelEntity.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/XModelEntity.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/XModelEntity.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/XModelEntity.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -11,12 +11,24 @@
package org.jboss.tools.common.meta;
import org.jboss.tools.common.meta.action.XActionList;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.loaders.XObjectLoader;
public interface XModelEntity extends XMetaElement, XDependencies {
public XAttribute[] getAttributes();
public XAttribute getAttribute(String name);
+
+ /**
+ *
+ * @deprecated
+ * @return
+ */
public Class getImplementingClass();
- public Class getLoadingClass();
+
+ public boolean hasObjectImplementation();
+ public XModelObject getObjectImplementation();
+ public boolean hasObjectLoader();
+ public XObjectLoader getObjectLoader();
public String getGeneratorClassName();
public String getEditorClassName();
public XActionList getActionList();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XModelEntityImpl.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -29,11 +29,11 @@
protected XAttribute[] m_Attributes;
protected XActionListImpl actions = new XActionListImpl();
protected XEntityRenderer m_Renderer = null;
- protected ClassHolder implementation = null;
protected String implementationClassName = null;
+ protected String resolvedImplementationClassName = null;
protected String m_GeneratorClassName = null;
- protected ClassHolder loader = null;
protected String loaderClassName = null;
+ protected String resolvedLoaderClassName = null;
protected String m_EditorClassName = null;
protected XDependencies dependencies = new DefaultDependencies();
protected XAdoptManager adopt = null;
@@ -89,24 +89,69 @@
}
}
- public Class getImplementingClass(){
- return implementation.getHoldedClass();
+ public Class getImplementingClass() {
+ if(resolvedImplementationClassName == UNRESOLVED) {
+ resolvedImplementationClassName = expand(implementationClassName, "Implementations");
+ }
+ if(resolvedImplementationClassName == null) return null;
+ Class cls = ModelFeatureFactory.getInstance().getFeatureClass(resolvedImplementationClassName);
+ if(cls == null) {
+ resolvedImplementationClassName = null;
+ }
+ return cls;
}
+ public boolean hasObjectImplementation() {
+ return implementationClassName != null && implementationClassName.length() > 0;
+ }
+
+ public XModelObject getObjectImplementation() {
+ if(resolvedImplementationClassName == UNRESOLVED) {
+ resolvedImplementationClassName = expand(implementationClassName, "Implementations");
+ }
+ if(resolvedImplementationClassName == null) return null;
+ XModelObject o = ModelFeatureFactory.getInstance().createXModelObjectInstance(resolvedImplementationClassName);
+ if(o == null) {
+ resolvedImplementationClassName = null;
+ }
+ return o;
+ }
+
public void setImplementingClassName(String className){
if(className != null && className.length() == 0) className = null;
- implementation = new ClassHolder(className, this, "Implementations");
implementationClassName = className;
+ if(className != null) {
+ resolvedImplementationClassName = UNRESOLVED;
+ }
}
- public Class getLoadingClass() {
- return (loader == null) ? null : loader.getHoldedClass();
+ public boolean hasObjectLoader() {
+ return loaderClassName != null && loaderClassName.length() > 0;
}
+ public XObjectLoader getObjectLoader() {
+ if(resolvedLoaderClassName == UNRESOLVED) {
+ resolvedLoaderClassName = expand(loaderClassName, "Loaders");
+ }
+ if(resolvedLoaderClassName == null) return null;
+ Object o = ModelFeatureFactory.getInstance().createFeatureInstance(resolvedLoaderClassName);
+ if(o == null) {
+ return null;
+ }
+ if(!(o instanceof XObjectLoader)) {
+ ModelPlugin.getPluginLog().logError("Model object loader" + resolvedLoaderClassName + " must implement " + XObjectLoader.class.getName());
+ resolvedLoaderClassName = null;
+ return null;
+ }
+ return (XObjectLoader)o;
+ }
+
+ static String UNRESOLVED = "UNRESOLVED";
+
public void setLoaderClassName(String className) {
if(className != null && className.length() > 0) {
- loader = new ClassHolder(className, this, "Loaders");
loaderClassName = className;
+ resolvedLoaderClassName = UNRESOLVED;
}
}
@@ -387,43 +432,6 @@
}
-class ClassHolder {
- private String name = null;
- private XMetaElementImpl element = null;
- private String map = null;
-
- public ClassHolder(String name, XMetaElementImpl element, String map) {
- this.name = name;
- this.element = element;
- this.map = map;
- }
-
- public Class getHoldedClass() {
- if(name == null) return null;
- validate();
- try {
- Class c = ModelFeatureFactory.getInstance().getFeatureClass(name);
- if(c == null) name = null;
- return c;
- } catch (Exception e) {
- name = null;
- return null;
- }
- }
-
- private void validate() {
- if(name == null) return;
- if(map != null && name.startsWith("%")) {
- name = element.expand(name, map);
- }
- map = null;
- }
-
- public String getProperty(String name) {
- return null;
- }
-}
-
class XAdoptWrapper implements XAdoptManager {
String adoptclass;
XModelEntityImpl entity;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/EnginesLoader.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -16,7 +16,6 @@
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.impl.*;
import org.jboss.tools.common.model.loaders.impl.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
public class EnginesLoader extends URLRootLoader {
@@ -29,11 +28,8 @@
for (int i = 0; i < cs.length; i++) {
if(!cs[i].isRequired() || cs[i].getMaxCount() != 1) continue;
if(object.getChildren(cs[i].getName()).length > 0) continue;
- try {
- object.addChild(XModelObjectLoaderUtil.createValidObject(object.getModel(), cs[i].getName()));
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError("EnginesLoader:load:" + e.getMessage());
- }
+ //April 2008: catch removed. This call is proved to be safe.
+ object.addChild(XModelObjectLoaderUtil.createValidObject(object.getModel(), cs[i].getName()));
}
if(isFilePath(getPath(object))) {
File f = file(object);
@@ -101,7 +97,7 @@
map.remove(c.getPathPart());
}
if(!map.isEmpty()) {
- Iterator it = map.values().iterator();
+ Iterator<XModelObject> it = map.values().iterator();
while(it.hasNext()) {
XModelObject o = (XModelObject)it.next();
XChild childEntity = object.getModelEntity().getChild(o.getModelEntity().getName());
@@ -135,11 +131,11 @@
return map;
}
- public static Set<String> getChildrenToRemove(Map save, XModelObject update) {
- Iterator it = save.keySet().iterator();
+ public static Set<String> getChildrenToRemove(Map<String,XModelObject> save, XModelObject update) {
+ Iterator<String> it = save.keySet().iterator();
Set<String> set = new HashSet<String>();
while(it.hasNext()) {
- String p = it.next().toString();
+ String p = it.next();
if(update.getChildByPath(p) == null) set.add(p);
}
return set;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/XStudioIcons.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -11,6 +11,9 @@
package org.jboss.tools.common.model.icons.impl;
import java.io.*;
+
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.jboss.tools.common.model.*;
@@ -50,6 +53,7 @@
private byte[] getBytes(String filename) {
File f = new File(filename);
+ if(!f.isFile()) return new byte[0];
byte[] b = null;
try {
FileInputStream fr = new FileInputStream(f);
@@ -59,7 +63,7 @@
while(i < length) {
i += fr.read(b, i, length - i);
}
- } catch (Exception e) {
+ } catch (IOException e) {
b = new byte[0];
}
return b;
@@ -79,8 +83,10 @@
ImageData id = new ImageData(is);
Image i = new Image(null, id);
return i;
- } catch (Exception e) {
+ } catch (SWTException e) {
ModelPlugin.getPluginLog().logError(e);
+ } catch (SWTError e) {
+ ModelPlugin.getPluginLog().logError(e);
}
}
return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown");
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -221,21 +221,31 @@
return null;
}
- static Set<String> unknownEntities = new HashSet<String>();
+ static Set<String> unknownEntities = new HashSet<String>();
+
+ static void creationFailed(String entity, String cause) {
+ if(!unknownEntities.contains(entity)) {
+ unknownEntities.add(entity);
+ String message = XBundle.getInstance().getMessage("model", cause, new Object[]{entity});
+ ModelPlugin.getPluginLog().logInfo(message);
+ }
+ }
public XModelObject createModelObject(String entity, Properties properties) {
+ if(unknownEntities.contains(entity)) {
+ return null;
+ }
XModelEntity ent = getMetaData().getEntity(entity);
if(ent == null) {
- if(!unknownEntities.contains(entity)) {
- unknownEntities.add(entity);
- String message = XBundle.getInstance().getMessage("model", "UNKNOUN_ENTITY", new Object[]{entity});
- ModelPlugin.getPluginLog().logInfo(message);
- }
+ creationFailed(entity, "UNKNOUN_ENTITY");
return null;
}
+ XModelObjectImpl me = (XModelObjectImpl)ent.getObjectImplementation();
+ if(me == null) {
+ creationFailed(entity, "CREATION_ENTITY_FAILURE");
+ return null;
+ }
try {
- Class<?> c = ent.getImplementingClass();
- XModelObjectImpl me = (XModelObjectImpl)c.newInstance();
me.setModel(this);
me.setEntityName_0(entity);
XAttribute[] an = ent.getAttributes();
@@ -250,11 +260,7 @@
}
return me;
} catch (Exception e) {
- if(!unknownEntities.contains(entity)) {
- unknownEntities.add(entity);
- String message = XBundle.getInstance().getMessage("model", "CREATION_ENTITY_FAILURE", new Object[]{entity});
- ModelPlugin.getPluginLog().logError(message, e);
- }
+ creationFailed(entity, "CREATION_ENTITY_FAILURE");
}
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/XStudioDataLoaderImpl.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -159,7 +159,7 @@
URL u = b.getResource("meta/options_general.xml");
URLConnection c = u.openConnection();
return c.getInputStream();
- } catch (Exception e) {
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
return null;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2008-04-08 14:24:18 UTC (rev 7414)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2008-04-08 14:24:36 UTC (rev 7415)
@@ -646,11 +646,10 @@
}
public void load(File f, XModelObject o) {
- try {
- Element element = XMLUtil.getElement(f.getAbsolutePath());
- if(element != null) load(element, o);
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:load(f,o):" + e.getMessage(), e);
+ if(f == null || !f.isFile()) return;
+ Element element = XMLUtil.getElement(f.getAbsolutePath());
+ if(element != null) {
+ load(element, o);
}
}
@@ -748,16 +747,8 @@
}
public static XObjectLoader getObjectLoader(XModelObject object) {
- try {
- Class<?> c = object.getModelEntity().getLoadingClass();
- if (c != null) {
- return (XObjectLoader)c.newInstance();
- }
- return null;
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError("XModelObjectLoaderUtil:getObjectLoader(" + object + "):" + e.getMessage(), e);
- return null;
- }
+ if(object == null) return null;
+ return object.getModelEntity().getObjectLoader();
}
public static void remove(File f) {
17 years, 8 months
JBoss Tools SVN: r7414 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 10:24:18 -0400 (Tue, 08 Apr 2008)
New Revision: 7414
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
Log:
JBIDE-893
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-04-08 13:53:27 UTC (rev 7413)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-04-08 14:24:18 UTC (rev 7414)
@@ -41,6 +41,8 @@
<XModelAttribute default="faces security events" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.facesSecurityEvents" name="name" xmlname="name"/>
<XModelAttributeReference
attributes="class,scope,precedence,installed,auto-create,startup"
entity="SeamComponent20" name="component"/>
@@ -260,7 +262,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Faces Security Events..." kind="action" name="AddFacesSecurityEvents">
- <EntityData EntityName="FacesSecurityEvents20">
+ <EntityData EntityName="SeamFacesSecurityEvents20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="cookie-max-age" Mandatory="no"/>
</EntityData>
@@ -287,7 +289,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Faces Security Events..." kind="action" name="AddFacesSecurityEvents">
- <EntityData EntityName="FacesSecurityEvents20">
+ <EntityData EntityName="SeamFacesSecurityEvents20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="cookie-max-age" Mandatory="no"/>
</EntityData>
17 years, 8 months
JBoss Tools SVN: r7413 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-08 09:53:27 -0400 (Tue, 08 Apr 2008)
New Revision: 7413
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2014 Ctrl+Shift+G in xhtml shows N out of 0 in progress dialog
Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-04-08 13:11:53 UTC (rev 7412)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-04-08 13:53:27 UTC (rev 7413)
@@ -403,7 +403,8 @@
}
private int calculateFiles() {
- if (fJavaMatchers != null && fJavaMatchers.length > 0) {
+ if ((fJavaMatchers != null && fJavaMatchers.length > 0) ||
+ (fVariableMatchers != null && fVariableMatchers.length > 0)) {
IFile[] files = fCurrentScope.evaluateFilesInScope(fStatus);
return (files == null ? 0 : files.length);
} else if (fVarMatchers != null && fVarMatchers.length > 0) {
17 years, 8 months
JBoss Tools SVN: r7412 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console: src/org/hibernate/eclipse/console and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-04-08 09:11:53 -0400 (Tue, 08 Apr 2008)
New Revision: 7412
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/criteria_editor_connect.gif
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/hql_editor_connect.gif
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/criteria_editor.gif
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/hql_editor.gif
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2020
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/criteria_editor.gif
===================================================================
(Binary files differ)
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/criteria_editor_connect.gif
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/criteria_editor_connect.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/hql_editor.gif
===================================================================
(Binary files differ)
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/hql_editor_connect.gif
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/hql_editor_connect.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2008-04-08 12:31:19 UTC (rev 7411)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2008-04-08 13:11:53 UTC (rev 7412)
@@ -40,7 +40,6 @@
private String defPartName;
private Image defTitleImage;
private Image connectedTitleImage;
- private String connectedImageFilePath = "icons/images/connected.gif";
// to enable execution of queries from files - hack for HBX-744
private String consoleConfigurationName;
@@ -247,7 +246,7 @@
defTitleImage = getTitleImage();
setPartName(defPartName + "->" + editor.getTitle());
if (connectedTitleImage == null){
- connectedTitleImage = HibernateConsolePlugin.getImageDescriptor(connectedImageFilePath).createImage();
+ connectedTitleImage = HibernateConsolePlugin.getImageDescriptor(getConnectedImageFilePath()).createImage();
}
setTitleImage(connectedTitleImage);
}
@@ -261,4 +260,6 @@
}
connectedTitleImage.dispose();
}
+
+ protected abstract String getConnectedImageFilePath();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-04-08 12:31:19 UTC (rev 7411)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-04-08 13:11:53 UTC (rev 7412)
@@ -202,5 +202,9 @@
control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
}
-
+
+ @Override
+ protected String getConnectedImageFilePath() {
+ return "icons/images/criteria_editor_connect.gif"; //$NON-NLS-1$
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2008-04-08 12:31:19 UTC (rev 7411)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2008-04-08 13:11:53 UTC (rev 7412)
@@ -68,101 +68,101 @@
public static final String PLUGIN_NAME = HibernateConsolePlugin.ID;
public static final String HELP_CONTEXT_ID = PLUGIN_NAME + ".hqleditorhelp"; //$NON-NLS-1$
- /** The HQL code scanner, which is used for colorizing the edit text. */
- private HQLCodeScanner fHQLCodeScanner;
- /** The document setup participant object, which is used partition the edit text. */
- private HQLEditorDocumentSetupParticipant docSetupParticipant;
- /** The projection (code folding) support object. */
- private ProjectionSupport fProjectionSupport;
+ /** The HQL code scanner, which is used for colorizing the edit text. */
+ private HQLCodeScanner fHQLCodeScanner;
+ /** The document setup participant object, which is used partition the edit text. */
+ private HQLEditorDocumentSetupParticipant docSetupParticipant;
+ /** The projection (code folding) support object. */
+ private ProjectionSupport fProjectionSupport;
-
- /**
- * Constructs an instance of this class. This is the default constructor.
- */
- public HQLEditor() {
- super();
- }
-
- /**
- * Creates and installs the editor actions.
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
- */
- protected void createActions() {
- super.createActions();
- ResourceBundle bundle = getResourceBundle();
-
- IAction a = new TextOperationAction( bundle,
- "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS ); //$NON-NLS-1$
- a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
- setAction( "ContentAssistProposal", a ); //$NON-NLS-1$
-
- a = new TextOperationAction( bundle, "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION ); //$NON-NLS-1$
- a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION );
- setAction( "ContentAssistTip", a ); //$NON-NLS-1$
-
- a = new TextOperationAction( bundle, "ContentFormat.", this, ISourceViewer.FORMAT ); //$NON-NLS-1$
- setAction( "ContentFormat", a ); //$NON-NLS-1$
-
- /*a = new HQLConnectAction( bundle, "HQLEditor.connectAction." ); //$NON-NLS-1$
- setAction( "HQLEditor.connectAction", a ); //$NON-NLS-1$
- */
-
- /*a = new HQLDisconnectAction( bundle, "HQLEditor.disconnectAction." ); //$NON-NLS-1$
- setAction( "HQLEditor.disconnectAction", a ); //$NON-NLS-1$
- */
-
-// a = new ExecuteQueryAction( this ); //$NON-NLS-1$
-// setAction( "HQLEditor.runAction", a ); //$NON-NLS-1$
-
- /*a = new HQLSetStatementTerminatorAction( bundle, "HQLEditor.setStatementTerminatorAction." ); //$NON-NLS-1$
- setAction( "HQLEditor.setStatementTerminatorAction", a ); //$NON-NLS-1$
- */
- }
-
+
+ /**
+ * Constructs an instance of this class. This is the default constructor.
+ */
+ public HQLEditor() {
+ super();
+ }
+
+ /**
+ * Creates and installs the editor actions.
+ *
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
+ */
+ protected void createActions() {
+ super.createActions();
+ ResourceBundle bundle = getResourceBundle();
+
+ IAction a = new TextOperationAction( bundle,
+ "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS ); //$NON-NLS-1$
+ a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
+ setAction( "ContentAssistProposal", a ); //$NON-NLS-1$
+
+ a = new TextOperationAction( bundle, "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION ); //$NON-NLS-1$
+ a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION );
+ setAction( "ContentAssistTip", a ); //$NON-NLS-1$
+
+ a = new TextOperationAction( bundle, "ContentFormat.", this, ISourceViewer.FORMAT ); //$NON-NLS-1$
+ setAction( "ContentFormat", a ); //$NON-NLS-1$
+
+ /*a = new HQLConnectAction( bundle, "HQLEditor.connectAction." ); //$NON-NLS-1$
+ setAction( "HQLEditor.connectAction", a ); //$NON-NLS-1$
+ */
+
+ /*a = new HQLDisconnectAction( bundle, "HQLEditor.disconnectAction." ); //$NON-NLS-1$
+ setAction( "HQLEditor.disconnectAction", a ); //$NON-NLS-1$
+ */
+
+ // a = new ExecuteQueryAction( this ); //$NON-NLS-1$
+ // setAction( "HQLEditor.runAction", a ); //$NON-NLS-1$
+
+ /*a = new HQLSetStatementTerminatorAction( bundle, "HQLEditor.setStatementTerminatorAction." ); //$NON-NLS-1$
+ setAction( "HQLEditor.setStatementTerminatorAction", a ); //$NON-NLS-1$
+ */
+ }
+
private ResourceBundle getResourceBundle() {
return ResourceBundle.getBundle( Messages.BUNDLE_NAME );
}
-
+
/**
- * Creates the SWT controls for the editor.
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl( Composite parent ) {
- parent.setLayout( new GridLayout(1,false) );
-
- createToolbar(parent);
-
- super.createPartControl( parent );
-
- if (getSourceViewer() != null ){
+ * Creates the SWT controls for the editor.
+ *
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl( Composite parent ) {
+ parent.setLayout( new GridLayout(1,false) );
+
+ createToolbar(parent);
+
+ super.createPartControl( parent );
+
+ if (getSourceViewer() != null ){
getSourceViewer().addTextListener(new ITextListener(){
-
+
public void textChanged(TextEvent event) {
updateExecButton();
}});
}
-
- // move to base class?
- Control control = parent.getChildren()[1];
- control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
-
- setProjectionSupport( createProjectionSupport() );
-
- /* Now that we have enabled source folding, make sure everything is
- * expanded.
- */
- ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
- viewer.doOperation( ProjectionViewer.TOGGLE );
-
- /* Set a help context ID to enable F1 help. */
- getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( parent, HELP_CONTEXT_ID );
-
- // the following is needed to make sure the editor area gets focus when editing after query execution
- // TODO: find a better way since this is triggered on evey mouse click and key stroke in the editor area
- StyledText textWidget = getSourceViewer().getTextWidget();
+
+ // move to base class?
+ Control control = parent.getChildren()[1];
+ control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+
+ setProjectionSupport( createProjectionSupport() );
+
+ /* Now that we have enabled source folding, make sure everything is
+ * expanded.
+ */
+ ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
+ viewer.doOperation( ProjectionViewer.TOGGLE );
+
+ /* Set a help context ID to enable F1 help. */
+ getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( parent, HELP_CONTEXT_ID );
+
+ // the following is needed to make sure the editor area gets focus when editing after query execution
+ // TODO: find a better way since this is triggered on evey mouse click and key stroke in the editor area
+ StyledText textWidget = getSourceViewer().getTextWidget();
textWidget.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
@@ -177,234 +177,238 @@
}
});
- }
-
- /**
- * Creates, configures, and returns a <code>ProjectionSupport</code>
- * object for this editor.
- *
- * @return the <code>ProjectSupport</code> object to use with this editor
- */
- protected ProjectionSupport createProjectionSupport() {
- ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
- ProjectionSupport projSupport = new ProjectionSupport( viewer, getAnnotationAccess(), getSharedColors() );
- projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.error" ); //$NON-NLS-1$
- projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.warning" ); //$NON-NLS-1$
- projSupport.install();
-
- return projSupport;
- }
-
- /**
- * Creates the source viewer to be used by this editor.
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jface.text.source.IVerticalRuler, int)
- */
- protected ISourceViewer createSourceViewer( Composite parent, IVerticalRuler ruler, int styles ) {
- HQLSourceViewer viewer = new HQLSourceViewer( parent, ruler, getOverviewRuler(), isOverviewRulerVisible(),
- styles );
-
- return viewer;
- }
-
- /**
- * Creates the source viewer configuation to be used by this editor.
- *
- * @return the new source viewer configuration object
- */
- protected HQLSourceViewerConfiguration createSourceViewerConfiguration() {
- HQLSourceViewerConfiguration config = new HQLSourceViewerConfiguration( this );
-
- return config;
- }
-
- /**
- * Sets the input of the outline page after this class has set input.
- *
- * @param input the new input for the editor
- * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
- */
- public void doSetInput( IEditorInput input ) throws CoreException {
- super.doSetInput( input );
-
- /* Make sure the document partitioner is set up. The document setup
- * participant sets up document partitioning, which is used for text
- * colorizing and other text features.
- */
- IDocumentProvider docProvider = this.getDocumentProvider();
- if (docProvider != null) {
- IDocument doc = docProvider.getDocument( input );
- if (doc != null) {
- HQLEditorDocumentSetupParticipant docSetupParticipant = getDocumentSetupParticipant();
- docSetupParticipant.setup( doc );
- }
- }
-
- }
-
- /**
- * Sets up this editor's context menu before it is made visible.
- *
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
- */
- protected void editorContextMenuAboutToShow( IMenuManager menu ) {
- super.editorContextMenuAboutToShow( menu );
-
- menu.add( new Separator() );
- addAction( menu, "ContentAssistProposal" ); //$NON-NLS-1$
- addAction( menu, "ContentAssistTip" ); //$NON-NLS-1$
- addAction( menu, "ContentFormat" ); //$NON-NLS-1$
-
- menu.add( new Separator() );
- /*if (getConnectionInfo() == null) {
- addAction( menu, "HQLEditor.connectAction" ); //$NON-NLS-1$
- }
- else {
- addAction( menu, "HQLEditor.disconnectAction" ); //$NON-NLS-1$
- }*/
- addAction( menu, "HQLEditor.runAction" ); //$NON-NLS-1$
- //addAction( menu, "HQLEditor.setStatementTerminatorAction" ); //$NON-NLS-1$
- }
-
- /**
- * Gets an adapter for the given class. Returns the HQL content outline page
- * if the get request is for an outline page. Otherwise returns a projection
- * adapter if one hasn't already been created.
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- * @see org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer,
- * java.lang.Class)
- */
- public Object getAdapter( Class classForWhichAdapterNeeded ) {
- Object adapter = null;
-
- if(IQueryParametersPage.class.equals( classForWhichAdapterNeeded )) {
- return new QueryParametersPage(this);
- }
- /* Get and return the content outline page, if that's what's requested. */
- if (IContentOutlinePage.class.equals( classForWhichAdapterNeeded )) {
-// HQLEditorContentOutlinePage outlinePage = getOutlinePage();
-// if (outlinePage == null) {
-// outlinePage = createContentOutlinePage();
-// setOutlinePage( outlinePage );
-// if (getEditorInput() != null) {
-// outlinePage.setInput( getEditorInput() );
-// }
-// }
- // adapter = outlinePage;
- adapter = null;
- }
- /* Delegate getting the adapter to the projection support object,
- * if there is one. Projection refers to the ability to visibly collapse
- * and expand sections of the document.
- */
- else if (adapter == null) {
- ProjectionSupport projSupport = getProjectionSupport();
- if (projSupport != null) {
- adapter = projSupport.getAdapter( getSourceViewer(), classForWhichAdapterNeeded );
- }
- }
-
- /* If we still don't have an adapter let the superclass handle it. */
- if (adapter == null) {
- adapter = super.getAdapter( classForWhichAdapterNeeded );
- }
-
- return adapter;
- }
-
- /**
- * Gets the document setup participant object associated with this editor.
- * The setup participant sets the partitioning type for the document.
- *
- * @return the current document setup participant
- */
- public HQLEditorDocumentSetupParticipant getDocumentSetupParticipant() {
- if (docSetupParticipant == null) {
- docSetupParticipant = new HQLEditorDocumentSetupParticipant();
- }
- return docSetupParticipant;
- }
-
-
- /**
- * Gets the <code>ProjectionSupport</code> object associated with this
- * editor.
- *
- * @return the current <code>ProjectionSupport</code> object
- */
- protected ProjectionSupport getProjectionSupport() {
- return fProjectionSupport;
- }
-
-
- /**
- * Gets the HQL source code text scanner. Creates a default one if it
- * doesn't exist yet.
- *
- * @return the HQL source code text scanner
- */
- public HQLCodeScanner getHQLCodeScanner() {
- if (fHQLCodeScanner == null) {
- fHQLCodeScanner = new HQLCodeScanner( getHQLColorProvider() );
- }
- return fHQLCodeScanner;
- }
-
-
- /**
- * Gets the color provider for colorizing HQL source code.
- *
- * @return the HQL color provider
- */
- public HQLColors getHQLColorProvider() {
- return new HQLColors();
- }
-
- /**
- * Initializes the editor.
- *
- * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
- */
- protected void initializeEditor() {
- super.initializeEditor();
- setSourceViewerConfiguration( createSourceViewerConfiguration() );
- setRangeIndicator( new DefaultRangeIndicator() );
- }
-
-
- /**
- * Sets the document setup participant object associated with this editor to
- * the given object. The setup participant sets the partitioning type for
- * the document.
- *
- * @return the current document setup participant
- */
- public void setDocumentSetupParticipant( HQLEditorDocumentSetupParticipant docSetupParticipant ) {
- this.docSetupParticipant = docSetupParticipant;
- }
-
- /**
- * Sets the <code>ProjectionSupport</code> object associated with this
- * editor.
- *
- * @param projSupport the <code>ProjectionSupport</code> object to use
- */
- protected void setProjectionSupport( ProjectionSupport projSupport ) {
- fProjectionSupport = projSupport;
- }
-
+ }
- public ITextViewer getTextViewer() {
- return getSourceViewer();
- }
-
-
+ /**
+ * Creates, configures, and returns a <code>ProjectionSupport</code>
+ * object for this editor.
+ *
+ * @return the <code>ProjectSupport</code> object to use with this editor
+ */
+ protected ProjectionSupport createProjectionSupport() {
+ ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
+ ProjectionSupport projSupport = new ProjectionSupport( viewer, getAnnotationAccess(), getSharedColors() );
+ projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.error" ); //$NON-NLS-1$
+ projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.warning" ); //$NON-NLS-1$
+ projSupport.install();
+
+ return projSupport;
+ }
+
+ /**
+ * Creates the source viewer to be used by this editor.
+ *
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.jface.text.source.IVerticalRuler, int)
+ */
+ protected ISourceViewer createSourceViewer( Composite parent, IVerticalRuler ruler, int styles ) {
+ HQLSourceViewer viewer = new HQLSourceViewer( parent, ruler, getOverviewRuler(), isOverviewRulerVisible(),
+ styles );
+
+ return viewer;
+ }
+
+ /**
+ * Creates the source viewer configuation to be used by this editor.
+ *
+ * @return the new source viewer configuration object
+ */
+ protected HQLSourceViewerConfiguration createSourceViewerConfiguration() {
+ HQLSourceViewerConfiguration config = new HQLSourceViewerConfiguration( this );
+
+ return config;
+ }
+
+ /**
+ * Sets the input of the outline page after this class has set input.
+ *
+ * @param input the new input for the editor
+ * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
+ */
+ public void doSetInput( IEditorInput input ) throws CoreException {
+ super.doSetInput( input );
+
+ /* Make sure the document partitioner is set up. The document setup
+ * participant sets up document partitioning, which is used for text
+ * colorizing and other text features.
+ */
+ IDocumentProvider docProvider = this.getDocumentProvider();
+ if (docProvider != null) {
+ IDocument doc = docProvider.getDocument( input );
+ if (doc != null) {
+ HQLEditorDocumentSetupParticipant docSetupParticipant = getDocumentSetupParticipant();
+ docSetupParticipant.setup( doc );
+ }
+ }
+
+ }
+
+ /**
+ * Sets up this editor's context menu before it is made visible.
+ *
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
+ */
+ protected void editorContextMenuAboutToShow( IMenuManager menu ) {
+ super.editorContextMenuAboutToShow( menu );
+
+ menu.add( new Separator() );
+ addAction( menu, "ContentAssistProposal" ); //$NON-NLS-1$
+ addAction( menu, "ContentAssistTip" ); //$NON-NLS-1$
+ addAction( menu, "ContentFormat" ); //$NON-NLS-1$
+
+ menu.add( new Separator() );
+ /*if (getConnectionInfo() == null) {
+ addAction( menu, "HQLEditor.connectAction" ); //$NON-NLS-1$
+ }
+ else {
+ addAction( menu, "HQLEditor.disconnectAction" ); //$NON-NLS-1$
+ }*/
+ addAction( menu, "HQLEditor.runAction" ); //$NON-NLS-1$
+ //addAction( menu, "HQLEditor.setStatementTerminatorAction" ); //$NON-NLS-1$
+ }
+
+ /**
+ * Gets an adapter for the given class. Returns the HQL content outline page
+ * if the get request is for an outline page. Otherwise returns a projection
+ * adapter if one hasn't already been created.
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ * @see org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer,
+ * java.lang.Class)
+ */
+ public Object getAdapter( Class classForWhichAdapterNeeded ) {
+ Object adapter = null;
+
+ if(IQueryParametersPage.class.equals( classForWhichAdapterNeeded )) {
+ return new QueryParametersPage(this);
+ }
+ /* Get and return the content outline page, if that's what's requested. */
+ if (IContentOutlinePage.class.equals( classForWhichAdapterNeeded )) {
+ // HQLEditorContentOutlinePage outlinePage = getOutlinePage();
+ // if (outlinePage == null) {
+ // outlinePage = createContentOutlinePage();
+ // setOutlinePage( outlinePage );
+ // if (getEditorInput() != null) {
+ // outlinePage.setInput( getEditorInput() );
+ // }
+ // }
+ // adapter = outlinePage;
+ adapter = null;
+ }
+ /* Delegate getting the adapter to the projection support object,
+ * if there is one. Projection refers to the ability to visibly collapse
+ * and expand sections of the document.
+ */
+ else if (adapter == null) {
+ ProjectionSupport projSupport = getProjectionSupport();
+ if (projSupport != null) {
+ adapter = projSupport.getAdapter( getSourceViewer(), classForWhichAdapterNeeded );
+ }
+ }
+
+ /* If we still don't have an adapter let the superclass handle it. */
+ if (adapter == null) {
+ adapter = super.getAdapter( classForWhichAdapterNeeded );
+ }
+
+ return adapter;
+ }
+
+ /**
+ * Gets the document setup participant object associated with this editor.
+ * The setup participant sets the partitioning type for the document.
+ *
+ * @return the current document setup participant
+ */
+ public HQLEditorDocumentSetupParticipant getDocumentSetupParticipant() {
+ if (docSetupParticipant == null) {
+ docSetupParticipant = new HQLEditorDocumentSetupParticipant();
+ }
+ return docSetupParticipant;
+ }
+
+
+ /**
+ * Gets the <code>ProjectionSupport</code> object associated with this
+ * editor.
+ *
+ * @return the current <code>ProjectionSupport</code> object
+ */
+ protected ProjectionSupport getProjectionSupport() {
+ return fProjectionSupport;
+ }
+
+
+ /**
+ * Gets the HQL source code text scanner. Creates a default one if it
+ * doesn't exist yet.
+ *
+ * @return the HQL source code text scanner
+ */
+ public HQLCodeScanner getHQLCodeScanner() {
+ if (fHQLCodeScanner == null) {
+ fHQLCodeScanner = new HQLCodeScanner( getHQLColorProvider() );
+ }
+ return fHQLCodeScanner;
+ }
+
+
+ /**
+ * Gets the color provider for colorizing HQL source code.
+ *
+ * @return the HQL color provider
+ */
+ public HQLColors getHQLColorProvider() {
+ return new HQLColors();
+ }
+
+ /**
+ * Initializes the editor.
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
+ */
+ protected void initializeEditor() {
+ super.initializeEditor();
+ setSourceViewerConfiguration( createSourceViewerConfiguration() );
+ setRangeIndicator( new DefaultRangeIndicator() );
+ }
+
+
+ /**
+ * Sets the document setup participant object associated with this editor to
+ * the given object. The setup participant sets the partitioning type for
+ * the document.
+ *
+ * @return the current document setup participant
+ */
+ public void setDocumentSetupParticipant( HQLEditorDocumentSetupParticipant docSetupParticipant ) {
+ this.docSetupParticipant = docSetupParticipant;
+ }
+
+ /**
+ * Sets the <code>ProjectionSupport</code> object associated with this
+ * editor.
+ *
+ * @param projSupport the <code>ProjectionSupport</code> object to use
+ */
+ protected void setProjectionSupport( ProjectionSupport projSupport ) {
+ fProjectionSupport = projSupport;
+ }
+
+
+ public ITextViewer getTextViewer() {
+ return getSourceViewer();
+ }
+
+
+
+ public void executeQuery(ConsoleConfiguration cfg) {
+ cfg.executeHQLQuery(getQueryString(), getQueryInputModel().getCopyForQuery() );
+ }
- public void executeQuery(ConsoleConfiguration cfg) {
- cfg.executeHQLQuery(getQueryString(), getQueryInputModel().getCopyForQuery() );
- }
-
+ @Override
+ protected String getConnectedImageFilePath() {
+ return "icons/images/hql_editor_connect.gif"; //$NON-NLS-1$
+ }
}
17 years, 8 months