JBoss Tools SVN: r3862 - in branches/jbosstools_xulrunner/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: ezheleznyakov
Date: 2007-09-27 09:41:53 -0400 (Thu, 27 Sep 2007)
New Revision: 3862
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/META-INF/MANIFEST.MF
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeAttributeOperand.java
Log:
Add dump source feature, and little fix with html tag <img/>.
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-27 13:09:20 UTC (rev 3861)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-27 13:41:53 UTC (rev 3862)
@@ -122,10 +122,10 @@
import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.selbar.SelectionBar;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -1056,10 +1056,9 @@
if (VpeDebug.visualContextMenuDumpSource) {
manager.add(new Action("Dump Source") { //$NON-NLS-1$
- public void run() {
- throw new RuntimeException("Not Implemented");
-// DOMTreeDumper dumper = new DOMTreeDumper();
-// dumper.dumpToStream(System.out, visualEditor.getDomDocument());
+ public void run() {
+ DOMTreeDumper dumper = new DOMTreeDumper();
+ dumper.dumpToStream(System.out, visualEditor.getDomDocument());
}
});
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeAttributeOperand.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeAttributeOperand.java 2007-09-27 13:09:20 UTC (rev 3861)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeAttributeOperand.java 2007-09-27 13:41:53 UTC (rev 3862)
@@ -17,11 +17,9 @@
public class VpeAttributeOperand extends VpeOperand {
private String name;
- private boolean caseSensitive;
VpeAttributeOperand(String name, boolean caseSensitive) {
this.name = name;
- this.caseSensitive = caseSensitive;
}
int getPriority() {
@@ -33,8 +31,8 @@
try {
value = ((Element)sourceNode).getAttribute(name);
- if (!caseSensitive) {
- value = (value == null ? "" : value.toLowerCase());
+ if (value == null) {
+ value = "";
}
} catch (Exception e) {
// throw new VpeExpressionError(x.getMessage());
@@ -46,4 +44,4 @@
public String getAttributeName() {
return name;
}
-}
+}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/META-INF/MANIFEST.MF 2007-09-27 13:09:20 UTC (rev 3861)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/META-INF/MANIFEST.MF 2007-09-27 13:41:53 UTC (rev 3862)
@@ -12,6 +12,7 @@
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.vpe.xulrunner;uses:="org.eclipse.jface.resource,org.eclipse.ui.plugin,org.osgi.framework",
org.jboss.tools.vpe.xulrunner.browser;uses:="org.mozilla.interfaces,org.eclipse.swt.widgets,org.mozilla.xpcom",
+ org.jboss.tools.vpe.xulrunner.browser.util,
org.jboss.tools.vpe.xulrunner.editor
Bundle-ClassPath: .
Bundle-Vendor: Red Hat, Inc.
Added: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java (rev 0)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java 2007-09-27 13:41:53 UTC (rev 3862)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.xulrunner.browser.util;
+
+import java.io.PrintStream;
+
+import org.mozilla.interfaces.nsIDOMAttr;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNamedNodeMap;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class DOMTreeDumper {
+ private PrintStream ps;
+ private boolean inA;
+ private final String[] endTagForbiddenNames = {"AREA",
+ "BASE",
+ "BASEFONT",
+ "BR",
+ "COL",
+ "FRAME",
+ "HR",
+ "IMG",
+ "INPUT",
+ "ISINDEX",
+ "LINK",
+ "META",
+ "PARAM"};
+
+ public void dumpToStream(PrintStream ps, nsIDOMDocument doc) {
+ this.ps = ps;
+ dumpDocument(doc);
+ }
+
+ private void dumpDocument(nsIDOMDocument doc) {
+ if (doc == null) {
+ return;
+ }
+ nsIDOMElement element = doc.getDocumentElement();
+ if (element == null) return;
+
+ dumpNode((nsIDOMNode)element.queryInterface(nsIDOMNode.NS_IDOMNODE_IID));
+ ps.println();
+ ps.flush();
+
+ element = null;
+ doc = null;
+ }
+
+ private void dumpNode(nsIDOMNode node) {
+ dumpNode(node, false);
+ }
+
+ private void dumpNode(nsIDOMNode node, boolean isMapNode) {
+ if (node == null) {
+ return;
+ }
+
+ int type = node.getNodeType();
+ String name = node.getNodeName();
+ String value = node.getNodeValue();
+
+ switch (type) {
+ case Node.ELEMENT_NODE:
+ if (name.equals("A")) {
+ inA = true;
+ }
+ if (!(inA || name.equals("BR"))) {
+ ps.println();
+ }
+ ps.print("<" + name);
+ dumpAttributes(node);
+ ps.print(">(" + node.hashCode() + ")");
+ dumpChildren(node);
+ if (name.equals("A")) {
+ inA = false;
+ }
+ if (!endTagForbidden(name)) {
+ ps.print("</" + name + ">");
+ }
+ break;
+
+ case Node.ATTRIBUTE_NODE:
+ nsIDOMAttr attr = (nsIDOMAttr) node.queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
+ if (attr.getSpecified()) {
+ ps.print(" " + attr.getName().toUpperCase() + "=\"" + attr.getValue() + "\"");
+ } else {
+ ps.print(" " + attr.getName().toUpperCase());
+ }
+ break;
+
+ case Node.TEXT_NODE:
+ if (!node.getParentNode().getNodeName().equals("PRE")) {
+ value = value.trim();
+ }
+ if (!value.equals("")) {
+ if (!inA) {
+ ps.println();
+ }
+ ps.print(canonicalize(value));
+ }
+ ps.print("(" + node.hashCode() + ")");
+ break;
+ case Node.COMMENT_NODE:
+ ps.print("\n<!--" + value + "-->");
+ break;
+ case Node.CDATA_SECTION_NODE:
+ case Node.ENTITY_REFERENCE_NODE:
+ case Node.ENTITY_NODE:
+ case Node.PROCESSING_INSTRUCTION_NODE:
+ case Node.DOCUMENT_NODE:
+ case Node.DOCUMENT_TYPE_NODE:
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ case Node.NOTATION_NODE:
+ ps.println("\n<!-- NOT HANDLED: " + name +
+ " value=" + value + " -->");
+ break;
+ }
+ }
+
+ private void dumpAttributes(nsIDOMNode node) {
+ nsIDOMNamedNodeMap map = node.getAttributes();
+ if (map == null) {
+ return;
+ }
+ long length = map.getLength();
+ for (int i=0; i < length; i++) {
+ dumpNode(map.item(i), true);
+ }
+ }
+
+ private void dumpChildren(nsIDOMNode node) {
+ nsIDOMNodeList children = node.getChildNodes();
+ if (children == null) {
+ return;
+ }
+ long length = children.getLength();
+ for (int i = 0; i < length; i++) {
+ dumpNode(children.item(i));
+ }
+ if (!inA) {
+ ps.println();
+ }
+ }
+
+ private String canonicalize(String str) {
+ StringBuffer in = new StringBuffer(str);
+ int length = in.length();
+ StringBuffer out = new StringBuffer(length);
+ char c;
+ for (int i = 0; i < length; i++) {
+ switch (c = in.charAt(i)) {
+ case '&' :
+ out.append("&");
+ break;
+ case '<':
+ out.append("<");
+ break;
+ case '>':
+ out.append(">");
+ break;
+ case '\u00A0':
+ out.append(" ");
+ break;
+ default:
+ out.append(c);
+ }
+ }
+ return out.toString();
+ }
+
+ private boolean endTagForbidden(String name) {
+ for (int i = 0; i < endTagForbiddenNames.length; i++) {
+ if (name.equals(endTagForbiddenNames[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
\ No newline at end of file
16 years, 7 months
JBoss Tools SVN: r3861 - in trunk/documentation/GettingStartedGuide/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-09-27 09:09:20 -0400 (Thu, 27 Sep 2007)
New Revision: 3861
Added:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad1.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad10.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad11.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad12.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad13.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad14.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad15.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad16.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad2.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad3.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad4.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad5.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad6.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad62.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad63.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad64.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad7.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad8.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad9.png
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml
Log:
http://jira.jboss.com/jira/browse/RHDS-160 the 4th is created
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad1.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad10.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad11.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad11.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad12.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad13.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad13.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad14.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad15.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad15.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad16.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad2.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad3.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad4.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad5.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad6.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad62.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad62.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad63.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad63.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad64.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad64.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad7.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad8.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad9.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad9.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml 2007-09-27 12:40:24 UTC (rev 3860)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/RADdevelopmentOfSimpleJSFapplication.xml 2007-09-27 13:09:20 UTC (rev 3861)
@@ -10,7 +10,615 @@
</keywordset>
</chapterinfo>
<title>RAD development of a simple JSF application</title>
- <para>In this chapter you will see how to create a simple JSF application being based on <property>"RAD"</property> philosophy. We will develop an application simulating a game of Craps. The user will "roll" two dice by entering two numbers and clicking two buttons and the program will announce if the user won or not depending on the program's logic.</para>
+ <para>In this chapter you will see how to create a simple JSF application being based on <property>"RAD"</property> philosophy. We will create the familiar Guess Number application. The scenario is as follows. A user is asked to guess a number between 0 and 100. If the guess is correct, a success page is displayed with a link to play again. If the guess is incorrect, a message is printed notifying the user that a smaller or a larger number should be entered and the game continues.</para>
<para>We'll show you how to create such an application from scratch, along the way demonstrating powerful features of Red Hat Developer Studio such as project templating, Visual Page Editor, code completion and others. You will design the
-JSF application and then run the application from inside Red Hat Developer Studio using the bundled JBoss server.</para>
+JSF application and then run the application from inside Red Hat Developer Studio using the bundled JBoss server.</para>
+<section id="SettingUpTheProject12">
+<?dbhtml filename="SettingUpTheProject12.html"?>
+<title>Setting up the project</title>
+<para>We will create a JSF 1.2 project using an integrated RHDS's new project wizard and predefined templates.</para>
+<para>In Web Projects View (if it is not open select <emphasis>Window > Show View > Others > Red Hat Developer Studio > Web Projects View</emphasis>) click "Create New JSF Project" button.</para>
+<figure>
+<title>Create New JSF Project</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad1.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>Put "GuessNumber" as a project name, in "JSF Environment" drop down list choose JSF 1.2.</para>
+<para>Leave everything else as it is and click Finish.</para>
+<para>Our project will appear in Project Explorer and Web Projects Views. As you can see Red Had Developer Studio has created for us the whole skeleton for the project with all needed libraries, faces-config.xml and web.xml files.</para>
+<figure>
+<title>New JSF Project</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad2.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+<section id="CreatingJSPPages">
+<?dbhtml filename="CreatingJSPPages.html"?>
+<title>Creating JSP Pages</title>
+<para>Our application has two pages. The first page is inputnumber.jsp. It prompts the user to enter a number. If the guess is incorrect, the same page will be redisplayed with a message indicating whether a smaller or a larger number should be tried. The second page is success.jsp. This page will be shown after the user guesses the number correctly. From this page you also have the option to play the game again.</para>
+
+<para>On the first page inputnumber.jsp user will enter a number.</para>
+<itemizedlist>
+<listitem><para>Open faces-config.xml file.</para></listitem>
+<listitem><para>Right click anywhere on the diagram mode.</para></listitem>
+<listitem><para>From the context menu select <emphasis>New View</emphasis></para></listitem>
+</itemizedlist>
+<figure>
+<title>Create New View</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad3.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+
+<listitem><para>Type <emphasis>pages/inputname</emphasis> as the value for "From-view-id"</para></listitem>
+<listitem><para>Leave everything else as is and click Finish.</para></listitem>
+<listitem><para>In the same way create another jsf view. Type "pages/success" as the value for "From-view-id"</para></listitem>
+<listitem><para>Select <emphasis>File > Save</emphasis></para></listitem>
+</itemizedlist>
+<para>On the diagram you will see the two created views.</para>
+<figure>
+<title>New Views</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad4.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+<section id="CreatingTransition">
+<?dbhtml filename="CreatingTransition.html"?>
+<title>Creating Transition between two views</title>
+<para>We should now create connection between jsp pages.</para>
+<itemizedlist>
+<listitem><para>In the diagram, select the connection icon third from the top along the upper left side of the diagram to get an arrow cursor with a two-pronged plug at the arrow's bottom.
+<figure>
+<title>Create connection</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad5.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</para></listitem>
+<listitem><para>Click on the <emphasis>pages/inputname</emphasis> page icon and then click on the <emphasis>pages/greeting</emphasis> page icon.</para></listitem>
+</itemizedlist>
+<para>A transition should appear between the two icons of views.</para>
+<figure>
+<title>Created connection</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad6.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Select <emphasis>File/Save</emphasis> from the menu bar.</para></listitem>
+</itemizedlist>
+</section>
+<section id="CreatingResourceFile">
+<?dbhtml filename="CreatingResourceFile.html"?>
+<title>Creating Resource File</title>
+<para>Red Hat Developer Studio allows to quickly create a resource file. Using this feature you can collect text messages in one central place. A resource file is just a file with a <emphasis>.properties</emphasis> extension. The messages stored in resource file can be displayed to the user on a Web page during application execution. </para>
+<para>With resource file first, you don't hard code anything into the JSP pages. And second, it makes it easier to translate your application to other languages. All you have to do is to translate all your messages to the other language and save them in a new properties file with a name that ends with the appropriate ISO-639 language code.</para>
+<para>It is a good idea to keep your resources inside the <emphasis>JavaSource</emphasis> folder, where you keep your .java files. Every time you build the project, all <emphasis>.properties</emphasis> files will then be copied to the <emphasis>classes</emphasis> folder by default.</para>
+<itemizedlist>
+<listitem><para>Right click <emphasis>JavaSource</emphasis> folder and select <emphasis>New > Folder</emphasis></para></listitem>
+<listitem><para>Type "game" for Folder name and click Finish</para></listitem>
+</itemizedlist>
+<para>We will store in this folder our resource file and java bean.</para>
+<itemizedlist>
+<listitem><para>Right click game folder and select <emphasis>New > Properties File</emphasis></para></listitem>
+<listitem><para>Type <emphasis>messages</emphasis> as the value for <emphasis>name</emphasis> attribute and click Finish</para></listitem>
+</itemizedlist>
+<para>Red Hat Developer Studio will automatically open messages.properties file for editing.</para>
+<figure>
+<title>messages.properties file</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad62.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Click <emphasis>Add</emphasis> button</para></listitem>
+<listitem><para>Type <emphasis role="italic"><property>how_to_play</property></emphasis> for "name" and <emphasis role="italic"><property>Please pick a number between 0 and 100.</property></emphasis> for value</para></listitem>
+<listitem><para>Click Finish</para></listitem>
+<listitem><para>In such a way add the next properties:</para></listitem>
+</itemizedlist>
+<programlisting role="JAVA"><![CDATA[makeguess_button=Make Guess
+trayagain_button=Play Again?
+success_text=How cool.. You have guessed the number, {0} is correct!
+tryagain_smaller=Oops..incorrect guess. Please try a smaller number.
+tryagain_bigger=Oops..incorrect guess. Please try a bigger number.
+]]></programlisting>
+<itemizedlist>
+<listitem><para>Click <emphasis>File > Save</emphasis> from the menu bar</para></listitem>
+</itemizedlist>
+<para>Your .properties file should now look like follows:</para>
+<figure>
+<title>Properties are added</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad63.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+
+<section id="CreatingJavaBean">
+<?dbhtml filename="CreatingJavaBean.html"?>
+<title>Creating Java Bean</title>
+<para>Now we create a Java bean that will hold business logic of our application.</para>
+<itemizedlist>
+<listitem><para>Right click <emphasis>game</emphasis> folder</para></listitem>
+<listitem><para>Select <emphasis>New > Class</emphasis></para></listitem>
+<listitem><para>Type <emphasis>NumberBean</emphasis></para> for bean name</listitem>
+</itemizedlist>
+<para>A java bean is created.</para>
+<itemizedlist>
+<listitem><para>Declare the variable of user entered number:</para></listitem>
+</itemizedlist>
+<programlisting role="JAVA"><![CDATA[Integer userNumber;
+]]></programlisting>
+<para>Red Hat Studio allows to quickly generate getters and setters for java bean.</para>
+<itemizedlist>
+<listitem><para>Right click NumberBean.java in Package Explorer</para></listitem>
+<listitem><para>Select <emphasis>Source > Generate Getters and Setters...</emphasis></para></listitem>
+<listitem><para>Check <emphasis>userNumber</emphasis> box and click OK
+<figure>
+<title>Generate Getters and Setters</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad64.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</para></listitem>
+<listitem><para>Add the declaration of the second variable</para></listitem>
+</itemizedlist>
+<programlisting role="JAVA"><![CDATA[int randomNumber;
+]]></programlisting>
+<itemizedlist>
+<listitem><para>.. other bean methods:</para></listitem>
+</itemizedlist>
+<programlisting role="JAVA"><![CDATA[public NumberBean ()
+{
+ randomNumber = (int)(Math.random()*100);
+ System.out.println ( "Random number: "+randomNumber);
+ }
+ public String playagain ()
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
+ session.invalidate();
+ return "playagain";
+ }
+ public String checkGuess ()
+ {
+
+ // if guessed, return 'success' for navigation
+ if ( userNumber.intValue() == randomNumber )
+ {
+ return "success";
+ }
+else
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ResourceBundle bundle = ResourceBundle.getBundle("game.messages", context.getViewRoot().getLocale());
+ String msg = "";
+ // if number bigger, get appropriate message
+ if ( userNumber.intValue() > randomNumber )
+ msg = bundle.getString("tryagain_smaller");
+ else // if number smaller, get appropriate message
+ msg = bundle.getString("tryagain_bigger");
+ // add message to be displayed on the page via <h:messages> tag
+ context.addMessage (null, new FacesMessage(msg));
+ // return 'tryagain' for navigation
+ return "tryagain";
+ }
+ }
+]]></programlisting>
+<itemizedlist>
+<listitem><para>And the import declarations:</para></listitem>
+</itemizedlist>
+<programlisting role="JAVA"><![CDATA[import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpSession;
+import javax.faces.application.FacesMessage;
+import java.util.Locale;
+import java.util.ResourceBundle;
+]]></programlisting>
+<para>The whole java bean should look as follows:</para>
+<programlisting role="JAVA"><![CDATA[import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpSession;
+import javax.faces.application.FacesMessage;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+public class NumberBean
+{
+ Integer userNumber;
+ int randomNumber; // random number generated by application
+public Integer getUserNumber ()
+ {
+ return userNumber;
+ }
+ public void setUserNumber (Integer value)
+ {
+ this.userNumber = value;
+ }
+
+ // constructor, generates random number
+ public NumberBean ()
+ {
+ randomNumber = (int)(Math.random()*100);
+ System.out.println (
+ "Random number: " + randomNumber);
+ }
+
+ public String playagain ()
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
+ session.invalidate();
+ return "playagain";
+ }
+
+ // check if user guessed the number
+ public String checkGuess ()
+ {
+ // if guessed, return 'success' for navigation
+ if ( userNumber.intValue() == randomNumber )
+ {
+ return "success";
+ }
+ // incorrect guess
+ else
+ {
+ // get a reference to properties file to retrieve messages
+ FacesContext context = FacesContext.getCurrentInstance();
+ ResourceBundle bundle = ResourceBundle.getBundle("game.messages", context.getViewRoot().getLocale());
+ String msg = "";
+ // if number is bigger, get appropriate message
+ if ( userNumber.intValue() > randomNumber )
+ msg = bundle.getString("tryagain_smaller");
+ else // if number smaller, get appropriate message
+ msg = bundle.getString("tryagain_bigger");
+
+ // add message to be displayed on the page via <h:messages> tag
+ context.addMessage (null, new FacesMessage(msg));
+ // return 'tryagain' for navigation
+ return "tryagain";
+ }
+ }
+}
+]]></programlisting>
+</section>
+
+<section id="EditingFacesConfig">
+<?dbhtml filename="EditingFacesConfig.html"?>
+<title>Editing faces-config.xml File</title>
+<para>This file holds our two navigation rules and defines the backing bean used.</para>
+<itemizedlist>
+<listitem><para>Open faces-config.xml file in source mode.</para></listitem>
+<listitem><para>Add here one more navigation rule and a managed bean declarations that the content of the file looks like this:</para></listitem>
+</itemizedlist>
+<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee
+xmlns:xi="http://www.w3.org/2001/XInclude"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2_.xsd">
+
+ <navigation-rule>
+ <from-view-id>*</from-view-id>
+ <navigation-case>
+ <from-outcome>playagain</from-outcome>
+ <to-view-id>/pages/inputnumber.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/pages/inputnumber.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/pages/success.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <managed-bean>
+ <managed-bean-name>NumberBean</managed-bean-name>
+ <managed-bean-class>game.NumberBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
+]]></programlisting>
+<para>The first navigation rule states that from any page (<property>*</property> stands for any page) an outcome of playagain will take you to <emphasis>/pages/inputnumber.jsp</emphasis>. Outcome values are returned from backing bean methods in this example. The second navigation rule states that if you are at the page <emphasis>/pages/inputnumber.jsp</emphasis>, and the outcome is success, then navigate to the <emphasis>/pages/success.jsp</emphasis> page.
+</para>
+</section>
+<section id="EditingTheJSPViewFiles2">
+<?dbhtml filename="EditingTheJSPViewFiles2.html"?>
+<title>Editing the JSP View Files</title>
+<para>Now we will finish editing the JSP files for our two "views" using Red Hat's Visual Page
+Editor.</para>
+<section id="EditingInputjsp">
+<?dbhtml filename="EditingInputjsp.html"?>
+<title>Editing inputname.jsp page</title>
+<para>On this page we will have an output text component displaying a message, a text field for user's number entering and a button for input submission.</para>
+<itemizedlist>
+<listitem><para>Open inputnumber.jsp by double-clicking on the <emphasis>/pages/inputnamber.
+jsp</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. You can see that some JSF code will be already generated as we choose a template when creating the page.</para>
+<para>At the beginning we will create a <emphasis role="bold"><property><h:form></property></emphasis> component where will put all others components.</para>
+<itemizedlist>
+<listitem><para>Place the mouse cursor inside <emphasis role="bold"><property><f:view></property></emphasis><emphasis role="bold"><property></f:view></property></emphasis></para></listitem>
+<listitem><para>Go to JBoss Tools Palette and expand JSF HTML folder by selecting it</para></listitem>
+<listitem><para>Click on <emphasis role="bold"><property><h:form></property></emphasis> tag
+<figure>
+<title>Insert h:form</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad7.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</para></listitem>
+<listitem><para>In the dialog Insert Tag select <emphasis>id</emphasis> and click on this line below the value header. A blinking cursor will appear in a input text field inviting to enter a value of id
+<figure>
+<title>Define id of form</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad8.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</para></listitem>
+<listitem><para>Type "inputNumbers" and click Finish</para></listitem>
+</itemizedlist>
+<para>In source view you can see the declaration of form.</para>
+<figure>
+<title>Created form</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad9.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>First let's declare the properties file in inputnumber.jsp page using the loadBundle JSF tag.</para>
+<itemizedlist>
+<listitem><para>Put this declaration in the top of the page, right after the first two lines:</para></listitem>
+</itemizedlist>
+<programlisting role="XML"><![CDATA[<f:loadBundle basename="game.messages" var="msg"/>
+]]></programlisting>
+<para>As always Red Hat Studio provides code assist:</para>
+<figure>
+<title>Code assist</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad10.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Switch to Visual tab, so we can work with the editor completely in its WYSIWYG mode.</para></listitem>
+<listitem><para>Click on <emphasis>outputText</emphasis>, drag the cursor over to the editor, and drop it inside the blue box in the editor.</para></listitem>
+
+<listitem><para>Select <emphasis>value</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Click <emphasis>...</emphasis> button next to the value field</para></listitem>
+</itemizedlist>
+<para>RHDS will nicely propose us to choose within available values:</para>
+<figure>
+<title>Choose Value</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad11.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Expand <emphasis>Resource Bundles > msg</emphasis></para></listitem>
+<listitem><para>Select "how_to_play" value and click Ok. Then click Finish
+<figure>
+<title>Selecting Value</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad12.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</para></listitem>
+</itemizedlist>
+<para>The text will appear on the page:</para>
+<figure>
+<title>Created outputText component</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad13.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Switch to Source mode and insert <emphasis role="bold"><property><br/></property></emphasis> tag after <emphasis role="bold"><property><h:outputText></property></emphasis> component to make a new line.</para></listitem>
+<listitem><para>Click Save button.</para></listitem>
+<listitem><para>On the Palette Click on <emphasis>inputText</emphasis>, drag the cursor over to the editor, and drop it inside the editor after the text.</para></listitem>
+<listitem><para>Select <emphasis>value</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Click <emphasis>...</emphasis> button next to the value field</para></listitem>
+<listitem><para>Expand <emphasis>Managed Beans > NumberBean</emphasis></para></listitem>
+<listitem><para>Select "userNumber" value and click Ok.</para></listitem>
+<listitem><para>Switch <emphasis>Advanced</emphasis> tab</para></listitem>
+<listitem><para>Select <emphasis>id</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Type "userNumber" in text field</para></listitem>
+<listitem><para>Select <emphasis>required</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Click <emphasis>...</emphasis> button next to the value field</para></listitem>
+<listitem><para>Expand <emphasis>Enumeration</emphasis> and select <emphasis>true</emphasis> as a value</para></listitem>
+</itemizedlist>
+<figure>
+<title>Add required attribute</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad14.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<itemizedlist>
+<listitem><para>Click Ok, then click Finish</para></listitem>
+<listitem><para>Go to Source mode</para></listitem>
+<listitem><para>Add the validation attribute to <emphasis role="bold"><property><f:validateLongRange></property></emphasis> for user input validation</para></listitem></itemizedlist>
+<programlisting role="XML"><![CDATA[<h:inputText id="userNumber" value="#{NumberBean.userNumber}" required="true">
+ <f:validateLongRange minimum="0" maximum="100"/>
+</h:inputText>
+]]></programlisting>
+<itemizedlist>
+<listitem><para>Click Save button</para></listitem>
+<listitem><para>Again select Visual mode</para></listitem>
+<listitem><para>On the Palette Click on <emphasis>commandButton</emphasis>, drag the cursor over to the editor, and drop it inside the editor after the inputText component.</para></listitem>
+<listitem><para>In the editing dialog select <emphasis>value</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Click <emphasis>...</emphasis> button next to the value field</para></listitem>
+<listitem><para>Expand <emphasis>Resource Bundles > msg</emphasis> and select <emphasis>makeguess_button</emphasis> as a value</para></listitem>
+<listitem><para>Click Ok</para></listitem>
+<listitem><para>Select <emphasis>action</emphasis> and click on this line below "value" header</para></listitem>
+<listitem><para>Type "NumberBean.checkGuess" in text field</para></listitem>
+<listitem><para>Click Finish</para></listitem>
+<listitem><para>In Source mode add <emphasis role="bold"><property><br/></property></emphasis> tags between <emphasis role="bold"><property><outputText></property></emphasis>, <emphasis role="bold"><property><inputText></property></emphasis> and <emphasis role="bold"><property><commandButton></property></emphasis> components to place them on different lines</para></listitem>
+</itemizedlist>
+<para>inputnumber.jsp page should look like this:</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" %>
+<f:loadBundle basename="game.messages" var="msg"/>
+
+<html>
+ <f:view>
+ <h:form id="inputNumbers">
+ <h:outputText value="#{msg.how_to_play}"/>
+ <br/>
+ <h:messages style="color: blue"/>
+ <br/>
+ <h:inputText id="userNumber" value="#{NumberBean.userNumber}" required="true">
+ <f:validateLongRange minimum="0" maximum="100"/>
+ </h:inputText>
+ <br/><br/>
+ <h:commandButton value="#{msg.makeguess_button}" action="#{NumberBean.checkGuess}"/>
+ </h:form>
+ </f:view>
+</html>
+]]></programlisting>
+</section>
+<section id="EditingSuccessJsp">
+<?dbhtml filename="EditingSuccessJsp.html"?>
+<title>Editing success.jsp page</title>
+<para>In the same way like inputnumber.jsp edit success.jsp page. Its whole source should be the next:</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" %>
+<f:loadBundle basename="game.messages" var="msg"/>
+
+<html>
+ <f:view>
+ <h:form id="result">
+ <h:outputFormat value="#{msg.success_text}">
+ <f:param value="#{NumberBean.userNumber}"/>
+ </h:outputFormat>
+ <br/><br/>
+ <h:commandButton value="#{msg.trayagain_button}" action="#{NumberBean.playagain}"/>
+ </h:form>
+ </f:view>
+</html>
+]]></programlisting>
+<para>Again you can use code assist provided by RHDS when editing jsp page:</para>
+<figure>
+<title>Code Assist for <f:param></title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad15.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<para>This page, success.jsp, is shown if the user correctly guessed the number. The <emphasis role="bold"><property><h:outputFormat></property></emphasis> tag will get the value of success_text from the properties file. The {0} in success_text will be substituted for by the value of the value attribute within the <emphasis role="bold"><property><f:param></property></emphasis> tag during runtime.</para>
+<para>At the end, we have a button which allows us to replay the game. The action value references a backing bean method. In this case, the method only terminates the current session so that when we are shown the first page, the input text box is clear and a new random number is generated.</para>
+<itemizedlist>
+<listitem><para>Switch to Preview mode to see how this page will look in browser:</para></listitem>
+</itemizedlist>
+<figure>
+<title>success.jsp in Preview mode</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/newrad16.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
+</section>
+ <section id="CreatingIndexjsp">
+<?dbhtml filename="CreatingIndexjsp.html"?>
+<title>Creating index.jsp page</title>
+<para>The index.jsp page is the entry point of our application. It's just forwarding to inputnumber.jsp page.</para>
+<itemizedlist>
+<listitem><para>Right click <emphasis>WebContent > New > JSP File</emphasis></para></listitem>
+<listitem><para>Type "index" for name field and choose JSPRedirect as a template</para></listitem>
+<listitem><para>Click Finish</para></listitem>
+<listitem><para>The source for this page should be like follows:</para></listitem>
+</itemizedlist>
+<programlisting role="XML"><![CDATA[<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <body>
+ <jsp:forward page="/pages/inputnumber.jsf" />
+ </body>
+</html>
+
+]]></programlisting>
+<para>Note the <emphasis>.jsf</emphasis> extension of page. It means that we trigger the JSF controller servlet to handle the page according the servlet mapping in faces-config.xml file.</para>
+</section>
+<section id="RunningTheApplication33">
+<?dbhtml filename="RunningTheApplication33.html"?>
+<title>Running the Application</title>
+<para>Everything is ready to run the application.</para>
+<itemizedlist>
+<listitem><para>Start up JBoss server by clicking on the Start icon in JBoss Server view. (If JBoss is already running, stop it by clicking on the red icon and then start it again. After the messages in the Console tabbed view stop scrolling, JBoss is available.</para></listitem>
+<listitem><para>Click on the Red Hat run icon in the toolbar</para></listitem>
+<listitem><para>Play with the application by entering correct as well as incorrect values</para></listitem>
+</itemizedlist>
+<figure>
+<title>A user is asked to enter a number between 0 and 100</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/default.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+<figure>
+<title>User input is validated and an error message is displayed if invalid input was entered</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/default.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+<figure>
+<title>After the user enters a guess, the application tells the user if a smaller or a larger number should be tried</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/default.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+
+<figure>
+<title>A user guesses correctly</title>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/default.png"/>
+ </imageobject>
+</mediaobject>
+</figure>
+</section>
</chapter>
\ No newline at end of file
16 years, 7 months
JBoss Tools SVN: r3860 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-09-27 08:40:24 -0400 (Thu, 27 Sep 2007)
New Revision: 3860
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-949
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-09-27 12:02:41 UTC (rev 3859)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-09-27 12:40:24 UTC (rev 3860)
@@ -25,6 +25,7 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamContextVariable;
@@ -198,7 +199,8 @@
Set<String> methods = new HashSet<String>();
if (type != null) {
try {
- IMethod[] mthds = type.getMethods();
+// IMethod[] mthds = type.getMethods();
+ IMethod[] mthds = getAllMethods(type);
for (int i = 0; mthds != null && i < mthds.length; i++) {
IMethod m = mthds[i];
if (Modifier.isPublic(m.getFlags()) &&
@@ -232,6 +234,43 @@
}
/**
+ * @param type
+ * @return methods of type and methods of all super classes
+ */
+ private static IMethod[] getAllMethods(IType type) {
+ ArrayList<IMethod> result = new ArrayList<IMethod>();
+ try {
+ IMethod[] mthds = type.getMethods();
+ for(int i=0; i<mthds.length; i++) {
+ result.add(mthds[i]);
+ }
+ IType superType = getSuperclass(type);
+ while(superType!=null) {
+ mthds = superType.getMethods();
+ for(int i=0; i<mthds.length; i++) {
+ result.add(mthds[i]);
+ }
+ superType = getSuperclass(superType);
+ }
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return result.toArray(new IMethod[result.size()]);
+ }
+
+ private static IType getSuperclass(IType type) throws JavaModelException {
+ String superclassName = type.getSuperclassName();
+ if(superclassName!=null) {
+ String fullySuperclassName = EclipseJavaUtil.resolveType(type, superclassName);
+ if(fullySuperclassName!=null&&!fullySuperclassName.equals("java.lang.Object")) {
+ IType superType = type.getJavaProject().findType(fullySuperclassName);
+ return superType;
+ }
+ }
+ return null;
+ }
+
+ /**
* Returns the properties for the type specified
*
* @param type
@@ -290,7 +329,8 @@
Set<String> properties = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
if (type != null) {
try {
- IMethod[] props = type.getMethods();
+// IMethod[] props = type.getMethods();
+ IMethod[] props = getAllMethods(type);
HashMap<String, IMethod> getters = new HashMap<String, IMethod>();
HashMap<String, IMethod> setters = new HashMap<String, IMethod>();
for (int i = 0; props != null && i < props.length; i++) {
16 years, 7 months
JBoss Tools SVN: r3859 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-09-27 08:02:41 -0400 (Thu, 27 Sep 2007)
New Revision: 3859
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-949
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-09-27 10:51:20 UTC (rev 3858)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-09-27 12:02:41 UTC (rev 3859)
@@ -262,7 +262,7 @@
}
}
- if(res.isEmpty()) {
+ if(res.isEmpty() && unpairedGettersOrSetters!=null) {
unpairedGettersOrSetters.clear();
}
return res;
16 years, 7 months
JBoss Tools SVN: r3858 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-09-27 06:51:20 -0400 (Thu, 27 Sep 2007)
New Revision: 3858
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-949
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-09-27 09:07:38 UTC (rev 3857)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-09-27 10:51:20 UTC (rev 3858)
@@ -262,6 +262,9 @@
}
}
+ if(res.isEmpty()) {
+ unpairedGettersOrSetters.clear();
+ }
return res;
}
16 years, 7 months
JBoss Tools SVN: r3857 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-27 05:07:38 -0400 (Thu, 27 Sep 2007)
New Revision: 3857
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
JBIDE-950
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-09-27 07:55:28 UTC (rev 3856)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-09-27 09:07:38 UTC (rev 3857)
@@ -32,6 +32,7 @@
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
@@ -150,9 +151,16 @@
}
private void validateDom(IFile file, String content) {
+ IModelManager manager = StructuredModelManager.getModelManager();
+ if(manager == null) {
+ // this can happen if plugin org.eclipse.wst.sse.core
+ // is stopping or uninstalled, that is Eclipse is shutting down.
+ // there is no need to report it, just stop validation.
+ return;
+ }
IStructuredModel model = null;
try {
- model = StructuredModelManager.getModelManager().getModelForRead(file);
+ model = manager.getModelForRead(file);
if (model instanceof IDOMModel) {
IDOMModel domModel = (IDOMModel) model;
IStructuredDocument structuredDoc = domModel.getStructuredDocument();
16 years, 7 months
JBoss Tools SVN: r3856 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-27 03:55:28 -0400 (Thu, 27 Sep 2007)
New Revision: 3856
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
Log:
System.out was removed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-09-27 07:40:30 UTC (rev 3855)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-09-27 07:55:28 UTC (rev 3856)
@@ -108,9 +108,6 @@
List<String[]> fileMappingCopy = applayVariables(fileMapping,vars);
FilterSetCollection filters = getFilterSetCollection(vars);
for (String[] mapping : fileMappingCopy) {
-// if(SeamCorePlugin.getDefault().isDebugging()) {
- System.out.println(mapping[0] + "->" + mapping[1]);
-// }
AntCopyUtils.copyFileToFile(new File(mapping[0]),new File(mapping[1]),filters,true);
}
16 years, 7 months
JBoss Tools SVN: r3855 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-27 03:40:30 -0400 (Thu, 27 Sep 2007)
New Revision: 3855
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
Log:
changes will not be seen by anyone (extension commented out for release)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java 2007-09-27 07:40:28 UTC (rev 3854)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java 2007-09-27 07:40:30 UTC (rev 3855)
@@ -38,7 +38,6 @@
public class AttributeGroup extends Composite {
- protected Group group;
protected Tree tree;
protected TreeColumn nameColumn, typeColumn, accessColumn, valueColumn,
descriptionColumn;
@@ -49,9 +48,6 @@
super(parent, style);
this.page = page;
setLayout(new FillLayout());
-// group = new Group(this, SWT.NONE);
-// group.setText("Attributes");
-// group.setLayout(new FillLayout());
tree = new Tree(this, SWT.BORDER | SWT.FULL_SELECTION);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java 2007-09-27 07:40:28 UTC (rev 3854)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java 2007-09-27 07:40:30 UTC (rev 3855)
@@ -25,7 +25,6 @@
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.WrappedMBeanOperationInfo;
import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
import org.jboss.ide.eclipse.as.ui.views.server.providers.jmx.JMXViewProvider.ErrorGroup;
-import org.jboss.ide.eclipse.as.ui.views.server.providers.jmx.JMXViewProvider.OperationGroup;
public class JMXPropertySheetPage implements IPropertySheetPage {
@@ -35,7 +34,7 @@
protected WrappedMBeanOperationInfo[] operations;
// ui pieces
- protected Composite main;
+ protected Composite main, domainGroup;
protected Combo pulldown;
protected Label beanLabel;
protected PageBook book;
@@ -95,8 +94,9 @@
book.setLayoutData(bookData);
errorGroup = new ErrorGroup(book, SWT.NONE);
- operationGroup = new OperationGroup(book, SWT.NONE);
+ operationGroup = new OperationGroup(book, SWT.NONE, this);
attributeGroup = new AttributeGroup(book, SWT.NONE, this);
+ domainGroup = new Composite(book, SWT.NONE);
}
public void dispose() {
@@ -222,7 +222,7 @@
}
protected void showDomainComposite(JMXDomain domain) {
- // nothing
+ book.showPage(domainGroup);
}
protected void showErrorComposite() {
@@ -240,8 +240,17 @@
String selected = pulldown
.getItem(pulldown.getSelectionIndex());
book.showPage(operationGroup);
+ operationGroup.setOperation(findOperation(bean, selected));
}
}
}
+ protected WrappedMBeanOperationInfo findOperation(JMXBean bean, String selected) {
+ WrappedMBeanOperationInfo[] opInfos = bean.getOperations();
+ for( int i = 0; i < opInfos.length; i++ ) {
+ if( getStringForOperation(opInfos[i]).equals(selected))
+ return opInfos[i];
+ }
+ return null;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2007-09-27 07:40:28 UTC (rev 3854)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2007-09-27 07:40:30 UTC (rev 3855)
@@ -171,16 +171,4 @@
group.setText("Error");
}
}
-
- protected static class OperationGroup extends Composite {
- protected Group group;
- public OperationGroup(Composite parent, int style) {
- super(parent, style);
- setLayout(new FillLayout());
- group = new Group(this, SWT.NONE);
- group.setText("Operation");
- }
- }
-
-
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java 2007-09-27 07:40:30 UTC (rev 3855)
@@ -0,0 +1,130 @@
+package org.jboss.ide.eclipse.as.ui.views.server.providers.jmx;
+
+import javax.management.MBeanParameterInfo;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.WrappedMBeanOperationInfo;
+
+public class OperationGroup extends Composite {
+ protected Tree tree;
+ protected TreeColumn nameColumn, typeColumn,
+ valueColumn, descriptionColumn;
+ protected TreeViewer treeViewer;
+ protected JMXPropertySheetPage page;
+ protected Button executeButton;
+
+ public OperationGroup(Composite parent, int style, JMXPropertySheetPage page) {
+ super(parent, style);
+ this.page = page;
+ setLayout(new FormLayout());
+
+ executeButton = new Button(this, SWT.PUSH);
+ executeButton.setText("execute");
+ FormData executeData = new FormData();
+ executeData.right = new FormAttachment(100,0);
+ executeData.top = new FormAttachment(0,0);
+ executeData.bottom = new FormAttachment(100,0);
+ executeButton.setLayoutData(executeData);
+
+
+ tree = new Tree(this, SWT.BORDER | SWT.FULL_SELECTION);
+ FormData treeData = new FormData();
+ treeData.left = new FormAttachment(0,0);
+ treeData.right = new FormAttachment(executeButton, 0);
+ treeData.top = new FormAttachment(0,0);
+ treeData.bottom = new FormAttachment(100,0);
+ tree.setLayoutData(treeData);
+
+
+ nameColumn = new TreeColumn(tree, SWT.NONE);
+ typeColumn = new TreeColumn(tree, SWT.NONE);
+ valueColumn = new TreeColumn(tree, SWT.NONE);
+ descriptionColumn = new TreeColumn(tree, SWT.NONE);
+
+ nameColumn.setWidth(100);
+ typeColumn.setWidth(150);
+ valueColumn.setWidth(200);
+ descriptionColumn.setWidth(300);
+
+ nameColumn.setText("Name");
+ typeColumn.setText("Type");
+ valueColumn.setText("Value");
+ descriptionColumn.setText("Description");
+
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ treeViewer = new TreeViewer(tree);
+ treeViewer.setContentProvider(new OperationViewerContentProvider());
+ treeViewer.setLabelProvider(new OperationViewerLabelProvider());
+
+// JMXAttributePropertySelListener selListener = new JMXOperationPropertySelListener();
+// tree.addListener(SWT.MouseDoubleClick, selListener);
+
+ }
+
+ protected class OperationViewerContentProvider implements
+ ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement != null && parentElement instanceof WrappedMBeanOperationInfo ) {
+ return ((WrappedMBeanOperationInfo)parentElement).getInfo().getSignature();
+ }
+ return new Object[] {};
+ }
+ public Object getParent(Object element) {
+ return null;
+ }
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+
+
+ protected class OperationViewerLabelProvider extends LabelProvider
+ implements ITableLabelProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if( element instanceof MBeanParameterInfo ) {
+ MBeanParameterInfo info = (MBeanParameterInfo)element;
+ if( columnIndex == 0 ) return info.getName();
+ if( columnIndex == 1 ) return info.getType();
+ if( columnIndex == 2 ) return "";
+ if( columnIndex == 3 ) return info.getDescription();
+ }
+ return "";
+ }
+
+ }
+
+ public void setOperation(WrappedMBeanOperationInfo op) {
+ treeViewer.setInput(op);
+ }
+
+}
16 years, 7 months
JBoss Tools SVN: r3854 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-27 03:40:28 -0400 (Thu, 27 Sep 2007)
New Revision: 3854
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
Log:
changes will not be seen by anyone (extension commented out for release)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-09-27 07:39:40 UTC (rev 3853)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-09-27 07:40:28 UTC (rev 3854)
@@ -13,6 +13,7 @@
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanInfo;
import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectInstance;
@@ -263,6 +264,7 @@
protected IServer server;
protected JMXBean bean;
protected MBeanOperationInfo info;
+ protected WrappedMBeanOperationParameter[] params;
public WrappedMBeanOperationInfo(IServer server, JMXBean bean,
MBeanOperationInfo info) {
@@ -276,8 +278,42 @@
public JMXBean getBean() {
return bean;
}
+
+ public WrappedMBeanOperationParameter[] getParameters() {
+ if( params == null ) {
+ MBeanParameterInfo[] paramInfo = info.getSignature();
+ params = new WrappedMBeanOperationParameter[paramInfo.length];
+ for( int i = 0; i < paramInfo.length; i++ ) {
+ params[i] = new WrappedMBeanOperationParameter(this, paramInfo[i]);
+ }
+ }
+ return params;
+ }
+
+ public void clearParamValues() {
+ if( params != null ) {
+ for( int i = 0; i < params.length; i++ )
+ params[i].setValue(null);
+ }
+ }
}
+ public static class WrappedMBeanOperationParameter {
+ protected WrappedMBeanOperationInfo operation;
+ protected MBeanParameterInfo parameterInfo;
+ protected Object value;
+
+ public WrappedMBeanOperationParameter(WrappedMBeanOperationInfo operation, MBeanParameterInfo param) {
+ this.parameterInfo = param;
+ this.operation = operation;
+ }
+
+ public IServer getServer() { return operation.server; }
+ public JMXBean getBean() { return operation.bean; }
+
+ public Object getValue() { return value; }
+ public void setValue(Object o) { this.value = o; }
+ }
public static class WrappedMBeanAttributeInfo {
protected IServer server;
16 years, 7 months
JBoss Tools SVN: r3853 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-27 03:39:40 -0400 (Thu, 27 Sep 2007)
New Revision: 3853
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
Log:
null check
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2007-09-27 07:33:25 UTC (rev 3852)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2007-09-27 07:39:40 UTC (rev 3853)
@@ -99,6 +99,7 @@
}
public static void markChanged(EventLogTreeItem item) {
+ if( item == null ) return;
SimpleTreeItem root = item.getRoot();
if( root != null && root instanceof EventLogRoot ) {
String serverId = ((EventLogRoot)root).getServerId();
16 years, 7 months