JBoss Tools SVN: r7108 - in trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools: struts and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-25 10:16:56 -0400 (Tue, 25 Mar 2008)
New Revision: 7108
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFileSize.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProjectUtil.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorComp.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorDesc.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/PropertyComp.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/CreateForwardHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/SetupModuleHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsAdoptManager.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsDeleteHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/DeletePageHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/OpenPageHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/RunHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageContext.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageSupport.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/WebTree.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsBreakpointManager.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessHelper.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessStructureHelper.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/TilesStructureHelper.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/JSPLinksParser.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/link/Links.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/path/SelectActionForwardPathSupport.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectConfiguration.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectPlugin.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectTagLibs.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectsRoot.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsPromptingProvider.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddMessagesHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddSpecialPluginHandler.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorLoader.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/ValidatorArg11Impl.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectStepLocation.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectSupport.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PostfixUrlPattern.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PrefixUrlPattern.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/UrlPattern.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/resource/ResourceMapping.java
Log:
JBIDE-1945
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFileSize.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFileSize.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintFileSize.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -22,9 +22,8 @@
v = value.substring(0, value.length() - 1);
}
try {
- int i = Integer.parseInt(v);
- return (i >= 0);
- } catch (Exception e) {
+ return (v.length() > 0 && Integer.parseInt(v) >= 0);
+ } catch (NumberFormatException e) {
StrutsModelPlugin.getPluginLog().logError(e);
return false;
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -15,7 +15,6 @@
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.osgi.framework.BundleContext;
/**
* @author Eskimo
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProjectUtil.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProjectUtil.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProjectUtil.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -11,6 +11,7 @@
package org.jboss.tools.struts;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
public class StrutsProjectUtil {
public static final String STRUTS_NATURE_ID = StrutsProject.NATURE_ID;
@@ -20,7 +21,7 @@
public static boolean hasStrutsNature(IProject project) {
try {
return project != null && project.hasNature(StrutsProjectUtil.STRUTS_NATURE_ID);
- } catch (Exception e) {
+ } catch (CoreException e) {
StrutsModelPlugin.getPluginLog().logError(e);
return false;
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorComp.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorComp.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorComp.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -11,15 +11,13 @@
*
* @author valera
*/
-public class ConstructorComp implements java.util.Comparator {
+public class ConstructorComp implements java.util.Comparator<ConstructorDesc> {
/** Creates a new instance of ConstructorComp */
public ConstructorComp() {
}
- public int compare(Object o1, Object o2) {
- ConstructorDesc c1 = (ConstructorDesc)o1;
- ConstructorDesc c2 = (ConstructorDesc)o2;
+ public int compare(ConstructorDesc c1, ConstructorDesc c2) {
ParameterList p1 = c1.getParameterList();
ParameterList p2 = c2.getParameterList();
int res = p1.size() - p2.size();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorDesc.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorDesc.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/ConstructorDesc.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -53,7 +53,7 @@
return params;
}
- public Set getExceptions() {
+ public Set<String> getExceptions() {
return exceptions;
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/PropertyComp.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/PropertyComp.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/gen/java/PropertyComp.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -12,15 +12,13 @@
*
* @author valera
*/
-public class PropertyComp implements java.util.Comparator {
+public class PropertyComp implements java.util.Comparator<PropertyDesc> {
/** Creates a new instance of PropertyComp */
public PropertyComp() {
}
- public int compare(Object o1, Object o2) {
- PropertyDesc p1 = (PropertyDesc)o1;
- PropertyDesc p2 = (PropertyDesc)o2;
+ public int compare(PropertyDesc p1, PropertyDesc p2) {
int res = getWeight(p1) - getWeight(p2);
if (res != 0) return res;
return p1.name.compareTo(p2.name);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/CreateForwardHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/CreateForwardHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/CreateForwardHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -114,12 +114,8 @@
CreatePageSupport.createFile(fs, jsppath, null);
}
setShape(object, prop);
- try {
XModelObject process = StrutsProcessStructureHelper.instance.getProcess(object);
StrutsProcessHelper.getHelper(process).updatePages();
- } catch (Exception e) {
- StrutsModelPlugin.getPluginLog().logError(e);
- }
}
private boolean isEqualRoots(String r1, String r2) {
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/SetupModuleHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/SetupModuleHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/SetupModuleHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -113,10 +113,10 @@
}
public static String getString(Properties props) {
- Iterator it = props.entrySet().iterator();
+ Iterator<Map.Entry<Object,Object>> it = props.entrySet().iterator();
String s = "";
while (it.hasNext()) {
- Map.Entry entry = (Map.Entry)it.next();
+ Map.Entry<Object,Object> entry = it.next();
s += (s.length() > 0 ? "," : "") + entry.getKey() + "=" + entry.getValue();
}
return s;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsAdoptManager.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsAdoptManager.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsAdoptManager.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -11,6 +11,7 @@
import org.jboss.tools.struts.model.*;
import org.jboss.tools.common.meta.*;
import org.jboss.tools.common.meta.action.*;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.struts.model.handlers.page.create.*;
@@ -89,13 +90,13 @@
XAction a = object.getModelEntity().getActionList().getAction("CopyActions.Copy");
try {
a.executeHandler(object, p);
- } catch (Exception e) {
+ } catch (XModelException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
a = target.getModelEntity().getActionList().getAction("CopyActions.Paste");
try {
a.executeHandler(target, p);
- } catch (Exception e) {
+ } catch (XModelException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsDeleteHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsDeleteHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/StrutsDeleteHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -49,7 +49,7 @@
deletePage.executeHandler(object, prop);
return;
}
- List referers = null;
+ List<XModelObject> referers = null;
if (object instanceof ReferenceObjectImpl) {
XModelObject ref = ((ReferenceObjectImpl)object).getReference();
if (ENT_PROCESSITEM.equals(object.getModelEntity().getName())) {
@@ -82,7 +82,7 @@
try {
if (referers != null && referers.size() > 0) {
for (int i = 0; i < referers.size(); i++) {
- XModelObject referer = (XModelObject)referers.get(i);
+ XModelObject referer = referers.get(i);
XActionHandler unlink = referer.getModelEntity().getActionList().getAction(UNLINK_ACTION);
if (unlink != null && unlink.isEnabled(referer)) {
unlink.executeHandler(referer, prop);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/DeletePageHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/DeletePageHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/DeletePageHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -23,7 +23,6 @@
import org.jboss.tools.common.model.undo.XRemoveUndo;
import org.jboss.tools.common.model.undo.XUndoManager;
import org.jboss.tools.struts.StrutsConstants;
-import org.jboss.tools.struts.StrutsModelPlugin;
import org.jboss.tools.struts.StrutsPreference;
import org.jboss.tools.struts.messages.StrutsUIMessages;
import org.jboss.tools.struts.model.StrutsProcessImpl;
@@ -46,11 +45,7 @@
IFile f = getFile(object);
boolean deleteFile = true;
if(f != null) {
- try {
- deleteFile = "yes".equals(StrutsPreference.REMOVE_PAGE_AND_FILE.getValue()); //$NON-NLS-1$
- } catch (Exception e) {
- StrutsModelPlugin.getPluginLog().logError(e);
- }
+ deleteFile = "yes".equals(StrutsPreference.REMOVE_PAGE_AND_FILE.getValue()); //$NON-NLS-1$
ServiceDialog d = object.getModel().getService();
Properties xp = new Properties();
xp.setProperty(ServiceDialog.DIALOG_MESSAGE, StrutsUIMessages.DELETE_PAGE + object.getPresentationString() + "?"); //$NON-NLS-2$
@@ -58,11 +53,7 @@
xp.put(ServiceDialog.CHECKED, new Boolean(deleteFile));
if(!d.openConfirm(xp)) return;
deleteFile = ((Boolean)xp.get(ServiceDialog.CHECKED)).booleanValue();
- try {
- StrutsPreference.REMOVE_PAGE_AND_FILE.setValue(deleteFile ? "yes" : "no"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (Exception e) {
- StrutsModelPlugin.getPluginLog().logError(e);
- }
+ StrutsPreference.REMOVE_PAGE_AND_FILE.setValue(deleteFile ? "yes" : "no"); //$NON-NLS-1$ //$NON-NLS-2$
}
XModelObject parent = object.getParent();
object.removeFromParent();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/OpenPageHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/OpenPageHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/OpenPageHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -43,7 +43,7 @@
if(o == null) o = XModelImpl.getByRelativePath(source.getModel(), path);
if(o == null) return null;
- Map map = WebModulesHelper.getInstance(source.getModel()).getWebFileSystems();
+ Map<String,XModelObject> map = WebModulesHelper.getInstance(source.getModel()).getWebFileSystems();
XModelObject fs = o;
while(fs != null && fs.getFileType() != XModelObject.SYSTEM) fs = fs.getParent();
return (fs != null && map.containsValue(fs)) ? o : null;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/RunHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/RunHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/RunHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -62,7 +62,7 @@
XModelObject wr = WebModulesHelper.getInstance(fs.getModel()).getFileSystem("");
if(wr == null) return false;
if(wr == fs) return true;
- Map map = WebModulesHelper.getInstance(fs.getModel()).getWebFileSystems();
+ Map<String,XModelObject> map = WebModulesHelper.getInstance(fs.getModel()).getWebFileSystems();
if(!map.containsValue(fs)) return false;
String p1 = getCanonicalLocation(wr);
String p2 = getCanonicalLocation(fs);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageContext.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageContext.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageContext.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -103,10 +103,10 @@
if(thisModuleRoot == null) thisModuleRoot = "";
selectedFileSystem = null;
- Map map = WebModulesHelper.getInstance(process.getModel()).getWebFileSystems();
- for(Iterator it = map.keySet().iterator(); it.hasNext();) {
- String module = it.next().toString();
- XModelObject fs = (XModelObject)map.get(module);
+ Map<String,XModelObject> map = WebModulesHelper.getInstance(process.getModel()).getWebFileSystems();
+ for(Iterator<String> it = map.keySet().iterator(); it.hasNext();) {
+ String module = it.next();
+ XModelObject fs = map.get(module);
boolean isWebroot = (module.length() == 0);
boolean isThisModule = (thisModuleRoot.length() > 0 && thisModuleRoot.equals(module));
if(isThisModule) {
@@ -152,10 +152,8 @@
///
public String setRootByPath(String path) {
- Iterator it = roots.keySet().iterator();
- while(it.hasNext()) {
- String fsp = (String)it.next();
- String m = (String)roots.get(fsp);
+ for (String fsp: roots.keySet()) {
+ String m = roots.get(fsp);
if(path.startsWith(m + "/")) {
setSelectedFileSystem(process.getModel().getByPath("FileSystems/" + fsp));
return path.substring(m.length());
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageSupport.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageSupport.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/CreatePageSupport.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -63,7 +63,7 @@
if(context.isPreselected()) {
try {
onSelection();
- } catch (Exception e) {
+ } catch (XModelException e) {
StrutsModelPlugin.getPluginLog().logError("Exception caught in CreatePageSupport:reset " + e.getMessage(), e);
}
} else {
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/WebTree.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/WebTree.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/create/WebTree.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -51,10 +51,9 @@
thismodule = (contextProcess == null) ? null : StrutsProcessStructureHelper.instance.getProcessModule(contextProcess);
Vector<XModelObject> v = new Vector<XModelObject>();
web = null;
- Map map = WebModulesHelper.getInstance(model).getWebFileSystems();
- for (Iterator it = map.keySet().iterator(); it.hasNext();) {
- String module = it.next().toString();
- XModelObject fs = (XModelObject)map.get(module);
+ Map<String,XModelObject> map = WebModulesHelper.getInstance(model).getWebFileSystems();
+ for (String module: map.keySet()) {
+ XModelObject fs = map.get(module);
if(fs == null) continue;
boolean isWebroot = (module.length() == 0);
boolean isThisModule = (thismodule != null && thismodule.length() > 0 && thismodule.equals(module));
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsBreakpointManager.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsBreakpointManager.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsBreakpointManager.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -324,9 +324,9 @@
}
public void changeAllBreakpointStatus(int status, boolean mergeStatuses) {
- Iterator keys = map.keySet().iterator();
+ Iterator<String> keys = map.keySet().iterator();
while(keys.hasNext()) {
- String key = (String)keys.next();
+ String key = keys.next();
changeAllBreakpointStatus(key, status, mergeStatuses);
}
}
@@ -344,9 +344,9 @@
return new BreakpointId[0];
}
ArrayList<BreakpointId> ids = new ArrayList<BreakpointId>();
- Iterator keys = map.keySet().iterator();
+ Iterator<String> keys = map.keySet().iterator();
while(keys.hasNext()) {
- String key = (String)keys.next();
+ String key = keys.next();
BreakpointId[] bIds = ((BreakpointsStatus)map.get(key)).getBreakpointIds();
for(int i=0; i<bIds.length; i++) {
bIds[i].setModelPath(key);
@@ -444,7 +444,7 @@
public int getSummaryStatus() {
int maxPriority = -1;
- Iterator keys = markersStatuses.keySet().iterator();
+ Iterator<String> keys = markersStatuses.keySet().iterator();
while(keys.hasNext()) {
String key = (String)keys.next();
Integer status = (Integer)markersStatuses.get(key);
@@ -473,7 +473,7 @@
}
public void setAllStatusAsInt(int status, boolean mergeStatuses) {
- Iterator keys = markersStatuses.keySet().iterator();
+ Iterator<String> keys = markersStatuses.keySet().iterator();
while(keys.hasNext()) {
String key = (String)keys.next();
int oldStatus = getStatus(key);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessHelper.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessHelper.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessHelper.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -143,6 +143,31 @@
}
}
+ //Probably, Set is enough, but List worked very long successfully
+ //so let'n not take a risk and use Set for optimizing only.
+ private class Binds {
+ List<XModelObject> list = new ArrayList<XModelObject>();
+ Set<XModelObject> set = new HashSet<XModelObject>();
+
+ public void add(XModelObject o) {
+ if(set.contains(o)) return;
+ set.add(o);
+ list.add(o);
+ if(set.size() != list.size()) {
+ System.out.println("Panikk: " + set.size() + " " + list.size());
+ }
+ }
+
+ public int size() {
+ return list.size();
+ }
+
+ public void clear() {
+ list.clear();
+ set.clear();
+ }
+ }
+
private ArrayList<Task> tasks = new ArrayList<Task>();
private void addTask(Task task) {
@@ -176,7 +201,7 @@
private XModelObject config;
private Map<String,XModelObject> objects = new HashMap<String,XModelObject>();
private Map<String,XModelObject> actions = new HashMap<String,XModelObject>();
- private List<XModelObject> binds = new ArrayList<XModelObject>();
+ private Binds binds = new Binds();
private Map<String,XModelObject> pages = new HashMap<String,XModelObject>();
StrutsProcessStructureHelper h = new StrutsProcessStructureHelper();
boolean is_10 = true;
@@ -242,9 +267,9 @@
XModelObject globalExc = config.getChildByPath(ELM_GLOBALEXC);
XModelObject actionMap = config.getChildByPath(ELM_ACTIONMAP);
- Map forwMap = getChildren(globalForw);
- Map excMap = globalExc == null ? new HashMap() : getChildren(globalExc);
- Map actMap = getChildren(actionMap);
+ Map<String,XModelObject> forwMap = getChildren(globalForw);
+ Map<String,XModelObject> excMap = globalExc == null ? new HashMap<String,XModelObject>() : getChildren(globalExc);
+ Map<String,XModelObject> actMap = getChildren(actionMap);
XModelObject[] children = process.getChildren();
for (int i = 0; i < children.length; i++) {
@@ -281,17 +306,14 @@
}
}
- Iterator it = forwMap.values().iterator();
- while (it.hasNext()) {
- reloadForwardInternal(process, (XModelObject)it.next(), null);
+ for(XModelObject o: forwMap.values()) {
+ reloadForwardInternal(process, o, null);
}
- it = excMap.values().iterator();
- while (it.hasNext()) {
- reloadExceptionInternal(process, (XModelObject)it.next(), null);
+ for(XModelObject o: excMap.values()) {
+ reloadExceptionInternal(process, o, null);
}
- it = actMap.values().iterator();
- while (it.hasNext()) {
- reloadActionInternal(process, (XModelObject)it.next(), null);
+ for(XModelObject o: actMap.values()) {
+ reloadActionInternal(process, o, null);
}
cleanObjects();
resolveInternal();
@@ -319,16 +341,14 @@
} else {
prev.removeFromParent();
}
- //binds.addAll(getReferers(name));
}
updateActionInternal(parent, ref, action);
prev = (XModelObject)objects.put(getLocalPath2(action), action);
if (prev != null) {
- //String name = prev.getPathPart();
prev.removeFromParent();
- //binds.addAll(getReferers(parent, name));
}
- binds.addAll(getReferers(parent, action.getPathPart()));
+ List<XModelObject> list = getReferers(parent, action.getPathPart());
+ for (XModelObject o: list) addBind(o);
}
}
@@ -337,6 +357,10 @@
action.removeFromParent();
updateProcess();
}
+
+ private void addBind(XModelObject o) {
+ binds.add(o);
+ }
private XModelObject createAction(XModelObject parent, XModelObject ref) {
Properties props = new Properties();
@@ -362,7 +386,7 @@
String subtype = action.getAttributeValue(ATT_SUBTYPE);
if(!SUBTYPE_UNKNOWN.equals(subtype)) {
//6389//
- List l = getReferers(action.getParent(), action.getPathPart());
+ List<XModelObject> l = getReferers(action.getParent(), action.getPathPart());
if(l.size() == 0) {
action.removeFromParent();
return;
@@ -416,7 +440,7 @@
((ReferenceObjectImpl)forward).setReference(ref);
action.setAttributeValue(ATT_SUBTYPE, subtype);
} else {
- Map refMap = getChildren(ref);
+ Map<String,XModelObject> refMap = getChildren(ref);
XModelObject[] localBinds = action.getChildren();
for (int j = 0; j < localBinds.length; j++) {
String type = localBinds[j].getAttributeValue(ATT_TYPE);
@@ -427,9 +451,7 @@
reloadExceptionInternal(action, refBind, localBinds[j]);
}
}
- Iterator it = refMap.values().iterator();
- while (it.hasNext()) {
- XModelObject refBind = (XModelObject)it.next();
+ for(XModelObject refBind: refMap.values()) {
String entity = refBind.getModelEntity().getName();
if (entity.startsWith(ENT_FORWARD)) {
reloadForwardInternal(action, refBind, null);
@@ -442,7 +464,7 @@
}
XModelObject[] children = action.getChildren();
for (int i = 0; i < children.length; i++) {
- binds.add(children[i]);
+ addBind(children[i]);
}
actions.put(action.getAttributeValue(ATT_PATH), action);
}
@@ -494,7 +516,7 @@
forward.setAttributeValue(ATT_PATH, ref.getAttributeValue(ATT_PATH));
forward.setAttributeValue(ATT_TITLE, name);
((ReferenceObjectImpl)forward).setReference(ref);
- binds.add(forward);
+ addBind(forward);
}
public void reloadException(XModelObject parent, XModelObject ref, XModelObject exception) {
@@ -537,7 +559,7 @@
exception.setAttributeValue(ATT_PATH, ref.getAttributeValue(ATT_PATH));
exception.setAttributeValue(ATT_TITLE, name.substring(name.lastIndexOf('.')+1));
((ReferenceObjectImpl)exception).setReference(ref);
- binds.add(exception);
+ addBind(exception);
}
@@ -546,19 +568,20 @@
}
private void resolveInternal() {
- Iterator it = binds.iterator();
- if(!it.hasNext() && urlPattern != null) return;
-
+ if(binds.size() == 0 && urlPattern != null) return;
+
WebModulesHelper wmh = WebModulesHelper.getInstance(process.getModel());
- Set modules = (is_10) ? new HashSet() : wmh.getModules();
+ Set<String> modules = (is_10) ? new HashSet<String>() : wmh.getModules();
module = (is_10) ? "" : WebModulesHelper.getInstance(process.getModel()).getModuleForConfig(process.getParent());
if(module == null) module = "";
urlPattern = wmh.getUrlPattern(module);
+ Iterator<XModelObject> it = binds.list.iterator();
while (it.hasNext()) {
- XModelObject bind = (XModelObject)it.next();
+ XModelObject bind = it.next();
if (!bind.isActive()) {
it.remove();
+ binds.set.remove(bind);
continue;
}
String path = bind.getAttributeValue(ATT_PATH);
@@ -633,7 +656,7 @@
}
public void removeUnconfirmed() {
- Set set = getReferredTargets(process);
+ Set<String> set = getReferredTargets(process);
XModelObject[] os = process.getChildren();
for (int i = 0; i < os.length; i++) {
if(set.contains(os[i].getPathPart())) continue;
@@ -772,7 +795,7 @@
// drop dead objects
private void cleanObjects() {
if (!process.isActive()) return;
- Iterator it = objects.values().iterator();
+ Iterator<XModelObject> it = objects.values().iterator();
while (it.hasNext()) {
XModelObject o = (XModelObject)it.next();
if (!o.isActive()) it.remove();
@@ -859,7 +882,9 @@
private static void fillReferers(List<XModelObject> list, XModelObject obj, String target) {
XModelObject[] children = obj.getChildren();
for (int i = 0; i < children.length; i++) {
- if (target.equals(children[i].getAttributeValue(ATT_TARGET))) list.add(children[i]);
+ if (target.equals(children[i].getAttributeValue(ATT_TARGET))) {
+ list.add(children[i]);
+ }
fillReferers(list, children[i], target);
}
}
@@ -900,8 +925,8 @@
pu.unlock();
}
- Map osX = new HashMap();
- Map gsX = new HashMap();
+ Map<String,XModelObject> osX = new HashMap<String,XModelObject>();
+ Map<String,XModelObject> gsX = new HashMap<String,XModelObject>();
private void prepareMaps() {
Map<String,XModelObject> os = new HashMap<String,XModelObject>();
@@ -929,9 +954,9 @@
private void updatePageInternal(XModelObject page, JSPLinksParser p) {
if(urlPattern == null) return;
- Map os = osX;
- Map gs = gsX;
- Set ls = p.getAllLinks();
+ Map<String,XModelObject> os = osX;
+ Map<String,XModelObject> gs = gsX;
+ Set<String> ls = p.getAllLinks();
XModelObject[] links = page.getChildren();
for (int i = 0; i < links.length; i++) {
String path = links[i].getAttributeValue(ATT_PATH);
@@ -951,7 +976,7 @@
String subtype = trgobj.getAttributeValue(ATT_SUBTYPE);
String objpath = trgobj.getAttributeValue(ATT_PATH);
if(TYPE_ACTION.equals(type) && SUBTYPE_UNKNOWN.equals(subtype)) {
- List l = getReferers(process, trgobj.getPathPart());
+ List<XModelObject> l = getReferers(process, trgobj.getPathPart());
if(l.isEmpty()) {
actions.remove(objpath);
trgobj.removeFromParent();
@@ -965,18 +990,18 @@
}
}
} else if(trg.length() == 0 || process.getChildByPath(trg) == null) {
- binds.add(links[i]);
+ addBind(links[i]);
}
}
}
- Iterator it = ls.iterator();
- while(it.hasNext()) {
- String path = (String)it.next();
+ for (String path: ls) {
boolean isForward = p.isForward(path);
XModelObject target = (isForward) ? (XModelObject)gs.get(path)
: (XModelObject)os.get(path);
XModelObject link = addLink(page, target, path);
- if(target == null) binds.add(link);
+ if(target == null) {
+ addBind(link);
+ }
}
if(binds.size() > 0) {
resolveInternal();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessStructureHelper.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessStructureHelper.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsProcessStructureHelper.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -327,13 +327,13 @@
if(path == null || !path.startsWith("/")) return null;
XModelObject o = page.getModel().getByPath(path);
if(o == null || is10(page.getParent())) return o;
- Map modules = WebModulesHelper.getInstance(page.getModel()).getWebFileSystems();
+ Map<String,XModelObject> modules = WebModulesHelper.getInstance(page.getModel()).getWebFileSystems();
if(modules.size() < 2) return o;
if(path.startsWith("//")) return null;
String xmodule = getUrlPattern(page).getModule(path, modules.keySet(), null);
if(xmodule != null && xmodule.length() > 0) return null;
String module = getProcessModule(page);
- XModelObject fs = (module == null) ? null : (XModelObject)modules.get(module);
+ XModelObject fs = (module == null) ? null : modules.get(module);
return (fs == null) ? null : fs.getChildByPath(path.substring(1));
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/TilesStructureHelper.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/TilesStructureHelper.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/TilesStructureHelper.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -189,9 +189,9 @@
return WebModulesHelper.getInstance(object.getModel()).getUrlPattern(getProcessModule(object));
}
- public Set getTiles(XModelObject object) {
+ public Set<String> getTiles(XModelObject object) {
XModelObject process = getProcess(object);
- if(process == null) return new TreeSet();
+ if(process == null) return new TreeSet<String>();
StrutsProcessHelper h = StrutsProcessHelper.getHelper(process);
h.updateTiles();
return h.getTiles();
@@ -301,13 +301,13 @@
if(path == null || !path.startsWith("/")) return null;
XModelObject o = page.getModel().getByPath(path);
if(o == null || is10(page.getParent())) return o;
- Map modules = WebModulesHelper.getInstance(page.getModel()).getWebFileSystems();
+ Map<String,XModelObject> modules = WebModulesHelper.getInstance(page.getModel()).getWebFileSystems();
if(modules.size() < 2) return o;
if(path.startsWith("//")) return null;
String xmodule = getUrlPattern(page).getModule(path, modules.keySet(), null);
if(xmodule != null && xmodule.length() > 0) return null;
String module = getProcessModule(page);
- XModelObject fs = (module == null) ? null : (XModelObject)modules.get(module);
+ XModelObject fs = (module == null) ? null : modules.get(module);
return (fs == null) ? null : fs.getChildByPath(path.substring(1));
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/JSPLinksParser.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/JSPLinksParser.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/JSPLinksParser.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -89,7 +89,7 @@
private void parseAdvanced(int b, int e) {
if(links == null) return;
- Set tags = links.getTags();
+ Set<String> tags = links.getTags();
while(b < e) {
int i = source.indexOf("<", b);
if(i < 0) return;
@@ -251,9 +251,9 @@
return false;
}
- private boolean areSetsEqual(Set s1, Set s2) {
+ private boolean areSetsEqual(Set<String> s1, Set<String> s2) {
if(s1.size() != s2.size()) return false;
- Iterator it = s1.iterator();
+ Iterator<String> it = s1.iterator();
while(it.hasNext()) if(!s2.contains(it.next())) return false;
it = s2.iterator();
while(it.hasNext()) if(!s1.contains(it.next())) return false;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/link/Links.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/link/Links.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/page/link/Links.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -20,7 +20,7 @@
ArrayList<LinksListener> listeners = new ArrayList<LinksListener>();
long timeStamp = 0;
- public Set getTags() {
+ public Set<String> getTags() {
return tags;
}
public String[] getTagsArray() {
@@ -55,9 +55,9 @@
link.setReferTo(referTo);
s.add(link);
}
- Iterator it = _tags.iterator();
+ Iterator<String> it = _tags.iterator();
while(it.hasNext()) {
- String tag = it.next().toString();
+ String tag = it.next();
Set<Link> s = (Set<Link>)_links.get(tag);
if(s == null) continue;
Link[] ls = s.toArray(new Link[0]);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/path/SelectActionForwardPathSupport.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/path/SelectActionForwardPathSupport.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/path/SelectActionForwardPathSupport.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -18,7 +18,7 @@
import org.jboss.tools.struts.model.helpers.*;
public class SelectActionForwardPathSupport extends SpecialWizardSupport implements StrutsConstants {
- Set tiles = new TreeSet();
+ Set<String> tiles = new TreeSet<String>();
ActionsTree actions = null;
int tools = 6;
@@ -43,11 +43,10 @@
private void loadTiles() {
tiles.clear();
if((tools & 4) != 0) {
- Set ts = (Set)p.get("tiles");
+ Set<String> ts = (Set)p.get("tiles");
if(ts != null) tiles.addAll(ts);
}
actions = (ActionsTree)p.get("actionsTree");
-// getProperties().put("tiles", tiles);
}
private void loadSelection() {
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectConfiguration.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectConfiguration.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectConfiguration.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -78,9 +78,7 @@
list.add(module);
}
}
- Iterator it = initParams.keySet().iterator();
- while(it.hasNext()) {
- String n = it.next().toString();
+ for (String n: initParams.keySet()) {
XModelObject webModule = (XModelObject)initParams.get(n);
StrutsProjectModule module = (StrutsProjectModule)getModel().createModelObject("StrutsProjectModule", null);
module.setAttributeValue("name", n);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectPlugin.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectPlugin.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -31,8 +31,6 @@
isLoading = true;
valid = true;
try {
- Map initParams = new HashMap();
- initParams.clear();
WebModulesHelper h = WebModulesHelper.getInstance(getModel());
XModelObject[] cs = h.getAllConfigs();
Set<String> uris = new TreeSet<String>();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectTagLibs.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectTagLibs.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectTagLibs.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -29,10 +29,10 @@
protected List<XModelObject> collect(Iterator<XModelObject> rs) {
List<XModelObject> list = super.collect(rs);
- Iterator it = list.iterator();
+ Iterator<XModelObject> it = list.iterator();
Set<String> set = new HashSet<String>();
while(it.hasNext()) {
- XModelObject o = (XModelObject)it.next();
+ XModelObject o = it.next();
String uri = o.getAttributeValue("uri");
if(set.contains(uri)) {
it.remove();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectsRoot.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectsRoot.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsProjectsRoot.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
@@ -138,7 +139,7 @@
}
}
return 0;
- } catch (Exception e) {
+ } catch (CoreException e) {
StrutsModelPlugin.getPluginLog().logError(e);
return 0;
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsPromptingProvider.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsPromptingProvider.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/pv/StrutsPromptingProvider.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -16,7 +16,6 @@
import org.jboss.tools.common.model.java.handlers.OpenJavaSourceHandler;
import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.struts.StrutsModelPlugin;
import org.jboss.tools.struts.model.helpers.open.*;
import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
@@ -64,14 +63,10 @@
error = h.run(model, forward);
} else if(STRUTS_OPEN_LINK_PAGE.equals(id)) {
String page = prefix;
- try {
- if(new File(page).isFile()) {
- List<Object> l = new ArrayList<Object>();
- l.add(page);
- return l;
- }
- } catch (Exception e) {
- StrutsModelPlugin.getPluginLog().logError(e);
+ if(page != null && new File(page).isFile()) {
+ List<Object> l = new ArrayList<Object>();
+ l.add(page);
+ return l;
}
IFile f = (IFile)properties.get(FILE);
OpenLinkPageHelper h = new OpenLinkPageHelper();
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddMessagesHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddMessagesHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddMessagesHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -47,10 +47,13 @@
}
private XModelObject getTemplate(XModel model) {
+ if(action == null) return null;
+ String v = action.getProperty("index");
+ if(v == null || v.length() == 0) return null;
int i = -1;
try {
- i = Integer.valueOf(action.getProperty("index")).intValue();
- } catch (Exception e) {
+ i = Integer.parseInt(v);
+ } catch (NumberFormatException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
return getTemplate(model, i);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddSpecialPluginHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddSpecialPluginHandler.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/plugins/model/handlers/AddSpecialPluginHandler.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -73,10 +73,13 @@
}
private XModelObject getPlugin(XModel model) {
+ if(action == null) return null;
+ String v = action.getProperty("index");
+ if(v == null || v.length() == 0) return null;
int i = -1;
try {
- i = Integer.valueOf(action.getProperty("index")).intValue(); //$NON-NLS-1$
- } catch (Exception e) {
+ i = Integer.parseInt(v);
+ } catch (NumberFormatException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
if(i < 0) return null;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorLoader.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorLoader.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorLoader.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -54,7 +54,7 @@
int p = -1;
try {
p = Integer.parseInt(pos);
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
if(p < 0) p = 0;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.struts.validators.model;
+import java.io.IOException;
+
import org.jboss.tools.common.model.loaders.*;
import org.jboss.tools.common.xml.XMLEntityResolver;
import org.jboss.tools.struts.StrutsModelPlugin;
@@ -19,7 +21,7 @@
try {
XMLEntityResolver.registerPublicEntity(DOC_PUBLICID, FileValidatorRecognizer.class, "/meta/validator_1_0.dtd");
XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_11, FileValidatorRecognizer.class, "/meta/validator_1_1_3.dtd");
- } catch (Exception e) {
+ } catch (IOException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/ValidatorArg11Impl.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/ValidatorArg11Impl.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/ValidatorArg11Impl.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -37,7 +37,7 @@
if(pos != null && pos.length() > 0) {
try {
p = Integer.parseInt(pos);
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectStepLocation.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectStepLocation.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectStepLocation.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -18,7 +18,6 @@
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.struts.messages.StrutsUIMessages;
-import org.jboss.tools.jst.web.project.helpers.NewWebProjectHelper;
public class AdoptProjectStepLocation extends AWStep {
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectSupport.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectSupport.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectSupport.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -55,7 +55,7 @@
setAttributeValue(0, "location", presetLocation);
try {
action(NEXT);
- } catch (Exception e) {
+ } catch (XModelException e) {
//obsolete //ignore
StrutsModelPlugin.getPluginLog().logError(e);
return;
@@ -68,7 +68,7 @@
setAttributeValue(0, "location", presetLocation);
try {
action(NEXT);
- } catch (Exception e) {
+ } catch (XModelException e) {
//obsolete //ignore
StrutsModelPlugin.getPluginLog().logError(e);
return;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/sync/SyncProjectContext.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -111,7 +111,8 @@
private boolean updateDescribedModulesInfo() {
boolean modified = false;
String[][] ms = AdoptProjectContext.getModules(webxml);
- Map d = (Map)((HashMap)describedModules).clone();
+ Map<String,String> d = new HashMap<String, String>();
+ d.putAll(describedModules);
for (int i = 0; i < ms.length; i++) {
String s = (String)d.remove(ms[i][0]);
if(s != null && s.equals(ms[i][1])) continue;
@@ -119,7 +120,7 @@
describedModules.put(ms[i][0], ms[i][1]);
}
modified |= d.size() > 0;
- Iterator it = d.keySet().iterator();
+ Iterator<String> it = d.keySet().iterator();
if(it==null) return false;
while(it.hasNext()) describedModules.remove(it.next());
return modified;
@@ -128,11 +129,11 @@
private boolean updateInstalledModulesInfo() {
boolean modified = false;
if(getWebObject() == null) {
-// System.out.println("Web object is not found.");
return false;
}
XModelObject[] cs = web.getChildren(WebModulesHelper.ENT_STRUTS_WEB_MODULE);
- Map d = (Map)((HashMap)installedModules).clone();
+ Map<String,XModelObject> d = new HashMap<String, XModelObject>();
+ d.putAll(installedModules);
for (int i = 0; i < cs.length; i++) {
String n = cs[i].getAttributeValue("name"); //$NON-NLS-1$
XModelObject c = (XModelObject)d.remove(n);
@@ -141,18 +142,19 @@
installedModules.put(n, cs[i]);
}
modified |= d.size() > 0;
- Iterator it = d.keySet().iterator();
+ Iterator<String> it = d.keySet().iterator();
while(it.hasNext()) installedModules.remove(it.next());
return modified;
}
private void updateModulesInfo() {
modulesMap.clear();
- Map d = (Map)((HashMap)installedModules).clone();
- Iterator it = describedModules.keySet().iterator();
+ Map<String,XModelObject> d = new HashMap<String, XModelObject>();
+ d.putAll(installedModules);
+ Iterator<String> it = describedModules.keySet().iterator();
while(it.hasNext()) {
- String n = (String)it.next();
- String uri = (String)describedModules.get(n);
+ String n = it.next();
+ String uri = describedModules.get(n);
WebModuleImpl m = (WebModuleImpl)d.remove(n);
if(m == null) {
m = (WebModuleImpl)adoptContext.createModuleInfo(model, n, uri, webinf, false);
@@ -168,8 +170,8 @@
}
it = d.keySet().iterator();
while(it.hasNext()) {
- String n = (String)it.next();
- XModelObject m = (XModelObject)d.get(n);
+ String n = it.next();
+ XModelObject m = d.get(n);
setAbsolutePaths(m);
m = m.copy();
m.set("state", "deleted"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -313,7 +315,8 @@
try {
checkStrutsConfig(path);
} catch (Exception e) {
- StrutsModelPlugin.getPluginLog().logError(e);
+ //Do not log this exception. It is thrown to be showed
+ //in wizard as user input error.
return e.getMessage();
}
}
@@ -377,9 +380,7 @@
///validateAttributes();
collectOldFileSystems();
servlet = StrutsWebHelper.getServlet(webxml);
- Iterator it = modulesMap.keySet().iterator();
- while(it.hasNext()) {
- String n = (String)it.next();
+ for (String n: modulesMap.keySet()) {
// String view_n = getModuleDisplayName(n);
XModelObject o = (XModelObject)modulesMap.get(n);
if(executeDeleteA(o) == 1) continue;
@@ -396,10 +397,8 @@
}
private boolean checkNewPaths() {
- Iterator it = modulesMap.keySet().iterator();
Set<String> checkedPaths = new HashSet<String>();
- while(it.hasNext()) {
- String n = (String)it.next();
+ for (String n: modulesMap.keySet()) {
// String view_n = getModuleDisplayName(n);
XModelObject o = (XModelObject)modulesMap.get(n);
if("deleted".equals(o.get("state"))) continue; //$NON-NLS-1$ //$NON-NLS-2$
@@ -452,9 +451,7 @@
}
private void executeDelete() {
- Iterator it = oldFileSystems.values().iterator();
- while(it.hasNext()) {
- XModelObject fs = (XModelObject)it.next();
+ for (XModelObject fs: oldFileSystems.values()) {
if(fs != null && fs.isActive()) {
if("WEB-ROOT".equals(fs.getAttributeValue("name"))) continue; //$NON-NLS-1$ //$NON-NLS-2$
DefaultRemoveHandler.removeFromParent(fs);
@@ -462,10 +459,8 @@
}
oldFileSystems.clear();
newFileSystems.clear();
- it = modulesMap.keySet().iterator();
- while(it.hasNext()) {
- String n = (String)it.next();
- XModelObject o = (XModelObject)modulesMap.get(n);
+ for (String n: modulesMap.keySet()) {
+ XModelObject o = modulesMap.get(n);
if("deleted".equals(o.get("state"))) deleteModule(n); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -640,9 +635,7 @@
replacedSrc.clear();
oldFileSystems.clear();
newFileSystems.clear();
- Iterator it = installedModules.keySet().iterator();
- while(it.hasNext()) {
- String n = (String)it.next();
+ for (String n: installedModules.keySet()) {
XModelObject m = (XModelObject)installedModules.get(n);
collectOldFileSystem(m, ATTR_ROOT_FS);
collectOldFileSystem(m, ATTR_SRC_FS);
@@ -662,7 +655,7 @@
private void removeObsoleteModules() {
- Iterator it = installedModules.keySet().iterator();
+ Iterator<String> it = installedModules.keySet().iterator();
while(it.hasNext()) {
String n = (String)it.next();
String uri = (String)describedModules.get(n);
@@ -683,9 +676,7 @@
removeObsoleteModules();
if(describedModules.size() != installedModules.size())
return StrutsUIMessages.MODULES_DESCRIBED_IN_WEBXML_ARENT_SYNCHRONIZED;
- Iterator it = installedModules.keySet().iterator();
- while(it.hasNext()) {
- String n = (String)it.next();
+ for (String n: installedModules.keySet()) {
String uri = (String)describedModules.get(n);
if(uri == null) return NLS.bind(StrutsUIMessages.MODULE_DOESNT_DEFINE_URI,getModuleDisplayName(n));
WebModuleImpl m = (WebModuleImpl)installedModules.get(n);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PostfixUrlPattern.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PostfixUrlPattern.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PostfixUrlPattern.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -35,7 +35,7 @@
return path;
}
- public String getModule(String path, Set modules, String thisModule) {
+ public String getModule(String path, Set<String> modules, String thisModule) {
if(path == null || path.length() < 2 || path.startsWith("//")) return "";
int i = path.indexOf("/", 1);
if(i < 0) return thisModule;
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PrefixUrlPattern.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PrefixUrlPattern.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/PrefixUrlPattern.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -33,7 +33,7 @@
? path : (!path.startsWith("/")) ? prefix + path : prefix + path.substring(1);
}
- public String getModule(String path, Set modules, String thisModule) {
+ public String getModule(String path, Set<String> modules, String thisModule) {
if(path == null || path.length() < 2 || path.startsWith("//")) return "";
int i0 = path.startsWith(prefix) ? prefix.length() : 1;
int i = path.indexOf('/', i0);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/UrlPattern.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/UrlPattern.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/pattern/UrlPattern.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -16,7 +16,7 @@
public boolean isActionUrl(String path);
public String getActionPath(String url);
public String getActionUrl(String path);
- public String getModule(String path, Set modules, String thisModule);
+ public String getModule(String path, Set<String> modules, String thisModule);
public String getContextRelativePath(String path, String module);
public String getModuleRelativePath(String path, String module);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/resource/ResourceMapping.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/resource/ResourceMapping.java 2008-03-25 14:02:00 UTC (rev 7107)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/resource/ResourceMapping.java 2008-03-25 14:16:56 UTC (rev 7108)
@@ -32,13 +32,11 @@
createInfos(modules);
}
- private boolean isUpToDate(Set modules) {
+ private boolean isUpToDate(Set<String> modules) {
if(modules.size() != infos.size()) return false;
- Iterator it = modules.iterator();
boolean result = true;
- while(it.hasNext()) {
- Object key = it.next();
- ConfigInfo i = (ConfigInfo)infos.get(key);
+ for (String key: modules) {
+ ConfigInfo i = infos.get(key);
if(i == null) {
result = false;
} else if(!i.isUpToDate()) {
18 years
JBoss Tools SVN: r7107 - in trunk/jsf/docs: jsf_tools_tutorial and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-03-25 10:02:00 -0400 (Tue, 25 Mar 2008)
New Revision: 7107
Added:
trunk/jsf/docs/jsf_tools_tutorial/
trunk/jsf/docs/jsf_tools_tutorial/en/
trunk/jsf/docs/jsf_tools_tutorial/en/images/
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_1.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_10.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_11.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_12.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_13.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_14.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_15.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_16.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_17.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_2.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_3.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_4.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_5.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_6.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_7.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_8.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_9.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_1.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_10.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_2.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_3.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_4.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_5.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_6.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_7.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_8.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_9.png
trunk/jsf/docs/jsf_tools_tutorial/en/master.xml
trunk/jsf/docs/jsf_tools_tutorial/en/modules/
trunk/jsf/docs/jsf_tools_tutorial/en/modules/introduction.xml
trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml
trunk/jsf/docs/jsf_tools_tutorial/pom.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - new "JSF Tools Tutorial" is created now
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_10.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_11.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_11.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_12.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_13.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_13.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_14.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_15.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_15.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_16.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_17.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_17.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_4.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_5.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_7.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_8.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_9.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/business_application/business_application_9.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_10.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_4.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_5.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_7.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_8.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_9.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_tutorial/en/images/jsf_application/jsf_application_9.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_tutorial/en/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en/master.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_tutorial/en/master.xml 2008-03-25 14:02:00 UTC (rev 7107)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+"../../../resources/support/docbook-dtd/docbookx.dtd"
+
+[<!ENTITY introduction SYSTEM "modules/introduction.xml">
+<!ENTITY jsf_application SYSTEM "modules/jsf_application.xml">
+]>
+
+<book>
+
+ <bookinfo>
+ <title>JSF Tools Tutorial</title>
+
+ <copyright>
+ <year>2007</year>
+ <holder>Red Hat</holder>
+ </copyright>
+
+ <releaseinfo>
+<para>Version: 1.0.0.GA</para>
+</releaseinfo>
+ </bookinfo>
+
+ <toc/>
+
+
+ &introduction;
+ &jsf_application;
+
+
+</book>
Added: trunk/jsf/docs/jsf_tools_tutorial/en/modules/introduction.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en/modules/introduction.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_tutorial/en/modules/introduction.xml 2008-03-25 14:02:00 UTC (rev 7107)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction" xreflabel="introduction">
+ <?dbhtml filename="introduction.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Introduction</title>
+ <para>The following chapters describe how to deal with classic/old style of JSF development. We
+ recommend users to use <ulink url="../../../seam/en/html/create_new_seam.html">JBoss
+ Seam</ulink> to simplify development, but until then you can read about classical JSF
+ usage here.</para>
+</chapter>
Added: trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml 2008-03-25 14:02:00 UTC (rev 7107)
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="jsf_application" xreflabel="jsf_application">
+ <?dbhtml filename="jsf_application.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>JSF application</keyword>
+ <keyword>Java</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Getting Started Guide for
+Creating a JSF Application</title>
+<section id="CreatingAJSFApplication">
+<?dbhtml filename="GettingStartedForCreatingAJSFApplication.html"?>
+<title>Creating a Simple JSF Application</title>
+ <para>We are going to show you how to create a simple <property>JSF application </property>using the JBoss Developer Studio plug-in for Eclipse. The completed application will ask a user to enter a name and click
+a button. The resulting new page will display the familiar message, "Hello <name>!"
+This document will show you how to create such an application from the beginning, along
+the way demonstrating some of the powerful features of JBoss Developer Studio. You will design the
+JSF application and then run the application from inside JBoss Developer Studio.
+We'll assume that you have already launched Eclipse with JBoss Developer Studio installed and
+also that the JBoss Developer Studio perspective is the current one. (If not, make it active by
+selecting <emphasis><property>Window > Open Perspective > Web Development</property></emphasis> from the menu bar or by selecting <emphasis><property>Window > Open Perspective > Other...</property></emphasis> from the menu bar and then selecting <emphasis><property>Web Development</property></emphasis> from the Select Perspective dialog box.)</para>
+</section>
+<section id="SettingUpTheProject">
+<?dbhtml filename="SettingUpTheProject.html"?>
+<title>Setting Up the Project</title>
+<para>We are first going to create a new project for the application.</para>
+<itemizedlist>
+<listitem><para>Go to the menu bar and select <emphasis><property>File > New > Project...</property></emphasis></para></listitem>
+<listitem><para>Select <emphasis><property>JBoss Tools Web > JSF > JSF Project</property></emphasis> in the New Project dialog box</para></listitem>
+<listitem><para>Click <emphasis><property>Next</property></emphasis></para></listitem>
+<listitem><para>Enter "jsfHello" as the project name.</para></listitem>
+ <listitem><para>Leave everything else as is, and click <emphasis><property>Finish</property></emphasis></para></listitem>
+
+</itemizedlist>
+</section>
+<section id="TheJSFApplicationConfigurationFile">
+<?dbhtml filename="TheJSFApplicationConfigurationFile.html"?>
+<title>The JSF Application Configuration File</title>
+<para>A jsfHello node should appear in the upper-left Package Explorer view.</para>
+ <figure>
+ <title>Package Explorer View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+<itemizedlist continuation="continues">
+ <listitem><para>Click the plus sign next to <emphasis><property>jsfHello</property></emphasis> to reveal the child nodes</para></listitem>
+ <listitem><para>Click the plus sign next to <emphasis><property>WebContent</property></emphasis> under jsfHello</para></listitem>
+ <listitem><para>Click the plus sign next to <emphasis><property>WEB-INF</property></emphasis> under WebContent</para></listitem>
+
+ <listitem><para>Then double-click on the <property>faces-config.xml</property> node to display the JSF application configuration file editor</para></listitem>
+</itemizedlist>
+<figure>
+ <title>Configuration File Editor</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_2.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+</section>
+<section id="AddingNavigationToTheApplication">
+<?dbhtml filename="AddingNavigationToTheApplication.html"?>
+<title>Adding Navigation to the Application</title>
+<para>In our simple application, the flow is defined as a single navigation rule connecting two
+views (presentation files). At this point, we will create the placeholders for the two JSP presentation
+files and then the navigation rule to connect them as views. Later, we will complete
+the coding for the JSP presentation files. With JBoss Developer Studio, we can do all of this in the
+Diagram mode of the configuration file editor.</para>
+<section id="AddingTwoViews(JSPPages)">
+<?dbhtml filename="AddingTwoViews(JSPPages).html"?>
+<title>Adding Two Views (JSP Pages)</title>
+<itemizedlist continuation="continues">
+<listitem><para>Right-click anywhere on the diagram and select <emphasis><property>New View...</property></emphasis> from the pop-up
+menu</para></listitem>
+ <listitem><para>In the dialog box, type <emphasis><property>pages/inputname</property></emphasis> as the value for From-view-id</para></listitem>
+<listitem><para>Leave everything else as is</para></listitem>
+ <listitem><para>Click <emphasis><property>Finish</property></emphasis></para>
+ <para>If you look in the Package Explorer view you should see a <emphasis><property>pages</property></emphasis> folder under WebContent. Opening it
+will reveal the JSP file you just created</para>
+</listitem>
+<listitem><para>Back on the diagram, right-click anywhere and select <emphasis><property>New View...</property></emphasis> from the pop-up
+menu</para></listitem>
+<listitem><para>In the dialog box, type <emphasis><property>pages/greeting</property></emphasis> as the value for From-view-id</para></listitem>
+<listitem><para>Leave everything else as is</para></listitem>
+ <listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
+</itemizedlist>
+
+ <section id="CreatingTheTransition(NavigationRule)">
+<?dbhtml filename="CreatingTheTransition(NavigationRule).html"?>
+<title>Creating the Transition (Navigation Rule)</title>
+<itemizedlist continuation="continues">
+<listitem><para>In the diagram, select the connection icon third from the top along the upper left
+side of the diagram</para></listitem>
+</itemizedlist>
+<figure>
+ <title>Connection Icon</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_3.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>to get an arrow cursor with a two-pronged plug at the arrow's bottom.</para>
+<itemizedlist continuation="continues">
+<listitem><para>Click on the <emphasis><property>pages/inputname</property></emphasis> page icon and then click on the <emphasis><property>pages/greeting</property></emphasis> page icon</para></listitem>
+
+</itemizedlist>
+<para>A transition should appear between the two icons.</para>
+<figure>
+<title>Transition Between Two Icons</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_4.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem><para>Select <emphasis><property>File > Save</property></emphasis> from the menu bar</para></listitem>
+</itemizedlist>
+</section>
+</section>
+</section>
+<section id="AddingAManagedBeanToTheApplication">
+<?dbhtml filename="AddingAManagedBeanToTheApplication.html"?>
+<title>Adding a Managed Bean to the Application</title>
+<para>To store data in the application, we will use a managed bean.</para>
+<itemizedlist continuation="continues">
+ <listitem><para>Click on the <emphasis><property>Tree</property></emphasis> tab at the bottom of the editing window</para></listitem>
+ <listitem><para>Select the <emphasis><property>Managed Beans</property></emphasis> node and then click the <emphasis><property>Add...</property></emphasis> button displayed along
+the right side of the editor window</para></listitem>
+ <listitem><para>Type in <emphasis><property>jsfHello.PersonBean</property></emphasis> for Class and <emphasis><property>personBean</property></emphasis> for Name. Leave
+Scope as is and Generate Source Code as is (checked)</para></listitem>
+ <listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
+ <listitem><para>personBean will now be selected and three sections of information: <emphasis><property>Managed
+ Bean</property></emphasis>, <emphasis><property>Properties</property></emphasis>, and <emphasis><property>Advanced</property></emphasis>, will be displayed about it. Under the Properties
+section, click the <emphasis><property>Add...</property></emphasis> button</para></listitem>
+ <listitem><para>Type in <emphasis><property>name</property></emphasis> for Property-Name. Leave everything else as is. (When Property-
+Class is not filled in, String is the assumed type)</para></listitem>
+ <listitem><para>Click <emphasis><property>Finish</property></emphasis></para></listitem>
+ <listitem><para>Select the <emphasis><property>personBean</property></emphasis> node in the tree</para></listitem>
+</itemizedlist>
+<para>You should see this now:</para>
+<figure>
+<title>Tree View in Config Editor</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_5.png" scale="85"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem><para>Select <emphasis><property>File > Save</property></emphasis> from the menu bar</para></listitem>
+</itemizedlist>
+ <para>You have now registered the <emphasis><property>managed bean</property></emphasis> and created a <emphasis><property>stub-coded class</property></emphasis> file for it.</para>
+</section>
+<section id="EditingTheJSPViewFiles">
+<?dbhtml filename="EditingTheJSPViewFiles.html"?>
+<title>Editing the JSP View Files</title>
+
+<para>Now we will finish editing the JSP files for our two "views" using JSP Visual Page.</para>
+<section id="Inputname.jsp">
+<title>inputname.jsp</title>
+<itemizedlist continuation="continues">
+ <listitem><para>Click on the <emphasis><property>Diagram</property></emphasis> tab for the configuration file editor</para></listitem>
+<listitem><para>Open the editor for this first JSP file by double-clicking on the <emphasis><property>/pages/inputname.
+jsp</property></emphasis> icon</para></listitem>
+</itemizedlist>
+
+<para>The Visual Page Editor will open in a screen split between source code along the top and
+a WYSIWIG view along the bottom:</para>
+<figure>
+ <title>Visual Page Editor</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_6.png" />
+ </imageobject>
+</mediaobject>
+</figure>
+ <para>Some JSF code is already in the file, because we have chosen a template to create a page.</para>
+<itemizedlist continuation="continues">
+ <listitem><para>Select the <emphasis><property>Visual</property></emphasis> tab, so we can work with the editor completely in its WYSIWYG
+mode</para></listitem>
+ <listitem><para>To the right of the editor, in the JBoss Tools Palette, expand the <emphasis><property>JSF HTML</property></emphasis> palette folder
+by selecting it</para></listitem>
+</itemizedlist>
+<figure>
+ <title>JBoss Tools Palette</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_7.png" />
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+ <listitem><para>Click on <emphasis><property>form</property></emphasis> within this folder, drag the cursor over to the editor,
+and drop it inside the red box in the editor</para></listitem>
+
+<listitem><para>Another red box will appear inside the first red box</para></listitem>
+
+<listitem><para>Right-click on the innermost box and select <emphasis role="bold"><property><h:form></property></emphasis> Attributes from the menu</para></listitem>
+ <listitem><para>In the value field next to id, type <emphasis><property>greeting</property></emphasis> and click on the <emphasis><property>Close</property></emphasis> button</para></listitem>
+<listitem><para>Type "Please enter name:" inside the boxes</para></listitem>
+ <listitem><para>Select <emphasis><property>inputText</property></emphasis> within the JSF HTML palette folder and drag it into the innermost
+box in the editor after "Please enter name:"</para></listitem>
+ <listitem><para>In the attributes dialog, click in the <emphasis><property>value</property></emphasis> field next to the value attribute and click
+ on the <property>... </property>button</para></listitem>
+ <listitem><para>Then, select the <emphasis><property>Managed Beans > personBean > name</property></emphasis> node and click on the <emphasis><property>Ok</property></emphasis>
+button</para></listitem>
+ <listitem><para>Back in the attributes dialog, select the <emphasis><property>Advanced</property></emphasis> tab, type in <emphasis><property>name</property></emphasis> as the value
+ for the <emphasis role="italic"><property>"id"</property></emphasis> attribute, and then click on the <emphasis><property>Finish</property></emphasis> button</para></listitem>'
+ <listitem><para>Select <emphasis><property>commandButton</property></emphasis> within the JSF HTML palette folder and drag it into the
+innermost box in the editor after the input box</para></listitem>
+ <listitem><para>In the attributes dialog, click in the value field next to the <emphasis role="italic"><property>"action"</property></emphasis> attribute and click on the <property>... </property>button</para></listitem>
+ <listitem><para>Then, select the <emphasis><property>View Actions > greeting</property></emphasis> node and click on the <emphasis><property>OK</property></emphasis> button</para></listitem>
+<listitem><para>Back in the attributes dialog box, type in "Say Hello" as the value for the value
+ attribute ("Say Hello") and then click on the <emphasis><property>Finish</property></emphasis> button</para></listitem>
+</itemizedlist>
+<para>The source coding should be something like this now:</para>
+<programlisting role="XML"><![CDATA[<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<f:view>
+<h:form id="greeting">
+<para>Please enter a name:</para>
+<h:inputText id="name" value="#{personBean.name}"/>
+<h:commandButton value=" Say Hello " action="greeting"/>
+</h:form>
+</f:view>
+</body>
+</html>
+]]></programlisting>
+<para>The editor should look like this:</para>
+<figure>
+ <title>Visual Page Editor</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_8.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem><para>Save the file by selecting <emphasis><property>File > Save</property></emphasis> from the menu bar</para></listitem>
+</itemizedlist>
+</section>
+<section id="Greeting.jsp">
+<title>greeting.jsp</title>
+<itemizedlist continuation="continues">
+ <listitem><para>Click on the <emphasis><property>faces-config.xml</property></emphasis> tab to bring the diagram back</para></listitem>
+<listitem><para>Open the editor for the second file by double-clicking on the <emphasis><property>/pages/greeting.jsp</property></emphasis>
+icon</para></listitem>
+ <listitem><para>Select the <emphasis><property>Visual</property></emphasis> tab, so we can work with the editor completely in its WYSIWYG
+mode</para></listitem>
+<listitem><para>Type "Hello "(note space after Hello) into the box</para></listitem>
+ <listitem><para>Select <emphasis><property>outputText</property></emphasis> within the JSF HTML palette folder and drag it into the innermost
+box in the editor after "Hello"</para></listitem>
+ <listitem><para>In the attributes dialog, click in <emphasis><property>value</property></emphasis> field next to the value attribute and click on
+ the <property>...</property> (Browse) button</para></listitem>
+ <listitem><para>Then, select the <emphasis><property>Managed Beans > personBean > name</property></emphasis> node, click on the <emphasis><property>Ok</property></emphasis> button,
+ and then click on the <emphasis><property>Finish</property></emphasis> button</para></listitem>
+ <listitem><para>Right after the output field, type an <emphasis><property>exclamation point</property></emphasis> (<emphasis><property>!</property></emphasis>)</para></listitem>
+</itemizedlist>
+<para>The source coding should be something like this now:</para>
+<programlisting role="XML"><![CDATA[<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<f:view>
+Hello <h:outputText value="#{personBean.name}"/>!
+</f:view>
+</body>
+</html>
+]]></programlisting>
+<itemizedlist continuation="continues">
+<listitem><para>Save the file</para></listitem></itemizedlist>
+</section>
+</section>
+<section id="CreatingTheStartPage">
+<?dbhtml filename="CreatingTheStartPage.html"?>
+<title>Creating the Start Page</title>
+<para>You also need to create a start page as an entry point into the application.</para>
+<itemizedlist continuation="continues">
+<listitem><para>In the Package Explorer view to the left, right-click <emphasis><property>jsfHello > WebContent</property></emphasis> and select
+ <emphasis><property>New > JSP File</property></emphasis></para></listitem>
+ <listitem><para>For Name type in <emphasis><property>index</property></emphasis>, for Template select <emphasis><property>JSPRedirect</property></emphasis> and click <emphasis><property>Finish</property></emphasis></para></listitem>
+</itemizedlist>
+<para>A JSP editor will open up on the newly created file.</para>
+
+<itemizedlist continuation="continues">
+<listitem><para>In the Source part of the split screen, type <emphasis><property>/pages/inputname.jsf</property></emphasis> in between
+the quotes for the page attribute</para></listitem>
+</itemizedlist>
+<para>The source coding should look like this now:</para>
+<programlisting role="XML"><![CDATA[<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+<body>
+<jsp:forward page="/pages/inputname.jsf" />
+</body>
+</html>
+]]></programlisting>
+
+<para>Note the <emphasis><property>.jsf</property></emphasis> extension for the file name. This is a mapping defined in the web.xml file
+for the project for invoking <property>JavaServer Faces</property> when you run the application.</para>
+<itemizedlist continuation="continues">
+<listitem><para>Select<emphasis><property> File > Save</property></emphasis> from the menu bar</para></listitem>
+</itemizedlist>
+</section>
+<section id="RunningTheApplicationJSF">
+<?dbhtml filename="RunningTheApplicationJSF.html"?>
+<title>Running the Application</title>
+<para>Everything is now ready for running our application without having to leave JBoss Developer Studio
+by using the JBoss engine that comes with the JBoss Developer Studio plug-in. For controlling JBoss server within JBoss Developer Studio there is JBoss Server view:</para>
+<figure>
+ <title>JBoss Server View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_9.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist continuation="continues">
+<listitem><para>Start up JBoss by clicking on the icon in JBoss Server view. (If JBoss is already running,
+stop it by clicking on the red icon and then start it again. Remember, the JSF run-time requires restarting the servlet engine when any changes have been made.) After the messages in the Console tabbed view stop scrolling, JBoss is available</para></listitem>
+
+<listitem><para>Click the Run icon or right click your project folder and select <emphasis><property>Run As > Run on Server</property></emphasis>:</para></listitem>
+</itemizedlist>
+<figure>
+ <title>Run Icon</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_application/jsf_application_10.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+ <para>This is the equivalent of launching the browser and typing <emphasis><property>http://localhost:8080/jsfHello</property></emphasis> into your
+ browser. Our <property>JSF application</property> should now appear.</para>
+ </section>
+
+ <section id="OtherRelevantResourcesOnTheTopic3">
+<?dbhtml filename="OtherRelevantResourcesOnTheTopic3.html"?>
+<title>Other relevant resources on the topic</title>
+<para>JSF on Sun: <ulink url="http://java.sun.com/javaee/javaserverfaces/">JavaServer Faces Technology</ulink></para>
+<para>Core JSF: <ulink url="http://www.horstmann.com/corejsf/">Core JavaServer Faces</ulink></para>
+<para>API: <ulink url="http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/index.html">JSF API</ulink></para>
+<para>JSF Tags: <ulink url="http://www.horstmann.com/corejsf/jsf-tags.html">JSF Core Tags</ulink></para>
+<para>HTML Tags Reference: <ulink url="http://www.exadel.com/tutorial/jsf/jsftags-guide.html">JSF HTML Tags Reference</ulink></para>
+<para>JSF Central: <ulink url="http://www.jsfcentral.com/">JSF Central - Your JavaServer Faces Community</ulink></para>
+<para>FAQ: <ulink url="http://wiki.java.net/bin/view/Projects/JavaServerFacesSpecFaq">JSF FAQ</ulink></para>
+<para>Download: <ulink url="http://java.sun.com/javaee/javaserverfaces/download.html">JavaServer Faces Technology - Download</ulink></para>
+</section>
+ </chapter>
\ No newline at end of file
Added: trunk/jsf/docs/jsf_tools_tutorial/pom.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/pom.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_tutorial/pom.xml 2008-03-25 14:02:00 UTC (rev 7107)
@@ -0,0 +1,104 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jsf-tools-tutorial-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>JSF_Tools_Tutorial_(${translation})</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.0.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.docs</groupId>
+ <artifactId>highlight</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <!--<cssResource>
+ <directory>src/main/css</directory>
+ </cssResource>-->
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/nochunk-html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <translation>en-US</translation>
+ </properties>
+
+
+</project>
18 years
JBoss Tools SVN: r7106 - in trunk/jsf/docs: jsf_tools_ref_guide and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-03-25 09:56:19 -0400 (Tue, 25 Mar 2008)
New Revision: 7106
Added:
trunk/jsf/docs/jsf_tools_ref_guide/
trunk/jsf/docs/jsf_tools_ref_guide/en/
trunk/jsf/docs/jsf_tools_ref_guide/en/images/
trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_project_verification.xml
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_tools.xml
trunk/jsf/docs/jsf_tools_ref_guide/pom.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - new "JSF Tools Ref Guide" is created now from the "JSF support" chapter in Visual Web Tools guide
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml 2008-03-25 13:56:19 UTC (rev 7106)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+"../../resources/support/docbook-dtd/docbookx.dtd"
+
+[
+<!ENTITY intoduction SYSTEM "modules/introduction.xml">
+<!ENTITY jsf_tools SYSTEM "modules/jsf_tools.xml">
+<!ENTITY jsf_project_verification SYSTEM "modules/jsf_project_verification.xml">
+]>
+<book>
+ <bookinfo>
+ <title>JSF Tools Reference Guide</title>
+ <copyright>
+ <year>2008</year>
+ <holder>Red Hat</holder>
+ </copyright>
+ <releaseinfo>
+ <para>Version: 2.0.0.GA</para>
+ </releaseinfo>
+ </bookinfo>
+
+ <toc/>
+
+ &introduction;
+ &jsf_tools;
+ &jsf_project_verification;
+</book>
\ No newline at end of file
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml 2008-03-25 13:56:19 UTC (rev 7106)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction">
+ <?dbhtml filename="introduction.html"?>
+
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>JSF Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Introduction</title>
+
+ <para>This guide provides information on JSF tooling in JBoss Developer Studio
+ which allows you to develop JSF applications much faster and with far fewer
+ errors so sparing your time.</para>
+</chapter>
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_project_verification.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_project_verification.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_project_verification.xml 2008-03-25 13:56:19 UTC (rev 7106)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="jsf_project_verification">
+ <?dbhtml filename="struts_project_verification.html"?>
+
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>JSF Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>JSF Project Verification</title>
+
+ <para>JBoss Developer Studio checks for many different rules for a JSF
+ project that can be configured by selecting <emphasis>
+ <property>Window > Preferences</property>
+ </emphasis> from the menu bar, selecting <emphasis>
+ <property>JBoss Tools > Web > Verification</property>
+ </emphasis> from the Preferences dialog box and then expanding the
+ JSF Rules node.</para>
+ <figure>
+ <title>JSF Rules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_1.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Suppose you are working in the Source viewer for a JSF configuration
+ file as shown below:</para>
+ <figure>
+ <title>Faces-config.xml File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_2.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>While typing a class name, you might make a minor typo (like <emphasis
+ role="italic">
+ <property>"jsfHello.PersonBean9"</property>
+ </emphasis> instead of <emphasis role="italic">
+ <property>"jsfHello.PersonBean"</property>
+ </emphasis>). After saving the file, verification checks to make
+ sure everything is correct and finds the error below:</para>
+ <figure>
+ <title>Error in Source View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_3.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 an error message and get a
+ detailed error message:</para>
+ <figure>
+ <title>Error Message</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_4.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Verification also checks navigation rules:</para>
+ <figure>
+ <title>Checking Navigation Rules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_5.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>If you provide a page name that does not exist, verification will let
+ you know about that:</para>
+ <figure>
+ <title>Page Name Verification</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_6.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You can always call up verification explicitly by right-clicking any
+ element in the tree and selecting Verify from the context menu. This
+ works from both the Tree and Diagram viewers for the JSF
+ configuration file editor. You can also invoke verification from the
+ Web Projects view. Below we are checking all of the elements in the
+ configuration file.</para>
+ <figure>
+ <title>Verify Command</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/verif_valid/verif_valid_7.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+</chapter>
\ No newline at end of file
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_tools.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_tools.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_tools.xml 2008-03-25 13:56:19 UTC (rev 7106)
@@ -0,0 +1,1673 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="jsf_tools">
+ <?dbhtml filename="jsf_tools.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>JSF Tools</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>JavaServer Faces Support</title>
+
+ <para>JBoss Developer Studio is especially designed for supporting JSF and
+ JSF-related technologies. JBDS provides extensible and exemplary tools for
+ building JSF-based applications as well as adding JSF capabilities to
+ existing web projects, importing JSF projects (created outside JBDS) and
+ choosing any JSF implementation while developing JSF application.</para>
+
+ <section id="SupportForJSFEnvironmentsJSF_RIMyFacesFaceletsShaleOrAnyCustom442">
+ <title>Support for JSF Environments: JSF-RI, MyFaces, Facelets or any Custom</title>
+ <para>With Developer Studio, we don't lock you into any one
+ <property>JavaServer Faces</property> implementation. Select
+ the one you want to use for your project.</para>
+ <para>When you:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Create a new <property>JSF project</property></para>
+ </listitem>
+ <listitem>
+ <para>Add <property>JSF capability</property> to any
+ existing Eclipse project</para>
+ </listitem>
+ <listitem>
+ <para>Add <property>JSF capability</property> to any
+ existing project (created outside JBDS)</para>
+ </listitem>
+ </itemizedlist>
+ <para>You can always select which JSF implementation to use.</para>
+
+ <para>You can also create your own custom JSF environments.</para>
+ <figure>
+ <title>Choosing JSF Environment</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_11.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>JBoss Developer Studio will add all the required libraries for the
+ selected version to your project.</para>
+ </section>
+
+ <!--
+<section id="AddingSupportForTheOracleADFComponentsLibraryOrAnyOtherSupport64">
+<?dbhtml filename="AddingSupportForTheOracleADFComponentsLibraryOrAnyOtherSupport.html"?>
+<title>Adding Support for the Oracle ADF Components Library or Any Other Support</title>
+
+<para>JBoss Developer Studio is set up to work with the <property>ADF Faces Component Library</property>, but still requires a few extra
+ steps to complete the support. First, you will need to download the 2 jar files for the library from the
+ Oracle site down to your system. Then, you just need to follow these steps to add ADF Faces support to your projects:</para>
+
+<itemizedlist>
+ <listitem><para>Select <emphasis><property>Window > Preferences > Red Hat > Library Sets</property></emphasis> from the menu bar.</para></listitem>
+ <listitem><para>Select <emphasis><property>OracleADF</property></emphasis> in the upper pane.</para></listitem>
+ <listitem>Then, click <emphasis><property>Add</property></emphasis> in the lower pane and browse to the location where you have both ADF jar files:
+<itemizedlist>
+ <listitem><para>adf-faces-api-eaXX.jar</para></listitem>
+ <listitem><para>adf-faces-impl-eaXX.jar</para></listitem>
+ </itemizedlist></listitem>
+ <listitem>In Preferences, select <emphasis><property>Custom Capability</property></emphasis>. Notice that Custom Capability ADF has the OracleADF
+ library set to which we just added the required Jar libraries. We don't need to do anything here.</listitem>
+ <listitem><para>Click <emphasis><property>OK</property></emphasis> and then click <emphasis><property>OK</property></emphasis> again.</para></listitem>
+<listitem>After this is done, you can always add in the library files to a project by just right-clicking
+ your project and selecting <emphasis><property>JBoss Developer Studio > Add Custom Capability...</property></emphasis> from the context menu and select a needed capability.</listitem>
+</itemizedlist>
+
+<para>You can add any custom capability (support) to your project using Library Sets in the same fashion. </para>
+</section>
+-->
+
+ <section id="FaceletsSupport865">
+
+ <title>Facelets Support</title>
+ <para>This section will perform you all concepts that JBDS involves to use
+ the Facelets.</para>
+
+ <para>The Facelets extends JavaServer Faces by providing a lightweight
+ framework that radically simplifies the design of presentation pages
+ for JSF. JBoss Developer Studio provides support for Facelets in a
+ variety of ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>The New JSF Project wizard contains templates for
+ creating Facelets projects based on version 1.2 of
+ the JSF Reference Implementation. Select the <emphasis>
+ <property>JSF 1.2 with Facelets</property>
+ </emphasis> in JSF Environment section.</para>
+ </listitem>
+ </itemizedlist>
+
+
+ <figure>
+ <title>Choosing Facelets Environment</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_2.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once you select the environment, you can specify the one of three
+ available templates:</para>
+
+ <figure>
+ <title>Choosing Facelets Template</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_3.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The following table lists possible Facelets templates for any JSF
+ project and gives a proper description for each one.</para>
+ <table>
+ <title>Facelets Templates</title>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="2*"/>
+ <colspec colnum="2" colwidth="3*"/>
+
+
+ <thead>
+ <row>
+ <entry align="center">
+ <para>Template</para>
+ </entry>
+
+ <entry align="center">
+ <para>Description</para>
+ </entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>FaceletsBlankWithoutLibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>Some servers already provide
+ jsf libs and you take risk
+ of getting conflicting
+ libraries while deploying
+ your project. To avoid such
+ conflicts, use a template
+ without libs if you have a
+ server with its own jsf
+ libraries</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>FaceletsKickStartWithRILibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>a sample application with
+ Facelets that is ready to
+ run</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>FaceletsKickStartWithoutLibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>a sample application without
+ libraries</para>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <itemizedlist>
+ <listitem>
+ <para>The <link linkend="palette">JBoss Tools Palette</link>
+ comes with the Facelets components ready to use. A
+ useful tip appears when you hover the mouse cursor
+ over the tag, the tip includes a detailed
+ description of the tag component, the syntax and
+ available attributes.</para>
+ </listitem>
+ </itemizedlist>
+
+
+
+ <!-- JBoss Developer Studio does not provide templates for MyFaces right out of the box, but you can easily do it
+ yourself with the "Save As Template" feature (available on the File submenu). Just create a small project
+ with MyFaces and Facelets and then save it as a template for future use.
+
+ How can I add Facelets support to an existing project?</para>
+ <para>A: Right-click on the folder of existing project and select <emphasis>JBoss Tools > Add Custom Capabilities.. > Facelets</emphasis>. </para>
+ -->
+ <figure>
+ <title>Facelets Components</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_4.png"
+ scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Code assist (Ctrl + Space) for <property>Facelets
+ tags</property> is available when editing <emphasis>
+ <property>.xhtml</property>
+ </emphasis> files.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>XHTML File Code Assist</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_5.png"
+ scale="70"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>What's more, code assist is also available for <emphasis
+ role="italic">
+ <property>"jsfc"</property>
+ </emphasis> attribute in any HTML tag.</para>
+
+ <figure>
+ <title>Code Assist for Jsfc Attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_6.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>After selecting <emphasis role="italic">
+ <property>"jsfc"</property>
+ </emphasis> you get the code assist for JSF components available on
+ a page.</para>
+
+ <figure>
+ <title>Code Assist for JSF Components</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_7.png"
+ scale="80"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>When a component is chosen you will see all available attributes for
+ it.</para>
+
+ <figure>
+ <title>Available Attributes for the Component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_8.png"
+ scale="80"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>JBDS provides Eclipse's <emphasis>
+ <property>OpenOn</property>
+ </emphasis> feature for editing Facelets files.
+ Using this feature, you can easily navigate between
+ the <property>Facelets templates</property> and
+ other parts of your projects. Just by holding down
+ the Control key while hovering the mouse cursor over
+ a reference to a template, the reference becomes a
+ hyperlink to open that template.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Template Hyperlink</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_9.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <!-- <para>Additionally, when hovering the mouse cursor over <emphasis role="italic"><property>"Facelets tag"</property></emphasis> attributes, JBoss Developer Studio provides a pop-up help tip:</para>
+ <figure>
+<title>Pop-up Help Tip for Facelets Tag Attributes</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/defaultImage.png"/>
+ </imageobject>
+</mediaobject>
+ </figure>
+
+ -->
+ <!-- <para>See <link linkend="faq_facelets">FAQ</link> concerning Facelets
+ support.</para>
+ -->
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>Necessary information and support for Facelets find out <ulink
+ url="https://facelets.dev.java.net/"
+ >here</ulink>.</para>
+ </section>
+ </section>
+ <section id="WorkingWithProjects7844">
+
+ <title>Working with Projects</title>
+ <para>To take an advantage of JSF support in <property>JBoss Developer
+ Studio</property> firstly you should perform one of the next
+ steps:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Create new JSF projects</para>
+ </listitem>
+ <listitem>
+ <para>Import (open) existing JSF projects</para>
+ </listitem>
+ <listitem>
+ <para>Add JSF capability to any existing Eclipse
+ project</para>
+ </listitem>
+ <listitem>
+ <para>Import and add JSF capability to any existing project
+ created outside Eclipse.</para>
+ </listitem>
+ </itemizedlist>
+ <para>In this section we're going to stop on each of them in
+ detail.</para>
+ <section id="CreatingANewJSFProject96">
+
+ <title>Creating a New JSF Project</title>
+
+ <para>If you want your project has already contained all JSF
+ libraries, tag libraries and JSF configuration file, just
+ organize a new brand JSF project. <property>JBoss Developer
+ Studio</property> allows to do this easily with the
+ help of the special wizard. To get it, select<emphasis>
+ <property> File > New > Project
+ > JBoos Tools Web > JSF
+ > JSF Project</property>
+ </emphasis> and click <emphasis>
+ <property>Next</property>.</emphasis></para>
+
+ <figure>
+ <title>Choosing a JSF Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_10.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On the next form you'll be prompted to enter
+ <property>Project Name</property> and select a
+ location for the project or just leave a default path.</para>
+ <para>Here, JSF Version also allows you to select which JSF
+ implementation to use.</para>
+ <figure>
+ <title>Creating a New JSF Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_11.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para><property>JBoss Developer Studio</property> comes with a
+ number of predefined project templates that are flexible and
+ easily customizable. Thus you can pick a different template
+ on which the project should be based to. Almost all
+ templates come in two variations: with jsf libraries and
+ without ones.</para>
+ <figure>
+ <title>Choosing JSF Templates</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_12.png "
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The table below provides description for each possible JSF
+ template.</para>
+ <table>
+ <title>JSF Project Templates</title>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*"/>
+ <colspec colnum="2" colwidth="3*"/>
+
+
+ <thead>
+ <row>
+ <entry align="center">
+ <para>Template</para>
+ </entry>
+
+ <entry align="center">
+ <para>Description</para>
+ </entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>JSFBlankWithLibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>This template will
+ create a standard
+ Web project
+ structure with all
+ JSF
+ capabilities</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>JSFKickStartWithLibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>This template will
+ create a standard
+ Web project
+ structure but will
+ also include a
+ sample application
+ that is ready to
+ run</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>
+ <emphasis>
+ <property>JSFKickStartWithoutLibs</property>
+ </emphasis>
+ </para>
+ </entry>
+
+ <entry>
+ <para>Some servers already
+ provide jsf libs and
+ you take risk of
+ getting conflicting
+ libraries while
+ deploying your
+ project. To avoid
+ such conflicts, use
+ a template without
+ libs if you have a
+ server with its own
+ jsf libraries</para>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <!-- <para>You can of course create your own custom templates. More information
+ on templates creation could be found in <link
+ linkend="CreatingCustomJSPTemplates">Chapter 5</link>.</para>
+ -->
+
+ <para>On the next screen select what <emphasis>
+ <property>Servlet version</property>
+ </emphasis> to use and whether to register this application
+ with JBoss AS (or other server) for running and testing of
+ your application.</para>
+
+ <para>The <emphasis>
+ <property>Context Path</property>
+ </emphasis> is the name under which the application will be
+ deployed.</para>
+
+ <para>The <emphasis>
+ <property>Runtime</property>
+ </emphasis> value tells Eclipse where to find Web libraries
+ in order to build (compile) the project. It is not possible
+ to finish project creation without selecting Runtime. If you
+ don't have any values, select <emphasis>
+ <property>New...</property>
+ </emphasis> to add new Runtime.</para>
+
+ <para>The <emphasis>
+ <property>Target Server</property>
+ </emphasis> allows you specifying whether to deploy the
+ application. The Target Server corresponds to the Runtime
+ value selected above. If you don't want to deploy
+ the application, uncheck this value.</para>
+ <figure>
+ <title>Registering the Project on Server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_14.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>When you are all done, you should have the project that has
+ been appeared in the Package Explorer view:</para>
+ <figure>
+ <title>A New Project in the Package Explorer</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_15.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>At this point you can open <emphasis>
+ <property>faces-config.xml</property>
+ </emphasis> and start working on your application.
+ <property>JBDS</property> provides a lot of features
+ to develop JSF applications. We will describe the features
+ further.</para>
+ </section>
+
+ <section id="ImportingExsJSFProjWithAnyStr74447">
+
+ <title>Importing Existing JSF Projects 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="AddingJSFCapabilityToAnyExistingEclipseProject">
+
+ <title>Adding JSF Capability to Any Existing Eclipse Project</title>
+
+ <para>With <property>JBoss Developer Studio</property> it's
+ also possible to add <property>JSF capability</property>
+ (JSF libraries, tag libraries) to any existing Eclipse
+ project in your workspace. After that you'll be
+ able to make use of such <property>JBoss Developer
+ Studio</property> editors as JSF configuration editor, JBoss
+ Tools JSP editor and any others.</para>
+ <para>Right click the project and select <emphasis>
+ <property>JBoss Tools > Add JSF
+ Capabilities</property>. </emphasis> This will start
+ the process of adding all necessary libraries, files to make
+ this a Web JSF project.</para>
+ <figure>
+ <title>Adding JSF Capabilities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_16.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The wizard will first ask you to show the <emphasis>
+ <property>web.xml</property>
+ </emphasis> file location and the project name.</para>
+ <figure>
+ <title>Project Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_17.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the last form you can set the different folders for your
+ project as well as register this application with a servlet
+ container.</para>
+
+ <para>Make sure to select <emphasis>
+ <property>Add Libraries</property>
+ </emphasis> for <property>JBoss Developer Studio</property>
+ to add all required JSF related libraries to this project.</para>
+
+ <para>The <emphasis>
+ <property>Context Path</property>
+ </emphasis> is the name under which the application will be
+ deployed.</para>
+
+ <para>The <emphasis>
+ <property>Runtime</property>
+ </emphasis> value tells Eclipse where to find Web libraries
+ in order to build (compile) the project. It is not possible
+ to finish project import without selecting Runtime. If you
+ don't have any values, select <emphasis>
+ <property>New...</property>
+ </emphasis> to add new Runtime.</para>
+
+ <para>The <emphasis>
+ <property>Target Server</property>
+ </emphasis> allows you to specify whether to deploy the
+ application. The Target Server corresponds to the Runtime
+ value selected above. If you don't want to deploy
+ the application, uncheck this value.</para>
+ <figure>
+ <title>Project Folders</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_18.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Once your project is imported you can see that JSF related
+ libraries have been added to your project: <emphasis>
+ <property>jsf-api.jar</property>
+ </emphasis> and <emphasis>
+ <property>jsf-impl.jar</property>
+ </emphasis>.</para>
+ <note>
+ <title>Note:</title>
+ <para>Some application servers provide their own jsf
+ implementation libraries. So, to avoid conflicts you
+ should not add jsf libraries while adding jsf
+ capabilities.</para>
+ </note>
+ <para>You are now ready to work with JSF by creating a new JSF
+ configuration file:</para>
+
+
+ <figure>
+ <title>Creating a New JSF Configuration File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_19.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once the file have been created, it should be open in a
+ special <link
+ linkend="GraphicalEditorAndViewingForJSFConfigurationFiles76331"
+ >Faces Config Editor</link>.</para>
+ </section>
+ <section id="AddingYourOwnProjectTemplates853">
+
+ <title>Adding Your Own Project Templates</title>
+ <para>Template is a set of files that serve as a basis to facilitate
+ the creation of a new project. Project templates provide
+ content and structure for a project.</para>
+ <para><property>JBoss Developer Studio</property> has a powerful
+ templating capability for creating new and importing
+ existing Struts and JSF projects. This templating facility
+ has a variety of aspects to consider. But, let's
+ start with the most straightforward case and consider the
+ process of creating a template from your existing JSF
+ project.</para>
+
+ <para>Let's say you have a project that you want to use as
+ the basis for a new <property>template</property>. Follow
+ these steps to make a template out of it:</para>
+ <itemizedlist>
+ <listitem>
+ <para>In the Web Projects view, right-click the
+ project and select <emphasis>
+ <property>JBoss Tools JSF > Save As
+ Template</property>
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Saving Your Project as Template</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_20.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>In the first dialog box, you can choose a name
+ for the template (defaults to the project
+ name) and confirm what run-time
+ implementation of the project's
+ technology will be used</para>
+ </listitem>
+
+ </itemizedlist>
+ <figure>
+ <title>Define Template Properties</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_20_1.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <itemizedlist>
+ <listitem>
+ <para>Select <emphasis>
+ <property>Next</property>
+ </emphasis> and you will be sent to a dialog
+ box with your project structure displayed
+ with check boxes. Here you can check only
+ those parts and files in your project
+ directory that should be part of the
+ template</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Define Template Properties</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_20_2.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>At this point, unless you want to designate
+ some extra files as having Velocity template
+ coding inside them, you should click <emphasis>
+ <property>Finish</property>
+ </emphasis>.</para>
+ </listitem>
+ </itemizedlist>
+ <para>That's it. Now, you can use this template with any
+ new or imported project that uses the same run-time
+ implementation as the project you turned into a
+ template.</para>
+ </section>
+
+ <para>At this point, you have a fully configured project and now you can
+ bring some new logic to it starting from JSF configuration
+ file.</para>
+ </section>
+ <section id="GraphicalEditorAndViewingForJSFConfigurationFiles76331">
+
+ <title>Graphical Editor and Viewing for JSF Configuration Files</title>
+
+ <para>First, we should mention that JSF configuration file (<emphasis>
+ <property>faces-config.xml</property>
+ </emphasis>) is intended for registering JSF application resources
+ such as Converters, Validators, Managed Beans and page-to-page
+ navigation rules.</para>
+ <para>Now, let's look at how you can easily configure this file by
+ means of a special graphical editor. The editor has three main
+ viewers (modes):</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Diagram</para>
+ </listitem>
+ <listitem>
+ <para>Tree</para>
+ </listitem>
+ <listitem>
+ <para>Source</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The modes can be selected via the tabs at the bottom of the editor.</para>
+
+ <para>The JSF configuration editor also comes with a very useful <link
+ linkend="OpenOnSelection4Hyperlinknavigation">OpenOn</link>
+ selection feature.</para>
+
+ <section id="Diagram9553">
+
+ <title>Diagram</title>
+ <para>The Diagram view displays the navigation rules in the JSF
+ configuration file:</para>
+ <figure>
+ <title>Diagram View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_21.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="CreatingNewViewPage85">
+
+ <title>Creating New View (Page)</title>
+
+ <para>To create a new page (view), you can click the page icon on
+ this toolbar and then click anywhere on the diagram. A New
+ Page Wizard will appear.</para>
+
+ <para>To create a transition (rule) connecting pages:</para>
+
+
+ <itemizedlist>
+ <listitem>
+ <para>Select the transition icon from the toolbar
+ (2nd from the bottom).</para>
+ </listitem>
+ <listitem>
+ <para>Click the source page.</para>
+ </listitem>
+ <listitem>
+ <para>Click the target page.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>A transition will appear between the two pages:</para>
+ <figure>
+ <title>Transition Between JSP Pages</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_22.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>It is also possible to create a new page with context menu by
+ right-clicking anywhere on the diagram and selecting <emphasis>
+ <property>New View</property>. </emphasis></para>
+ <figure>
+ <title>Creating a New View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_23.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To edit an existing transition, first select the transition
+ line. Then, place the mouse cursor over the last black dot
+ (on the target page). The mouse cursor will change to a big
+ +. At this point, drag the line to a new target page:</para>
+ <figure>
+ <title>Editing Transition Between Views</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_24.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="TreeView11123">
+
+ <title>Tree View</title>
+
+ <para>The Tree mode for the editor displays all JSF application
+ artifacts referenced in the configuration file in a tree
+ format. By selecting any node you can see and edit its
+ properties which will appear in the right-hand area. For
+ example, a Managed Bean:</para>
+ <figure>
+ <title>Tree View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_25.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To edit some artifact, right-click any node and select one of
+ the available actions in the context menu. You can also edit
+ in the properties window to the right:</para>
+ <figure>
+ <title>Editing in Tree View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_26.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The same way you can create a new artifact:</para>
+ <figure>
+ <title>Creating a New Artifact in Tree View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_59.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="SourceView4643">
+
+ <title>Source View</title>
+
+ <para>The Source mode for the editor displays a text view of the JSF
+ configuration file. All three viewers are always
+ synchronized, so any changes made in one of the viewers will
+ immediately appear in the others:</para>
+ <figure>
+ <title>Source View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_27.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="ContentAssist976">
+
+ <title>Code Assist</title>
+ <para>Code Assist provides pop-up tip to help you complete your code
+ statements. It allows you to write your code faster and with
+ more accuracy.</para>
+ <para>Code assist is always available in the Source mode:</para>
+ <figure>
+ <title>Code Assist in Source View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_28.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="ErrorReporting3324">
+
+ <title>Error Reporting</title>
+ <para>When you are developing your project, JBoss Developer Studio
+ constantly provides error checking. This greatly reduces
+ your development time as it allows you to catch many of the
+ errors during development.</para>
+ <para>Errors will be reported by JBoss Developer Studio's
+ <link linkend="verif_valid"> verification</link>
+ facility:</para>
+ <figure>
+ <title>Error Reporting in Source View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_29.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Other errors are also reported.</para>
+ <figure>
+ <title>Other Errors Reporting</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_30.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also work in the Source editor with the help of the <emphasis>
+ <property>Outline view</property>.</emphasis> The
+ Outline views show a tree structure of the JSF configuration
+ file. Simply select any element in the Outline view, and it
+ will jump to the same place in the Source editor, so you can
+ navigate through the source code with Outline view.</para>
+ <figure>
+ <title>Outline View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_31.png"
+ scale="60"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>If your diagram is large, within Outline view you can switch
+ to a <emphasis>
+ <property>Diagram Navigator</property>
+ </emphasis> mode by selecting the middle icon at the top of
+ the view window. It allows you to easily move around the
+ diagram. Just move the blue area in any direction, and the
+ diagram on the left will also move:</para>
+ <figure>
+ <title>Outline View for Diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_32.png"
+ scale="60"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can also edit the properties of the selected element in
+ the <property>Tree</property> mode with the help of the
+ Properties view as shown below:</para>
+ <figure>
+ <title>Properties View </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_33.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+ <section id="ManagedBeans96453">
+
+ <title>Managed Beans</title>
+
+ <para>JBoss Developer Studio gives you lots of power to work with
+ <property>managed beans</property>.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Add and generate code for new managed beans</para>
+ <itemizedlist>
+ <listitem>
+ <para>Generate code for attributes and
+ getter/setter methods</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>Add existing managed beans to JSF configuration
+ file</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Thus, in this section we will guides you through all this possibilities.</para>
+
+ <section id="CodeGenerationForManagedBeans421">
+
+ <title>Code Generation for Managed Beans</title>
+
+ <para>To start, create a new managed bean in JSF configuration file
+ editor, in the Tree view.</para>
+ <figure>
+ <title>Creation of New Managed Bean</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_34.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <note>
+ <title>Note:</title>
+ <para>When you define a new managed bean, make sure that <emphasis>
+ <property>Generate Source Code</property>
+ </emphasis> is checked as shown in the figure
+ below.</para>
+ </note>
+ <figure>
+ <title>New Managed Bean</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_35.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After the <emphasis role="italic">
+ <property>"Java"</property>
+ </emphasis> class has been generated you can open it for
+ additional editing. There are two ways to open the <emphasis
+ role="italic">
+ <property>"Java"</property>
+ </emphasis> class:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>click on <emphasis>
+ <property>Managed-Bean-Class</property>
+ </emphasis> link in the editor</para>
+ </listitem>
+ </itemizedlist>
+ <para>or</para>
+ <itemizedlist>
+ <listitem>
+ <para>right click the <emphasis>
+ <property>managed bean</property>
+ </emphasis> and select <emphasis>
+ <property>Open Source</property>
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Opening of Created Managed Bean</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_36.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The generated Java source:</para>
+
+ <figure>
+ <title>Java Source Code</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_37.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>You can also generate source code for properties, also
+ includes <emphasis role="italic">
+ <property>"getter"</property>
+ </emphasis> and <emphasis role="italic">
+ <property>"setter"</property>
+ </emphasis> methods. Right click on the bean and select <emphasis>
+ <property>New > Property</property>
+ </emphasis>. You will see <property>Add Property</property>
+ dialog.</para>
+ <figure>
+ <title>Generation of Source Code for Properties</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_38.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>When the form is open make sure that all the check boxes are
+ selected:</para>
+ <itemizedlist>
+ <listitem>Add Java property</listitem>
+ <listitem>Generate Getter</listitem>
+ <listitem>Generate Setter</listitem>
+ </itemizedlist>
+ <para/>
+ <figure>
+ <title>"Add Property" Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_39.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Once the generation is complete, you can open the file and see
+ the added property with <emphasis role="italic">
+ <property>"getter"</property>
+ </emphasis> and <emphasis role="italic">
+ <property>"setter"</property>
+ </emphasis> methods:</para>
+ <figure>
+ <title>Generated Java Source Code for Property</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_40.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Thus, we've discussed everything which comes to
+ creating a new Managed Bean. Further we will show you how to
+ add an existing Bean into a JSF configuration file.</para>
+ </section>
+ <section id="AddExistingJavaBeansToAJSFConfigurationFile74332">
+
+ <title>Add Existing Java Beans to a JSF Configuration File</title>
+ <para>If you already have a Java bean you can easily add it to a
+ <property>JSF configuration file</property>.</para>
+ <para>You should start the same way you create a new managed bean.
+ Use the <emphasis>
+ <property>Browse...</property>
+ </emphasis> button to add your existing Java class.</para>
+ <figure>
+ <title>New Managed Bean Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_42.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Once the class is set, it's <emphasis>
+ <property>Name</property>
+ </emphasis> will be set as well. But you can easily
+ substitute it for the other one. Notice that <emphasis>
+ <property>Generate Source Code</property>
+ </emphasis> option is not available as the <emphasis
+ role="italic">
+ <property>"Java"</property>
+ </emphasis> class already exists. </para>
+ <para>After adding your class <emphasis>
+ <property>Next</property>
+ </emphasis> button will be activated. Pressing it
+ you'll get <emphasis>
+ <property>Managed Properties</property>
+ </emphasis> dialog where all corresponding properties are
+ displayed. Check the necessary ones to add them into your
+ <property>JSF Configuration File</property>.</para>
+
+ <figure>
+ <title>Selection of Bean's Properties.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_43.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>If you don't want to add any, just click <emphasis>
+ <property>Finish</property>. </emphasis></para>
+ </section>
+ <para>Above-listed steps have demonstrated specifying an existing Bean in
+ the JSF configuration file, i.e. <emphasis>
+ <property>faces-config.xml</property>. </emphasis> In the
+ next section you'll know how to organize and register a
+ custom Converter to specify your own converting rules.</para>
+ </section>
+
+ <section id="CreateAndRegisterACustomConverter94230">
+
+ <title>Create and Register a Custom Converter</title>
+
+ <para>To create and register a custom converter it's necessary to
+ go through the following steps:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>In the Project Explorer view open <emphasis>
+ <property>faces-config.xml</property>
+ </emphasis> and select <emphasis>
+ <property>Tree</property>
+ </emphasis> tab.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Converters</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_44.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Select <emphasis>
+ <property>Converters</property>
+ </emphasis> and click on<emphasis>
+ <property> Add</property>
+ </emphasis> button.</para>
+ </listitem>
+ <listitem>
+ <para>On the form type the name of your converter in the <emphasis>
+ <property>Converter-id</property>
+ </emphasis> field and name of the class for
+ converters. After clicking <emphasis>
+ <property>Finish</property>
+ </emphasis> button your custom converter is
+ registered under the entered name.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Add Converter Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_45.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Now you can create <emphasis role="italic">
+ <property>"converter"</property>
+ </emphasis> class. In the Converter section you
+ should see your <emphasis>
+ <property>Converter-id</property>
+ </emphasis> and
+ <emphasis><property>Converter-class</property>.</emphasis>
+ Click on <emphasis>
+ <property>Converter-class</property>
+ </emphasis> to generate the source code.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Generation of Source Code for Converter Class</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_46.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>A usual wizard for creating a Java class will appear.
+ All needed fields here will be adjusted
+ automatically. Just leave everything without changes
+ and click <emphasis>
+ <property>Finish</property>.
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>New Java Class Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_47.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>To open a converter class click again on <emphasis>
+ <property>Converter-class</property>
+ </emphasis> link in the Converter section. Now you
+ are able to add a business logic of converter in the
+ Java editor.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Converter Class</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_48.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section id="CreateAndRegisterACustomValidator5632">
+
+ <title>Create and Register a Custom Validator</title>
+
+ <para>With the help of JBDS it's also quite easy to develop your
+ own custom Validators. You should perform the actions similar to
+ previous. Go through the following steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>In the Project Explorer view open<emphasis>
+ <property> faces-config.xml</property>
+ </emphasis> and select <emphasis>
+ <property>Tree </property>
+ </emphasis>tab.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Validator in Faces Config Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_49.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Select <emphasis>
+ <property>Validators</property>
+ </emphasis> and click on <emphasis>
+ <property>Add </property>
+ </emphasis>button.</para>
+ </listitem>
+ <listitem>
+ <para>Type the name of your validator in the <emphasis>
+ <property>Validator-id</property>
+ </emphasis> field and name of the class for
+ validators. After clicking <emphasis>
+ <property>Finish</property>
+ </emphasis> button your custom validator is
+ registered under the entered name.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Adding Validator</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_50.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Now you can create the "validator" class. </para>
+ <itemizedlist>
+ <listitem>
+ <para>In the Validator section you can see your <emphasis>
+ <property>Validator-id</property>
+ </emphasis> and <emphasis>
+ <property>Validator-class</property>
+ </emphasis>. To generate the source code click on <emphasis>
+ <property>Validator-class</property>.
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Creating Validator Class</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_51.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Java class will be created automatically. Leave
+ everything without changes and click <emphasis>
+ <property>Finish</property>.
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>New Java Class Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_52.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>To open validator class click again on <emphasis>
+ <property>Validator-Class</property>
+ </emphasis> link in the Validator section. Now you
+ are able to write a business logic of validator in
+ the Java editor.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Converter Class Editing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_53.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="CreateAndRegisterReferencedBeans64322">
+
+ <title>Create and Register Referenced Beans</title>
+
+ <para>Creation of Referenced Beans is similar to creation of Custom
+ Validator.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>In the Project Explorer view open<emphasis>
+ <property> faces-config.xml</property>
+ </emphasis> and select <emphasis>
+ <property>Tree </property>
+ </emphasis>tab.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Referenced Beans in Faces Config Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_54.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Select <emphasis>
+ <property>Referenced Beans</property>
+ </emphasis> and click on <emphasis>
+ <property>Add</property>
+ </emphasis> button.</para>
+ </listitem>
+ <listitem>
+ <para>Type in the name of your Referenced Bean and type in
+ or select <emphasis>
+ <property>Referenced-Bean-Class</property>
+ </emphasis> by using <emphasis>
+ <property>Browse</property>
+ </emphasis> button.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Add Referenced Bean</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_55.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>In the Referenced Bean section you should see your <emphasis>
+ <property>Referenced-Bean-Name</property>
+ </emphasis> and
+ <emphasis><property>Referenced-Bean-Class</property>.</emphasis>
+ Click on the link to open the Java creation
+ wizard.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Create Referenced Bean Class</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_56.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Java class will be created automatically. Leave
+ everything without changes and click <emphasis>
+ <property>Finish</property>.
+ </emphasis></para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>New Java Class Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_57.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>To open Referenced Bean class click again on <emphasis>
+ <property>Referenced-Bean-Class</property>
+ </emphasis> in the Referenced Bean section. Now you
+ are able to write business logic of Referenced Bean
+ in the Java editor.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Referenced Bean Class Editing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_58.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>If you don't familiar with <ulink
+ url="http://java.sun.com/javaee/javaserverfaces/">JSF
+ technology</ulink>, we suggest that you walk through the
+ information on the topic.</para>
+ </section>
+ </chapter>
\ No newline at end of file
Added: trunk/jsf/docs/jsf_tools_ref_guide/pom.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/pom.xml (rev 0)
+++ trunk/jsf/docs/jsf_tools_ref_guide/pom.xml 2008-03-25 13:56:19 UTC (rev 7106)
@@ -0,0 +1,104 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jsf-tools-reference-guide-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>JSF_Tools_Reference_Guide_(${translation})</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.0.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.docs</groupId>
+ <artifactId>highlight</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <!--<cssResource>
+ <directory>src/main/css</directory>
+ </cssResource>-->
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/nochunk-html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/main-eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <translation>en-US</translation>
+ </properties>
+
+
+</project>
18 years
JBoss Tools SVN: r7105 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-03-25 09:53:44 -0400 (Tue, 25 Mar 2008)
New Revision: 7105
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java 2008-03-25 13:47:23 UTC (rev 7104)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/Preference.java 2008-03-25 13:53:44 UTC (rev 7105)
@@ -57,6 +57,12 @@
public void setValue(String value) {
XModelObject obj = PreferenceModelUtilities.getPreferenceModel().getByPath(option);
+ if(obj == null) {
+ if(ModelPlugin.isDebugEnabled()) {
+ ModelPlugin.getPluginLog().logInfo(option + " does not exist");
+ }
+ return;
+ }
obj.getModel().changeObjectAttribute(obj, attributeName, value);
obj.getModel().saveOptions();
}
18 years
JBoss Tools SVN: r7104 - trunk/jsf/docs/userguide/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-03-25 09:47:23 -0400 (Tue, 25 Mar 2008)
New Revision: 7104
Modified:
trunk/jsf/docs/userguide/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-261 - two chapters 'jsf support' & 'struts support' are removed and two separate guides are created
Modified: trunk/jsf/docs/userguide/en/master.xml
===================================================================
--- trunk/jsf/docs/userguide/en/master.xml 2008-03-25 12:50:05 UTC (rev 7103)
+++ trunk/jsf/docs/userguide/en/master.xml 2008-03-25 13:47:23 UTC (rev 7104)
@@ -4,7 +4,6 @@
[
<!ENTITY Visual_Web_Tools SYSTEM "modules/Visual_Web_Tools.xml">
-<!ENTITY JSFStrutsTools SYSTEM "modules/JSFStruts_tools.xml">
<!ENTITY springTools SYSTEM "modules/spring_tools.xml">
<!ENTITY editors SYSTEM "modules/editors.xml">
<!ENTITY palette SYSTEM "modules/palette.xml">
@@ -27,7 +26,6 @@
<toc/>
&Visual_Web_Tools;
- &JSFStrutsTools;
&springTools;
&editors;
&palette;
18 years
JBoss Tools SVN: r7103 - in trunk/jsf/plugins: org.jboss.tools.jsf.vpe.seam/templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-03-25 08:50:05 -0400 (Tue, 25 Mar 2008)
New Revision: 7103
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
Log:
Code adjustment
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-25 11:26:12 UTC (rev 7102)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-25 12:50:05 UTC (rev 7103)
@@ -275,7 +275,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="submit" value="{iif(@value='',' ',@value)}"
+ <input type="submit" value="{iif(@value='',' ',jsfvalue(@value))}"
class="{@styleClass}" style="{@style}" title="{tagstring()}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-25 11:26:12 UTC (rev 7102)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-25 12:50:05 UTC (rev 7103)
@@ -116,7 +116,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="submit" value="{iif(@value='',' ',@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
+ <input type="submit" value="{iif(@value='',' ',jsfvalue(@value))}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
18 years
JBoss Tools SVN: r7102 - in trunk/jsf/plugins: org.jboss.tools.jsf.vpe.seam/templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-03-25 07:26:12 -0400 (Tue, 25 Mar 2008)
New Revision: 7102
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
Log:
Code adjustment
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-25 09:12:02 UTC (rev 7101)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-25 11:26:12 UTC (rev 7102)
@@ -275,7 +275,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="button" value="{jsfvalue(@value)}"
+ <input type="submit" value="{iif(@value='',' ',@value)}"
class="{@styleClass}" style="{@style}" title="{tagstring()}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-25 09:12:02 UTC (rev 7101)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-25 11:26:12 UTC (rev 7102)
@@ -116,7 +116,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="button" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
+ <input type="submit" value="{iif(@value='',' ',@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
18 years
JBoss Tools SVN: r7101 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-03-25 05:12:02 -0400 (Tue, 25 Mar 2008)
New Revision: 7101
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1823, toggling on header facet fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-03-25 09:11:57 UTC (rev 7100)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-03-25 09:12:02 UTC (rev 7101)
@@ -1089,6 +1089,17 @@
Element sourceElement = (Element) (sourceNode instanceof Element ? sourceNode
: sourceNode.getParentNode());
+ // Fixes JBIDE-1823 author dmaliarevich
+ // Template is looked according to <code>selectedElem</code>
+ // so <code>toggleLookupAttr</code> should be retrieved
+ // from this element
+ toggleLookupAttr = selectedElem
+ .getAttributeNode(VPE_USER_TOGGLE_LOOKUP_PARENT);
+ if (toggleLookupAttr != null) {
+ toggleLookup = "true".equals(toggleLookupAttr.getNodeValue());
+ }
+ // end of fix
+
if (elementMapping != null) {
VpeTemplate template = elementMapping.getTemplate();
18 years
JBoss Tools SVN: r7100 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-03-25 05:11:57 -0400 (Tue, 25 Mar 2008)
New Revision: 7100
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1823, toggling on header facet fixed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2008-03-25 00:51:35 UTC (rev 7099)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2008-03-25 09:11:57 UTC (rev 7100)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -25,13 +26,15 @@
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesSimpleTogglePanelTemplate extends VpeAbstractTemplate implements VpeToggableTemplate {
private static Map toggleMap = new HashMap();
- private nsIDOMElement storedSwitchDiv = null;
+ private nsIDOMElement storedHeaderDiv = null;
private static final String COLLAPSED_STYLE ="; display: none;";
private static final String HEADER_NAME_FACET = "header";
@@ -74,10 +77,9 @@
String markerName = "openMarker";
char defaultMarkerCode = 187;
boolean opened = getActiveState(sourceElement);
- switchDiv.setAttribute("vpe-user-toggle-id", (opened ? "false" : "true"));
- headerDiv.setAttribute("vpe-user-toggle-id", (opened ? "false" : "true"));
- storedSwitchDiv = switchDiv;
+ headerDiv.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, (opened ? "false" : "true"));
+ storedHeaderDiv = headerDiv;
if(opened) {
markerName = "closeMarker";
@@ -135,24 +137,54 @@
*/
public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData data) {
super.validate(pageContext, sourceNode, visualDocument, data);
- if (storedSwitchDiv == null) return;
- String value = storedSwitchDiv.getAttribute("vpe-user-toggle-id");
+ if (storedHeaderDiv == null) return;
+ String value = storedHeaderDiv.getAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID);
if ("true".equals(value) || "false".equals(value)) {
- applyAttributeValueOnChildren("vpe-user-toggle-id", value, ComponentUtil.getChildren(storedSwitchDiv));
- applyAttributeValueOnChildren("vpe-user-toggle-lookup-parent", "true", ComponentUtil.getChildren(storedSwitchDiv));
+ applyAttributeValueOnChildren(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, value, getChildren(storedHeaderDiv));
+ applyAttributeValueOnChildren(VpeVisualDomBuilder.VPE_USER_TOGGLE_LOOKUP_PARENT, "true", getChildren(storedHeaderDiv));
}
}
- private void applyAttributeValueOnChildren(String attrName, String attrValue, List<nsIDOMNode> children) {
- if (children == null || attrName == null || attrValue == null) return;
-
- for (nsIDOMNode child : children) {
- if (child instanceof nsIDOMElement) {
- nsIDOMElement childElement = (nsIDOMElement)child.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- childElement.setAttribute(attrName, attrValue);
- applyAttributeValueOnChildren(attrName, attrValue, ComponentUtil.getChildren(childElement));
+ /**
+ * Sets the attribute to element children
+ * @param attrName attribute name
+ * @param attrValue attribute value
+ * @param children children
+ */
+ private void applyAttributeValueOnChildren(String attrName, String attrValue, List<nsIDOMElement> children) {
+ if (children == null || attrName == null || attrValue == null) {
+ return;
+ }
+ for (nsIDOMElement child : children) {
+ child.setAttribute(attrName, attrValue);
+ applyAttributeValueOnChildren(attrName, attrValue, getChildren(child));
+ }
+ }
+
+ /**
+ * Gets element children
+ * @param element the element
+ * @return children
+ */
+ private List<nsIDOMElement> getChildren(nsIDOMElement element) {
+ List<nsIDOMElement> result = new ArrayList<nsIDOMElement>();
+ if (element.hasChildNodes()) {
+ nsIDOMNodeList children = element.getChildNodes();
+ if (null != children) {
+ long len = children.getLength();
+ for (int i = 0; i < len; i++) {
+ nsIDOMNode item = children.item(i);
+ try {
+ nsIDOMElement elem = (nsIDOMElement) item
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ result.add(elem);
+ } catch (XPCOMException ex) {
+ // just ignore this exception
+ }
+ }
}
}
+ return result;
}
private boolean getActiveState(Element sourceElement) {
18 years
JBoss Tools SVN: r7099 - trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-03-24 20:51:35 -0400 (Mon, 24 Mar 2008)
New Revision: 7099
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java
Log:
fix for compilation errors
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/ActionBreakPointsHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -24,6 +24,7 @@
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
@@ -87,7 +88,7 @@
return false;
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
Properties enablement = DefaultCreateHandler.extractProperties(data[0]);
applyBreakpointEnablement(object, enablement);
}
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -20,6 +20,7 @@
import org.eclipse.debug.core.model.IBreakpoint;
import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
@@ -62,7 +63,7 @@
return true;
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
XModelObject reference = object;
@@ -86,30 +87,33 @@
String actionPath = actionObject.getAttributeValue(ATT_PATH);
IBreakpoint breakpoint = null;
-
- if (isTilesDefinitionForward) {
- String forwardName = reference.getAttributeValue(ATT_NAME);
- breakpoint = StrutsDebugModel.getInstance().createActionTilesDefinitionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
- } else if (isAttrForward) {
- String forwardName = reference.getAttributeValue(ATT_FORWARD);
- breakpoint = StrutsDebugModel.getInstance().createActionAttrForwardBreakpoint(file, modelPath, actionPath, forwardName);
- } else if(isAttrInclude) {
- String includeName = reference.getAttributeValue(ATT_INCLUDE);
- breakpoint = StrutsDebugModel.getInstance().createActionIncludeBreakpoint(file, modelPath, actionPath, includeName);
- } else if(isForward) {
- String forwardName = reference.getAttributeValue(ATT_NAME);
- breakpoint = StrutsDebugModel.getInstance().createActionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
- } else if (isException)
- breakpoint = StrutsDebugModel.getInstance().createActionExceptionBreakpoint(
- file,
- modelPath,
- actionClassName,
- actionPath,
- reference.getAttributeValue(ATT_TYPE)
- );
-
- if (breakpoint != null)
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ try {
+ if (isTilesDefinitionForward) {
+ String forwardName = reference.getAttributeValue(ATT_NAME);
+ breakpoint = StrutsDebugModel.getInstance().createActionTilesDefinitionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
+ } else if (isAttrForward) {
+ String forwardName = reference.getAttributeValue(ATT_FORWARD);
+ breakpoint = StrutsDebugModel.getInstance().createActionAttrForwardBreakpoint(file, modelPath, actionPath, forwardName);
+ } else if(isAttrInclude) {
+ String includeName = reference.getAttributeValue(ATT_INCLUDE);
+ breakpoint = StrutsDebugModel.getInstance().createActionIncludeBreakpoint(file, modelPath, actionPath, includeName);
+ } else if(isForward) {
+ String forwardName = reference.getAttributeValue(ATT_NAME);
+ breakpoint = StrutsDebugModel.getInstance().createActionForwardBreakpoint(file, modelPath, actionClassName, actionPath, forwardName);
+ } else if (isException)
+ breakpoint = StrutsDebugModel.getInstance().createActionExceptionBreakpoint(
+ file,
+ modelPath,
+ actionClassName,
+ actionPath,
+ reference.getAttributeValue(ATT_TYPE)
+ );
+
+ if (breakpoint != null)
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ } catch (CoreException ex) {
+ throw new XModelException(ex);
+ }
}
boolean hasBreakpointMarker(XModelObject object) {
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/AddBreakPointToGlobalHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -13,10 +13,12 @@
import java.util.Properties;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.StrutsConstants;
import org.jboss.tools.struts.debug.internal.StrutsDebugModel;
@@ -25,7 +27,7 @@
public class AddBreakPointToGlobalHandler extends AddBreakPointHandler {
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
String type = object.getAttributeValue(StrutsConstants.ATT_TYPE);
boolean isGlobalForward = StrutsConstants.TYPE_FORWARD.equals(type);
@@ -46,37 +48,41 @@
reference.getAttributeValue(StrutsConstants.ATT_PATH);
IBreakpoint breakpoint = null;
- if (isTilesDefinition) {
- breakpoint = StrutsDebugModel.getInstance().createTilesDefinitionGlobalForwardBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_NAME)
- );
- } else if (isGlobalForward) {
- breakpoint = StrutsDebugModel.getInstance().createGlobalForwardBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_NAME)
- );
- } else if (isGlobalException) {
- breakpoint = StrutsDebugModel.getInstance().createGlobalExceptionBreakpoint(
- file,
- modelPath,
- reference.getAttributeValue(StrutsConstants.ATT_TYPE)
- );
- } else if (isAction) {
- XActionInvoker.invoke("StrutsProcessItem_BreakpointActions", "Properties.BreakpointProperties", object, p);
- return;
- } else if (isPage) {
- String pagePath = StrutsProcessStructureHelper.instance.getContextRelativePath(object);
- breakpoint = StrutsDebugModel.getInstance().createPageEnterBreakpoint(
- file, modelPath, pagePath
- );
+ try {
+ if (isTilesDefinition) {
+ breakpoint = StrutsDebugModel.getInstance().createTilesDefinitionGlobalForwardBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_NAME)
+ );
+ } else if (isGlobalForward) {
+ breakpoint = StrutsDebugModel.getInstance().createGlobalForwardBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_NAME)
+ );
+ } else if (isGlobalException) {
+ breakpoint = StrutsDebugModel.getInstance().createGlobalExceptionBreakpoint(
+ file,
+ modelPath,
+ reference.getAttributeValue(StrutsConstants.ATT_TYPE)
+ );
+ } else if (isAction) {
+ XActionInvoker.invoke("StrutsProcessItem_BreakpointActions", "Properties.BreakpointProperties", object, p);
+ return;
+ } else if (isPage) {
+ String pagePath = StrutsProcessStructureHelper.instance.getContextRelativePath(object);
+ breakpoint = StrutsDebugModel.getInstance().createPageEnterBreakpoint(
+ file, modelPath, pagePath
+ );
+ }
+
+ if (breakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
+ }
+ } catch(CoreException e) {
+ throw new XModelException(e);
}
-
- if (breakpoint != null) {
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
- }
}
}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/EnableBreakPointHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -15,9 +15,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.model.IBreakpoint;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.model.helpers.StrutsBreakpointManager;
import org.jboss.tools.struts.model.helpers.StrutsProcessStructureHelper;
@@ -28,21 +30,25 @@
return hasBreakpointMarker(object) && (getNewValue() ^ isBreakpointEnabled(object));
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
/// if (object instanceof ReferenceObjectImpl && ((ReferenceObjectImpl)object).getReference() != null)
/// object = ((ReferenceObjectImpl)object).getReference();
-
- IFile file = (IFile)object.getAdapter(IFile.class);
- IMarker markers[] = file.findMarkers(StrutsBreakpointManager.MODEL_BREAKPOINT, true, IResource.DEPTH_INFINITE);
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- String modelPath = object.getPath();
- for (int i = 0; i < markers.length; i++)
- if (modelPath.equals(markers[i].getAttribute(StrutsBreakpointManager.ATTR_MODEL_PATH)))
- {
- IBreakpoint breakpoint = breakpointManager.getBreakpoint(markers[i]);
- if (breakpoint != null) breakpoint.setEnabled(getNewValue());
+ try {
+ IFile file = (IFile)object.getAdapter(IFile.class);
+ IMarker markers[] = file.findMarkers(StrutsBreakpointManager.MODEL_BREAKPOINT, true, IResource.DEPTH_INFINITE);
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ String modelPath = object.getPath();
+ for (int i = 0; i < markers.length; i++) {
+ if (modelPath.equals(markers[i].getAttribute(StrutsBreakpointManager.ATTR_MODEL_PATH)))
+ {
+ IBreakpoint breakpoint = breakpointManager.getBreakpoint(markers[i]);
+ if (breakpoint != null) breakpoint.setEnabled(getNewValue());
+ }
}
+ } catch(CoreException e) {
+ throw new XModelException(e);
+ }
}
boolean getNewValue() {
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java 2008-03-24 23:22:16 UTC (rev 7098)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/model/handlers/RemoveBreakPointsHandler.java 2008-03-25 00:51:35 UTC (rev 7099)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.struts.debug.internal.ActionBreakpoint;
import org.jboss.tools.struts.debug.internal.StrutsDebugPlugin;
@@ -31,7 +32,7 @@
return hasBreakpointMarker(object);
}
- public void executeHandler(XModelObject object, Properties p) throws Exception {
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
if (!isEnabled(object)) return;
/// if(object instanceof ReferenceObjectImpl && ((ReferenceObjectImpl)object).getReference() != null) {
/// object = ((ReferenceObjectImpl)object).getReference();
18 years