JBoss Tools SVN: r8182 - in branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-05-19 12:19:58 -0400 (Mon, 19 May 2008)
New Revision: 8182
Modified:
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/EditableTemplateAdapter.java
branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TemplateManagingUtil.java
Log:
correct input elements editable
Modified: branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/EditableTemplateAdapter.java
===================================================================
--- branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/EditableTemplateAdapter.java 2008-05-19 15:18:31 UTC (rev 8181)
+++ branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/EditableTemplateAdapter.java 2008-05-19 16:19:58 UTC (rev 8182)
@@ -176,7 +176,7 @@
.getCurrentSelection(pageContext));
}
- if (node == null)
+ if (node == null || selectedRange == null)
return false;
// get focus and anchor offsets
@@ -288,7 +288,7 @@
.getCurrentSelection(pageContext));
}
- if (node == null)
+ if (node == null || selectedRange == null)
return false;
// get focus and anchor offsets
@@ -391,7 +391,7 @@
selectedRange = getSelectionRange(TemplateManagingUtil
.getCurrentSelection(pageContext));
}
- if (node == null)
+ if (node == null || selectedRange == null)
return false;
// get focus and anchor offsets
@@ -523,13 +523,13 @@
Node node = getTargetSourceNodeByVisualNode(pageContext, visualNode,
elementMapping);
- if (node == null)
- return false;
-
// get focus and anchor offsets
Point selectedRange = getSelectionRange(TemplateManagingUtil
.getCurrentSelection(pageContext));
+ if (node == null || selectedRange == null)
+ return false;
+
int focusOffset = selectedRange.x;
// if node editable
@@ -595,13 +595,13 @@
Node node = getTargetSourceNodeByVisualNode(pageContext,
visualNode, elementMapping);
- if (node == null)
- return false;
-
// get focus and anchor offsets
Point selectedRange = getSelectionRange(TemplateManagingUtil
.getCurrentSelection(pageContext));
+ if (node == null || selectedRange == null)
+ return false;
+
int focusOffset = selectedRange.x;
if (focusOffset != 0) {
@@ -710,6 +710,20 @@
TemplateManagingUtil.setSourceSelection(pageContext, targetSourceNode,
focusOffset, length);
+ if ((HTML.TAG_INPUT.equalsIgnoreCase(targetVisualNode.getLocalName()))
+ || (HTML.TAG_TEXTAREA.equalsIgnoreCase(targetVisualNode
+ .getLocalName()))) {
+
+ TemplateManagingUtil.setSelectionRangeInInputElement(
+ targetVisualNode, new Point(focusOffset, length));
+
+ selection.collapse(targetVisualNode.getParentNode(),
+ (int) VisualDomUtil.getOffset(targetVisualNode));
+
+ selection.extend(targetVisualNode.getParentNode(),
+ (int) VisualDomUtil.getOffset(targetVisualNode) + 1);
+ }
+
// setSelectionRange(selection,
// targetVisualNode, new Point(focusOffset, length));
@@ -826,6 +840,23 @@
// .getSelection(nsISelectionController.SELECTION_NORMAL),
// targetVisualNode, new Point(selectionOffset, selectionLength));
+ if ((HTML.TAG_INPUT.equalsIgnoreCase(targetVisualNode.getLocalName()))
+ || (HTML.TAG_TEXTAREA.equalsIgnoreCase(targetVisualNode
+ .getLocalName()))) {
+
+ TemplateManagingUtil.setSelectionRangeInInputElement(
+ targetVisualNode, new Point(selectionOffset,
+ selectionLength));
+
+ (selectionController.getSelection(nsISelectionController.SELECTION_NORMAL)).collapse(targetVisualNode.getParentNode(),(int)
+ VisualDomUtil.getOffset(targetVisualNode));
+
+ (selectionController
+ .getSelection(nsISelectionController.SELECTION_NORMAL))
+ .extend(targetVisualNode.getParentNode(),
+ (int) VisualDomUtil.getOffset(targetVisualNode) + 1);
+ }
+
// check for text node
if (targetVisualNode.getNodeType() != nsIDOMNode.ELEMENT_NODE) {
targetVisualNode = targetVisualNode.getParentNode();
@@ -1114,9 +1145,11 @@
nsIDOMNode focusedNode = TemplateManagingUtil
.getSelectedNode(selection);
- Point range = new Point(0, 0);
+ Point range = null;
if (focusedNode != null) {
+
+ range = new Point(0,0);
if ((HTML.TAG_INPUT.equalsIgnoreCase(focusedNode.getLocalName()))
|| (HTML.TAG_TEXTAREA.equalsIgnoreCase(focusedNode
.getLocalName()))) {
Modified: branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TemplateManagingUtil.java
===================================================================
--- branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TemplateManagingUtil.java 2008-05-19 15:18:31 UTC (rev 8181)
+++ branches/jbosstools-2.1.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TemplateManagingUtil.java 2008-05-19 16:19:58 UTC (rev 8182)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
-import java.util.List;
-
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
@@ -272,7 +270,7 @@
*/
public static nsIDOMNode getSelectedNode(nsISelection selection) {
- if (selection.getIsCollapsed()) {
+ if (selection.getFocusNode() == selection.getAnchorNode()) {
if (selection.getFocusNode() != null) {
if ((selection.getFocusNode().getNodeType() != nsIDOMNode.TEXT_NODE)
&& (selection.getFocusOffset() != 0)) {
17 years, 11 months
JBoss Tools SVN: r8181 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-05-19 11:18:31 -0400 (Mon, 19 May 2008)
New Revision: 8181
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
Log:
License text added.
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
import java.io.File;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
import junit.framework.TestCase;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
import org.eclipse.core.resources.IContainer;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.seam.ui.test.wizard;
import org.eclipse.core.resources.IContainer;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
public class Seam20EARNewOperationTest extends Seam12EARNewOperationTest {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java 2008-05-19 15:18:31 UTC (rev 8181)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
public class Seam20WARNewOperationTest extends Seam12WARNewOperationTest {
17 years, 11 months
JBoss Tools SVN: r8180 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-19 10:30:08 -0400 (Mon, 19 May 2008)
New Revision: 8180
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2004
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-05-19 12:00:50 UTC (rev 8179)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-05-19 14:30:08 UTC (rev 8180)
@@ -1,5 +1,8 @@
package org.jboss.tools.seam.ui.test.wizard;
public class Seam20EARNewOperationTest extends Seam12EARNewOperationTest {
-
+ @Override
+ void setUpSeamProjects() {
+ setUpSeamProject(earProject, AbstractSeamNewOperationTest.SEAM_1_2);
+ }
}
17 years, 11 months
JBoss Tools SVN: r8179 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-19 08:00:50 -0400 (Mon, 19 May 2008)
New Revision: 8179
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2004
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-05-19 11:04:02 UTC (rev 8178)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-05-19 12:00:50 UTC (rev 8179)
@@ -14,7 +14,7 @@
private static final String SEAM_EAR_PROJECTNAME = "seam_ear";
private static final String SEAM_EAR_EJB_PROJECTNAME = "seam_ear-ejb";
private static final String SEAM_EAR_TEST_PROJECTNAME = "seam_ear-test";
- private IProject earProject = null;
+ protected IProject earProject = null;
private IProject earEjbProject = null;
private IProject testProject = null;
private ISeamProject seamEarProject = null;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-05-19 11:04:02 UTC (rev 8178)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-05-19 12:00:50 UTC (rev 8179)
@@ -13,7 +13,7 @@
public class Seam12WARNewOperationTest extends AbstractSeamNewOperationTest {
private static final String SEAM_WAR_PROJECTNAME = "seam_war";
private static final String SEAM_WAR_TEST_PROJECTNAME = "seam_war-test";
- private IProject warProject = null;
+ protected IProject warProject = null;
private IProject testProject = null;
private ISeamProject seamWarProject = null;
private ISeamProject seamTestProject = null;
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-05-19 12:00:50 UTC (rev 8179)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.ui.test.wizard;
+
+public class Seam20EARNewOperationTest extends Seam12EARNewOperationTest {
+
+}
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java 2008-05-19 12:00:50 UTC (rev 8179)
@@ -0,0 +1,8 @@
+package org.jboss.tools.seam.ui.test.wizard;
+
+public class Seam20WARNewOperationTest extends Seam12WARNewOperationTest {
+ @Override
+ void setUpSeamProjects() {
+ setUpSeamProject(warProject, AbstractSeamNewOperationTest.SEAM_2_0);
+ }
+}
17 years, 11 months
JBoss Tools SVN: r8178 - branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-19 07:04:02 -0400 (Mon, 19 May 2008)
New Revision: 8178
Modified:
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2218
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-05-19 11:00:11 UTC (rev 8177)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-05-19 11:04:02 UTC (rev 8178)
@@ -147,6 +147,8 @@
}
public IWorkbenchWindow getWorkbenchWindow() {
+ if(getMultiPageEditor().getSite() == null) // fix JBIDE-2218
+ return null; // fix JBIDE-2218
return getMultiPageEditor().getSite().getWorkbenchWindow();
}
17 years, 11 months
JBoss Tools SVN: r8177 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-19 07:00:11 -0400 (Mon, 19 May 2008)
New Revision: 8177
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2218
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-05-19 10:37:33 UTC (rev 8176)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-05-19 11:00:11 UTC (rev 8177)
@@ -147,6 +147,8 @@
}
public IWorkbenchWindow getWorkbenchWindow() {
+ if(getMultiPageEditor().getSite() == null) // fix JBIDE-2218
+ return null; // fix JBIDE-2218
return getMultiPageEditor().getSite().getWorkbenchWindow();
}
17 years, 11 months
JBoss Tools SVN: r8176 - in trunk/ws/plugins: org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-05-19 06:37:33 -0400 (Mon, 19 May 2008)
New Revision: 8176
Added:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/WSDLPropertyReader.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWebService.java
Log:
JBIDE-2200: generate implmentation skeleton class for every port type interface
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-05-19 10:37:33 UTC (rev 8176)
@@ -22,7 +22,9 @@
org.eclipse.jst.j2ee,
org.eclipse.jst.j2ee.core,
org.eclipse.emf.common,
- org.eclipse.emf.ecore
+ org.eclipse.emf.ecore,
+ org.eclipse.jdt.core,
+ org.eclipse.jface.text
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.ws.creation.core,
org.jboss.tools.ws.creation.core.commands,
Added: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -0,0 +1,506 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import java.io.File;
+import java.io.StringBufferInputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.ArrayType;
+import org.eclipse.jdt.core.dom.Assignment;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldAccess;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.Initializer;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.NumberLiteral;
+import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.ReturnStatement;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.StringLiteral;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.TypeLiteral;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.WildcardType;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+public class ImplementationClassCreationCommand extends
+ AbstractDataModelOperation {
+
+ protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ protected static final String TAB = "\t"; //$NON-NLS-1$
+ protected static final String SPACE = " "; //$NON-NLS-1$
+ protected static final String DOT = "."; //$NON-NLS-1$
+ protected static final String COMMA = ","; //$NON-NLS-1$
+ protected static final String SEMICOLON = ";"; //$NON-NLS-1$
+ protected static final String POUND = "#"; //$NON-NLS-1$
+ protected static final String OPEN_PAR = "("; //$NON-NLS-1$
+ protected static final String CLOSE_PAR = ")"; //$NON-NLS-1$
+ protected static final String OPEN_BRA = "{"; //$NON-NLS-1$
+ protected static final String CLOSE_BRA = "}"; //$NON-NLS-1$
+ protected static final String lineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$
+
+ protected static final String JAVA_LANG_OBJECT = "java.lang.Object"; //$NON-NLS-1$
+ protected static final String PACKAGE = "package "; //$NON-NLS-1$
+ protected static final String CLASS = "class "; //$NON-NLS-1$
+ protected static final String IMPORT = "import "; //$NON-NLS-1$
+ protected static final String EXTENDS = "extends "; //$NON-NLS-1$
+ protected static final String IMPLEMENTS = "implements "; //$NON-NLS-1$
+ protected static final String THROWS = "throws "; //$NON-NLS-1$
+ protected static final String SUPER = "super"; //$NON-NLS-1$
+ protected static final String PUBLIC = "public "; //$NON-NLS-1$
+ protected static final String PROTECTED = "protected "; //$NON-NLS-1$
+ protected static final String PRIVATE = "private "; //$NON-NLS-1$
+ protected static final String STATIC = "static "; //$NON-NLS-1$
+ protected static final String ABSTRACT = "abstract "; //$NON-NLS-1$
+ protected static final String FINAL = "final "; //$NON-NLS-1$
+ protected static final String VOID = "void"; //$NON-NLS-1$
+ protected static final String INT = "int"; //$NON-NLS-1$
+ protected static final String BOOLEAN = "boolean"; //$NON-NLS-1$
+ protected static final String MAIN_METHOD = "\tpublic static void main(String[] args) {"; //$NON-NLS-1$
+ protected static final String TODO_COMMENT = "\t\t// TODO Auto-generated method stub"; //$NON-NLS-1$
+ protected static final String RETURN_NULL = "\t\treturn null;"; //$NON-NLS-1$
+ protected static final String RETURN_0 = "\t\treturn 0;"; //$NON-NLS-1$
+ protected static final String RETURN_FALSE = "\t\treturn false;"; //$NON-NLS-1$
+ protected static final String RESOURCE_FOLDER = "src";
+
+ protected static final String PREFIX_JAXWS_ANNOTATION_CLASS = "javax.jws";
+ protected static final String CLASS_LOGGER = "Logger";
+ protected static final String SUFFIX_PACKAGENAME_IMPL = "impl";
+ protected static final String DEFAULT_CU_SUFFIX = ".java";
+
+ private ServiceModel model;
+ private List<String> importStatements;
+ private IWorkspaceRoot fWorkspaceRoot;
+ private IJavaProject javaProject;
+
+ public ImplementationClassCreationCommand(ServiceModel model){
+ this.model = model;
+ fWorkspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
+
+ }
+
+
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+
+
+ IFile inFile = getServiceInterfaceFile(model.getPortTypes().get(0));
+
+ try {
+ //IFile implJavaFile = createEmptyImplJavaFile("Test");
+ //so far, it only generate implementation for first port type, neet to generate impl class for all
+ //port type interfaces
+ generateImplClass(model.getPortTypes().get(0));
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } catch (MalformedTreeException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return Status.OK_STATUS;
+ }
+
+ private String getImplPackageName(){
+ return model.getCustomPackage() + ".impl";
+ }
+
+ private IPackageFragmentRoot getPackageFragmentRoot(){
+ String str = model.getWebProjectName() + File.separator + RESOURCE_FOLDER;
+ IPath path= new Path(str);
+ IResource res= fWorkspaceRoot.findMember(path);
+ IProject prj = res.getProject();
+ IJavaProject javaPrj = JavaCore.create(prj);
+ return javaPrj.getPackageFragmentRoot(res);
+
+ }
+
+ private String getCompilationUnitName(String portTypeName){
+
+ return getImplClassName(portTypeName) + DEFAULT_CU_SUFFIX;
+ }
+
+
+ private String getImplClassName(String portTypeName){
+ String firstLetter = portTypeName.substring(0,1);
+ String implClsName = firstLetter.toUpperCase() + portTypeName.substring(1);
+ implClsName = implClsName + "Impl";
+ return implClsName;
+ }
+
+ /*private CompilationUnit createASTForImplementation(String portTypeName) throws JavaModelException {
+ IPackageFragmentRoot root= getPackageFragmentRoot();
+ IPackageFragment pack= root.getPackageFragment(getImplPackageName()); //$NON-NLS-1$
+
+ if (!pack.exists()) {
+ String packName= pack.getElementName();
+ pack= root.createPackageFragment(packName, true, null);
+ }
+
+ String cuName= getCompilationUnitName(portTypeName);
+ ICompilationUnit parentCU= pack.createCompilationUnit(cuName, "", false, null); //$NON-NLS-1$
+ // create a working copy with a new owner
+
+ boolean needsSave= true;
+ parentCU.becomeWorkingCopy(null); // cu is now a (primary) working copy
+
+
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setSource(parentCU);
+ parser.setResolveBindings(false);
+ parser.setFocalPosition(0);
+ return (CompilationUnit) parser.createAST(null);
+ }*/
+
+/* private IFile createEmptyImplJavaFile(String portTypeName) throws CoreException{
+
+
+ IFile inFile = getServiceInterfaceFile(portTypeName);
+ if(inFile != null && inFile.exists()){
+ IFolder implFolder = inFile.getParent().getFolder(new Path("impl"));
+ if(!implFolder.exists()){
+ implFolder.create(true, true, null);
+ }
+ IFile implJava = implFolder.getFile(model.getServiceNames().get(0) + ".java");
+ return implJava;
+ }
+ return null;
+ }*/
+
+ protected void generateImplClass(String portTypeName/*, IFile implJavaFile*/) throws CoreException, MalformedTreeException, BadLocationException{
+
+ CompilationUnit cu = getCompilationUnitForInterface(portTypeName);
+ Object obj = cu.imports();
+ List<ImportDeclaration> imports = getImportsWithoutJaxwsAnnotation(cu);
+
+ IPackageFragmentRoot root= getPackageFragmentRoot();
+ IPackageFragment pack= root.getPackageFragment(getImplPackageName()); //$NON-NLS-1$
+
+ if (!pack.exists()) {
+ String packName= pack.getElementName();
+ pack= root.createPackageFragment(packName, true, null);
+ }
+
+ String cuName= getCompilationUnitName(portTypeName);
+ ICompilationUnit parentCU= pack.createCompilationUnit(cuName, "", true, null); //$NON-NLS-1$
+ // create a working copy with a new owner
+
+ parentCU.becomeWorkingCopy(null); // cu is now a (primary) working copy
+
+
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setSource(parentCU);
+ parser.setResolveBindings(false);
+ parser.setFocalPosition(0);
+
+ CompilationUnit implCu = (CompilationUnit) parser.createAST(null);
+ AST ast = implCu.getAST();
+
+ //creation of a Document and ASTRewrite
+ String source = parentCU.getBuffer().getContents();
+ Document document = new Document(source);
+
+ ASTRewrite rewrite = ASTRewrite.create(implCu.getAST());
+ implCu.recordModifications();
+
+ //start to add content implementation class
+
+
+ //add package declaration for impl class:
+ PackageDeclaration implPackage = ast.newPackageDeclaration();
+ implPackage.setName(ast.newName(pack.getElementName()));
+ implCu.setPackage(implPackage);
+
+ //add imports for implementation class
+ for(ImportDeclaration id: imports){
+ ImportDeclaration newId = ast.newImportDeclaration();
+ newId.setName(ast.newName(id.getName().getFullyQualifiedName()));
+ implCu.imports().add(newId);
+ }
+
+ //import port type interface and jboss Logger
+ ImportDeclaration id = ast.newImportDeclaration();
+ QualifiedName portTypeImport = ast.newQualifiedName(ast.newName(cu
+ .getPackage().getName().getFullyQualifiedName()), ast
+ .newSimpleName(portTypeName));
+ id.setName(portTypeImport);
+ implCu.imports().add(id);
+ id = ast.newImportDeclaration();
+ id.setName(ast.newName("org.jboss.logging.Logger"));
+ implCu.imports().add(id);
+
+ //add class declaration
+ TypeDeclaration type = ast.newTypeDeclaration();
+ type.setInterface(false);
+ type.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
+ type.setName(ast.newSimpleName(getImplClassName(portTypeName)));
+ type.superInterfaceTypes().add(ast.newSimpleType(ast.newName(portTypeName)));
+
+ //add Logger variable declaration
+ //createLoggerField(ast, type);
+
+
+ //add method implementation
+ TypeDeclaration inTD = (TypeDeclaration)cu.types().get(0);
+ //firstly, get all methods that declared in Interface class and then add corresponding methods to
+ // the impl class
+ MethodDeclaration[] methods = inTD.getMethods();
+ for(int i = 0; i < methods.length; i++){
+ MethodDeclaration newMethod = createMethodForImplClass(ast, methods[i]);
+ type.bodyDeclarations().add(newMethod);
+ }
+
+
+ implCu.types().add(type);
+
+
+ //try to save the modification
+ TextEdit edits = implCu.rewrite(document, parentCU.getJavaProject().getOptions(true));
+ edits.apply(document);
+ String newSource = document.get();
+ parentCU.getBuffer().setContents(newSource);
+ parentCU.reconcile(ICompilationUnit.NO_AST, false, null, null);
+ parentCU.commitWorkingCopy(true, null);
+ parentCU.discardWorkingCopy();
+
+
+/* String content = implCu.toString();
+
+ if(implJavaFile.exists()){
+ implJavaFile.delete(true, null);
+ }
+
+ implJavaFile.create(new StringBufferInputStream(content), true, null);*/
+
+ }
+
+ protected FieldDeclaration createLoggerField(AST ast, TypeDeclaration type){
+ //for now, have no idea how to generate a field like:
+ // private static Logger log = Logger.getLooger(TestEdnpointImpl.class);
+ //TODO
+
+ VariableDeclarationFragment vdf = ast.newVariableDeclarationFragment();
+ vdf.setName(ast.newSimpleName("log"));
+ Initializer clsAccesss = ast.newInitializer();
+ Block clsAccessBlk = ast.newBlock();
+ FieldAccess fa = ast.newFieldAccess();
+ fa.setExpression(ast.newSimpleName("Test"));
+ fa.setName(ast.newSimpleName("class"));
+ clsAccessBlk.statements().add(ast.newExpressionStatement(fa));
+ clsAccesss.setBody(clsAccessBlk);
+ MethodInvocation mi = ast.newMethodInvocation();
+ mi.setExpression(ast.newSimpleName("Logger"));
+ mi.setName(ast.newSimpleName("getLogger"));
+ mi.arguments().add(fa);
+ vdf.setInitializer(mi);
+
+ type.bodyDeclarations().add(vdf);
+
+ /*SingleVariableDeclaration svd = ast.newSingleVariableDeclaration();
+ svd.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
+ svd.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
+ svd.setType(ast.newSimpleType(ast.newSimpleName(CLASS_LOGGER)));
+ svd.setName(ast.newSimpleName("log"));
+ Initializer initializer = ast.newInitializer();
+ Block initBlock = ast.newBlock();
+
+ MethodInvocation mi = ast.newMethodInvocation();
+ mi.setExpression(ast.newName("Logger"));
+ mi.setName(ast.newSimpleName("getLogger"));
+
+
+ MethodInvocation invokCls = ast.newMethodInvocation();
+ invokCls.setExpression((ast.newSimpleName("TestImpl"));
+ invokCls.setName(ast.newSimpleName("class"));
+ mi.arguments().add(invokCls.getExpression();
+ svd.setInitializer(ast.newExpressionStatement(mi).getExpression());*/
+ return null;
+ }
+
+ protected MethodDeclaration createMethodForImplClass(AST ast, MethodDeclaration inMethod){
+
+ MethodDeclaration md = ast.newMethodDeclaration();
+ md.setConstructor(false);
+ List modifiers = md.modifiers();
+ modifiers.add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
+ md.setName(ast.newSimpleName(inMethod.getName().getFullyQualifiedName()));
+
+ SimpleType sType = (SimpleType)inMethod.getReturnType2();
+ Name sTypeName = sType.getName();
+ md.setReturnType2(ast.newSimpleType(ast.newName(sTypeName.getFullyQualifiedName())));
+
+ List parameters = inMethod.parameters();;
+ for(Object obj: parameters){
+ SingleVariableDeclaration implSvd = ast.newSingleVariableDeclaration();
+ SingleVariableDeclaration svd = (SingleVariableDeclaration)obj;
+ implSvd.setName(ast.newSimpleName(svd.getName().getFullyQualifiedName()));
+ implSvd.setType(copyTypeFromOtherASTNode(ast, svd.getType()));
+ md.parameters().add(implSvd);
+ }
+
+ //create method body
+ Block block = ast.newBlock();
+ Type returnType = inMethod.getReturnType2();
+ ReturnStatement rs = ast.newReturnStatement();
+ String typeName = ((SimpleType)returnType).getName().getFullyQualifiedName();
+ if(returnType.isPrimitiveType() && returnType.isSimpleType()){
+ NumberLiteral nl = ast.newNumberLiteral();
+ nl.setToken("0");
+ rs.setExpression(nl);
+
+ }else if("String".equals(typeName)){
+ StringLiteral sl = ast.newStringLiteral();
+ sl.setLiteralValue("");
+ rs.setExpression(sl);
+
+ }else{
+ rs.setExpression(ast.newNullLiteral());
+ }
+ block.statements().add(rs);
+
+ md.setBody(block);
+
+ return md;
+ }
+
+ protected Name copyQualifiedName(AST ast, QualifiedName qname){
+ String fullQName = qname.getFullyQualifiedName();
+ StringTokenizer st = new StringTokenizer(fullQName,".");
+ Name copy = null;
+ SimpleName sn = ast.newSimpleName(st.nextToken());
+ while(st.hasMoreTokens()){
+ SimpleName snNext = ast.newSimpleName(st.nextToken());
+ if(copy == null){
+ copy = ast.newQualifiedName(sn, snNext);
+ }else{
+ //copy = ast.newn)
+ }
+ }
+
+ return null;
+ }
+
+ private Type copyTypeFromOtherASTNode(AST ast, Type type){
+ if(type instanceof PrimitiveType){
+ return ast.newPrimitiveType(((PrimitiveType)type).getPrimitiveTypeCode());
+ }
+ else if(type instanceof SimpleType){
+ SimpleType simpleType = (SimpleType)type;
+
+ return ast.newSimpleType(ast.newName(simpleType.getName().getFullyQualifiedName()));
+ }
+ else if(type instanceof ArrayType){
+ ArrayType atype = (ArrayType)type;
+ return ast.newArrayType(copyTypeFromOtherASTNode(ast, atype.getComponentType()));
+ }
+ else if(type instanceof ParameterizedType){
+ ParameterizedType ptype = (ParameterizedType)type;
+ ast.newParameterizedType(copyTypeFromOtherASTNode(ast, ptype.getType()));
+ }
+ else if(type instanceof WildcardType){
+ WildcardType sourcetype = (WildcardType)type;
+ WildcardType wtype = ast.newWildcardType();
+ wtype.setBound(sourcetype.getBound());
+ return wtype;
+ }
+
+ return null;
+ }
+ protected List<ImportDeclaration> getImportsWithoutJaxwsAnnotation(CompilationUnit cu){
+ List<ImportDeclaration> importList = new ArrayList<ImportDeclaration>();
+ List imports = cu.imports();
+ for(Object obj: imports){
+ ImportDeclaration id = (ImportDeclaration)obj;
+ String imClsName = id.getName().getFullyQualifiedName();
+ if(!imClsName.startsWith(PREFIX_JAXWS_ANNOTATION_CLASS)){
+ importList.add(id);
+ }
+ }
+
+ return importList;
+ }
+
+ private CompilationUnit getCompilationUnitForInterface(String portTypeName){
+ IFile inFile = getServiceInterfaceFile(portTypeName);
+ IJavaElement inSrc = JavaCore.create(inFile);
+ ICompilationUnit icu = JBossWSCreationUtils.getJavaUnitFromFile(inFile);
+ ASTParser astp = ASTParser.newParser(AST.JLS3);
+ astp.setSource(icu);
+
+ CompilationUnit cu = (CompilationUnit)astp.createAST(null);
+
+ return cu;
+ }
+
+ private IFile getServiceInterfaceFile(String portTypeName){
+ String packageName = model.getCustomPackage();
+ IProject project = JBossWSCreationUtils.getProjectByName(model.getWebProjectName());
+ IFolder pkgFolder = getPackageFolder();
+ IFile inFile = pkgFolder.getFile(portTypeName + ".java");
+ return inFile;
+ }
+
+
+ private IFolder getPackageFolder(){
+ IProject project = JBossWSCreationUtils.getProjectByName(model.getWebProjectName());
+ IFolder srcFolder = project.getFolder(RESOURCE_FOLDER);
+ String pkgFolderName = model.getCustomPackage().replace(".", File.separator);
+ return srcFolder.getFolder(pkgFolderName);
+
+ }
+
+
+
+
+
+}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -44,6 +44,9 @@
WSDLPropertyReader reader = new WSDLPropertyReader();
reader.readWSDL(ws.getWebServiceInfo().getWsdlURL());
model.setCustomPackage(reader.packageFromTargetNamespace());
+ model.setServiceList(reader.getServiceList());
+ model.setPortTypeList(reader.getPortTypeList());
+
}catch (WSDLException e) {
return StatusUtils.errorStatus(e.getLocalizedMessage(), e);
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -18,6 +18,7 @@
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboss.tools.ws.core.JbossWSCorePlugin;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossStatusUtils;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
public class WSDL2JavaCommand extends AbstractDataModelOperation{
@@ -50,13 +51,14 @@
String str = input.readLine();
StringBuffer result = new StringBuffer();
while(str != null){
- System.out.println(str);
result.append(str).append("\t\r");
str = input.readLine();
}
- proc.waitFor();
- System.out.print(result);
+ int exitValue = proc.waitFor();
+ if(exitValue != 0){
+ return JBossStatusUtils.errorStatus(result.toString());
+ }
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -65,7 +67,7 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- SAXParserFactory spf = SAXParserFactory.newInstance();
+
refreshProject(model.getWebProjectName(), monitor);
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -9,10 +9,10 @@
private boolean serverStatus;
private String wsdlURI;
- private String portName;
- private String serviceName;
+ private List<String> portTypes;
+ private List<String> serviceName;
private String customPackage;
- private List<String> bindingFileLocation = new ArrayList<String>();
+ private List<String> bindingFileLocation;
private String catalog;
private String serviceClass;
private boolean isGenWSDL;
@@ -33,24 +33,37 @@
public void setCustomPackage(String packageText) {
this.customPackage = packageText;
}
- public String getPortName() {
- return portName;
+
+ public List<String> getPortTypes() {
+ if(portTypes == null){
+ portTypes = new ArrayList<String>();
+ }
+ return portTypes;
}
- public void setPortName(String portName) {
- this.portName = portName;
+ public void addPortTypes(String portType) {
+ this.getPortTypes().add(portType);
}
- public String getServiceName() {
+ public void setPortTypeList(List<String> portTypeList) {
+ this.portTypes = portTypeList;
+ }
+
+ public List<String> getServiceNames() {
return serviceName;
}
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
+ public void addServiceName(String serviceName) {
+ this.getServiceNames().add(serviceName);
}
+ public void setServiceList(List<String> serviceList) {
+ this.serviceName = serviceList;
+ }
+
public String getWsdlURI() {
return wsdlURI;
}
public void setWsdlURI(String wsdlURI) {
this.wsdlURI = wsdlURI;
}
+
public boolean getServerStatus() {
return serverStatus;
}
@@ -66,6 +79,9 @@
}
public List<String> getBindingFiles(){
+ if(bindingFileLocation == null){
+ bindingFileLocation = new ArrayList<String>();
+ }
return this.bindingFileLocation;
}
public void addBindingFile(String bindingFileLocation){
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -26,9 +26,18 @@
import java.util.Arrays;
import java.util.Locale;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IParent;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jst.ws.internal.common.J2EEUtils;
public class JBossWSCreationUtils {
@@ -115,7 +124,6 @@
}
- //Fix for the windows build not working
private static String replaceEscapecharactors(String vulnarableString){
if (vulnarableString.indexOf("/")!=-1){
vulnarableString = vulnarableString.replace('/', File.separator.charAt(0));
@@ -162,7 +170,94 @@
return parts[parts.length-1];
}
+ // JDT utils
+ /**
+ * get JavaProject object from project name
+ */
+ public static IJavaProject getJavaProjectByName(String projectName) throws JavaModelException {
+
+ IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
+ model.open(null);
+
+ IJavaProject[] projects = model.getJavaProjects();
+
+ for (IJavaProject proj : projects) {
+ if (proj.getProject().getName().equals(projectName)) {
+ return proj;
+ }
+ }
+
+ return null;
+ }
+ public static ICompilationUnit findUnitByFileName(IJavaElement javaElem,
+ String filePath) throws Exception {
+ ICompilationUnit unit = null;
+
+ if (!javaElem.getOpenable().isOpen()) {
+ javaElem.getOpenable().open(null);
+ }
+
+ IJavaElement[] elems = null;
+
+ if (javaElem instanceof IParent) {
+ IParent parent = (IParent) javaElem;
+ elems = parent.getChildren();
+ }
+
+ if (elems == null) {
+ return null;
+ }
+
+ for (IJavaElement elem : elems) {
+ if (elem.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT) {
+ IPackageFragmentRoot root = (IPackageFragmentRoot) elem;
+
+ if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
+ unit = findUnitByFileName(elem, filePath);
+
+ if (unit != null) {
+ return unit;
+ }
+ }
+ } else if ((elem.getElementType() == IJavaElement.PACKAGE_FRAGMENT)
+ || (elem.getElementType() == IJavaElement.JAVA_PROJECT)) {
+ unit = findUnitByFileName(elem, filePath);
+
+ if (unit != null) {
+ return unit;
+ }
+ } else if (elem.getElementType() == IJavaElement.COMPILATION_UNIT) {
+ ICompilationUnit compUnit = (ICompilationUnit) elem;
+
+ if (compUnit.getPath().toString().equals(filePath)) {
+ compUnit.open(null);
+
+ return compUnit;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * get Java compilation unit by file path
+ * @param javaFile the java sour file to look
+ * @return ICompilationUnit, JDK compilation unit for this java file.
+ */
+ public static ICompilationUnit getJavaUnitFromFile(IFile javaFile) {
+ try {
+ IJavaProject project = getJavaProjectByName(javaFile.getProject().getName());
+
+ if (project == null) {
+ return null;
+ }
+
+ return findUnitByFileName(project, javaFile.getFullPath().toString());
+ } catch (Exception e) {
+ return null;
+ }
+ }
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/WSDLPropertyReader.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/WSDLPropertyReader.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/WSDLPropertyReader.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -30,20 +30,17 @@
import javax.wsdl.Definition;
import javax.wsdl.Port;
+import javax.wsdl.PortType;
import javax.wsdl.Service;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-
public class WSDLPropertyReader {
private Definition definition = null;
@@ -166,13 +163,13 @@
/**
- * Returns a list of service names the names are QNames
+ * Returns a list of service names the names are local parts
*
* @return
*/
- public List<QName> getServiceList() {
+ public List<String> getServiceList() {
- List<QName> returnList = new ArrayList<QName>();
+ List<String> returnList = new ArrayList<String>();
Service service;
Map serviceMap = definition.getServices();
@@ -182,12 +179,35 @@
while (serviceIterator.hasNext()) {
service = (Service) serviceIterator.next();
- returnList.add(service.getQName());
+ returnList.add(service.getQName().getLocalPart());
}
}
return returnList;
}
+
+ /**
+ * Returns a list of service names the names are local parts
+ *
+ * @return
+ */
+ public List<String> getPortTypeList() {
+
+ List<String> returnList = new ArrayList<String>();
+ PortType portType;
+ Map portTypeMap = definition.getPortTypes();
+
+ if (portTypeMap != null && !portTypeMap.isEmpty()) {
+ Iterator<Service> portTypeIterator = portTypeMap.values().iterator();
+ while (portTypeIterator.hasNext()) {
+
+ portType = (PortType) portTypeIterator.next();
+ returnList.add(portType.getQName().getLocalPart());
+ }
+ }
+ return returnList;
+ }
+
/**
* Returns a list of ports for a particular service the names are QNames
*
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWebService.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWebService.java 2008-05-19 08:30:08 UTC (rev 8175)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/wsrt/JBossWebService.java 2008-05-19 10:37:33 UTC (rev 8176)
@@ -11,6 +11,7 @@
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
import org.jboss.tools.ws.creation.core.commands.BindingFilesValidationCommand;
+import org.jboss.tools.ws.creation.core.commands.ImplementationClassCreationCommand;
import org.jboss.tools.ws.creation.core.commands.InitialCommand;
import org.jboss.tools.ws.creation.core.commands.MergeWebXMLCommand;
import org.jboss.tools.ws.creation.core.commands.WSDL2JavaCommand;
@@ -49,6 +50,7 @@
commands.add(new InitialCommand(model, this, WebServiceScenario.TOPDOWN));
commands.add(new BindingFilesValidationCommand(model));
commands.add(new WSDL2JavaCommand(model));
+ commands.add(new ImplementationClassCreationCommand(model));
//commands.add(new JbossWSRuntimeCommand(ResourcesPlugin.getWorkspace().getRoot().getProject(project)));
}
else if (ctx.getScenario().getValue() == WebServiceScenario.BOTTOMUP){
17 years, 11 months
JBoss Tools SVN: r8175 - in trunk/struts/docs/struts_tools_tutorial/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-05-19 04:30:08 -0400 (Mon, 19 May 2008)
New Revision: 8175
Modified:
trunk/struts/docs/struts_tools_tutorial/en/master.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/coding_files.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/compiling_and_running.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/generating_stub.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-286 - correcting errors found by XML validator
Modified: trunk/struts/docs/struts_tools_tutorial/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/master.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/master.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -41,8 +41,8 @@
</copyright>
<releaseinfo>
-<para>Version: 2.1.0.CR1</para>
-</releaseinfo>
+ Version: 2.1.0.CR1
+ </releaseinfo>
</bookinfo>
<toc/>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/coding_files.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/coding_files.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/coding_files.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -14,7 +14,7 @@
placeholders from previous steps, and a new start JSP page we will have to create.</para>
<section id="JavaStubClasses">
<title>Java Stub Classes</title>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>To finish the two Java classes, switch to the <emphasis>
<property>Package Explorer</property>
@@ -25,7 +25,7 @@
</itemizedlist>
<section id="GetNameForm.java">
<title>GetNameForm.java</title>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Double-click <emphasis>
<property>GetNameForm.java</property>
@@ -45,7 +45,7 @@
private String greetName = "";
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Inside the reset method, delete the TO DO and throw lines and
add:</para>
@@ -55,7 +55,7 @@
this.greetName = "";
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Inside the validate method, delete the TO DO and throw lines and
add:</para>
@@ -65,7 +65,7 @@
return errors;
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Right-click and select <emphasis>
<property>Source > Generate Getters and Setters...</property>
@@ -128,7 +128,7 @@
}
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Save the file</para>
</listitem>
@@ -136,7 +136,7 @@
</section>
<section id="GreetingAction.java">
<title>GreetingAction.java</title>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Open GreetingAction.java for editing</para>
</listitem>
@@ -183,7 +183,7 @@
}
}
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Save the file</para>
</listitem>
@@ -202,7 +202,7 @@
<para>In this page, the user will enter any name and click the <emphasis>
<property>submit</property>
</emphasis> button. Then, the greeting action will be called through the form.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis>
<property>inputname.jsp</property>
@@ -225,11 +225,10 @@
</listitem>
<listitem>
<para>Then type this text on a new line just below this line:</para>
+ <programlisting role="XML"><![CDATA[Input name:
+ ]]></programlisting>
</listitem>
- <programlisting role="XML"><![CDATA[Input name:
-]]></programlisting>
-
<listitem>
<para>Select the <emphasis>
<property>Visual</property>
@@ -260,7 +259,7 @@
</imageobject>
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>In the Insert Tag dialog box, type in name for property and select <emphasis>
<property>Finish</property>
@@ -301,7 +300,7 @@
<section id="greeting.jsp">
<title>greeting.jsp</title>
<para>Next, we will fill in the result page.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis>
<property>greeting.jsp</property>
@@ -325,7 +324,7 @@
<para>To complete editing of this file, we will use macros from the JBoss Tools
Palette. This palette is a view that should be available to the right of the
editing area.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis>
<property>Struts Common</property>
@@ -341,7 +340,7 @@
<programlisting role="JAVA"><![CDATA[
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis>
<property>Struts Bean</property>
@@ -380,7 +379,7 @@
<title>index.jsp</title>
<para>Finally, we will need to create and edit an index.jsp page. This page will use
a Struts forward to simply redirect us to the getName global forward.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>In the Web Projects view, right-click on <emphasis>
<property>StrutsHello > WEB-ROOT(WebContent)</property>
@@ -424,7 +423,7 @@
<programlisting role="JAVA"><![CDATA[<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<logic:redirect forward="getName"/>
]]></programlisting>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>To save all the edits to files, select <emphasis>
<property>File>Save All</property>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/compiling_and_running.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/compiling_and_running.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/compiling_and_running.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -26,7 +26,7 @@
</imageobject>
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Start up JBoss AS by clicking on the icon in JBoss Server view. (If JBoss AS
is already running, stop it by clicking on the red icon and then start it again.
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/generating_stub.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/generating_stub.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/generating_stub.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -15,7 +15,7 @@
<property>/greeting</property>
</emphasis> mapping along with a FormBean. To aid in the coding phase, JBoss Developer
Studio can generate Java class stubs for all of the components shown in the diagram.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Switch back to the diagram, by selecting the <emphasis>
<property>Diagram</property>
@@ -36,7 +36,7 @@
<para>Generated classes: 2</para>
<para>Actions: 1</para>
<para>Form beans: 1</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click <emphasis>
<property>Finish</property>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -64,7 +64,7 @@
</itemizedlist>
<para>A "StrutsHello" node should appear in the upper-left Package
Explorer view.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click the plus sign next to <emphasis>
<property>StrutsHello</property>
@@ -103,7 +103,7 @@
them in the diagram. We will write the code a little bit later.</para>
<section id="CreatingthePagePlaceholders">
<title>Creating the Page Placeholders</title>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Bring the Web Projects view to the front of the Package Explorer view
by selecting the <emphasis>
@@ -163,7 +163,7 @@
<section id="PlacingthePagePlaceholders">
<title>Placing the Page Placeholders</title>
<para>Lets now place the two pages just created on the diagram.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis>
<property>struts-config.xml</property>
@@ -176,12 +176,12 @@
</emphasis> page in the Web Projects view, drag it onto the diagram, and
drop it</para>
</listitem>
- <listitem>Click on the <emphasis>
+ <listitem><para>Click on the <emphasis>
<property>greeting.jsp</property>
</emphasis> page in the Web Projects view, drag it onto the diagram, and
drop it to the right of the <emphasis>
<property>/pages/inputname.jsp</property>
- </emphasis> icon with some extra space</listitem>
+ </emphasis> icon with some extra space</para></listitem>
</itemizedlist>
<para>You should now have two JSP pages in the diagram.</para>
</section>
@@ -190,7 +190,7 @@
<title>Creating an Action Mappings</title>
<para>Using a context menu on the diagram, we are next going to create an Action
mapping.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Right-click between the two icons and select <emphasis>
<property>Add > Action</property>
@@ -201,6 +201,7 @@
</listitem>
</itemizedlist>
<table>
+ <title>Action values</title>
<tgroup cols="2">
<tbody>
<row>
@@ -228,7 +229,7 @@
</table>
<para>("GetNameForm" is the name for a form bean that we will create
later.)</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click <emphasis>
<property>Finish</property>
@@ -247,7 +248,7 @@
<section id="CreatingaLink">
<title>Creating a Link</title>
<para>Let's now create a link from the inputname.jsp page to the action.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>On the left-hand side of the diagram in the column of icons, click on this
icon:</para>
@@ -261,7 +262,7 @@
</imageobject>
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>In the connect-the-components mode you are in now, click on the <emphasis>
<property>/pages/inputname.jsp</property>
@@ -275,7 +276,7 @@
<section id="CreatingaForward">
<title>Creating a Forward</title>
<para>Next, we are going to create a forward for the action.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>On the left-hand side of the diagram in the column of icons, click on this
icon, again:</para>
@@ -289,7 +290,8 @@
</imageobject>
</mediaobject>
</figure>
- <itemizedlist continuation="continues">> <listitem>
+ <itemizedlist>
+ <listitem>
<para>Click on the <emphasis>
<property>/greeting</property>
</emphasis> action icon in the diagram and then click on the <emphasis>
@@ -328,7 +330,7 @@
<section id="CreatingaGlobalForward">
<title>Creating a Global Forward</title>
<para>One last component that we need to create in the diagram is a global forward.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Somewhere in the top-left corner of diagram, right-click and select <emphasis>
<property> Add > Global Forward...</property>
@@ -367,7 +369,7 @@
</itemizedlist>
<para>A forward object now appears on the diagram and also in the global-forwards folder
in the Outline view.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Tidy up the diagram, by clicking and dragging around each icon, so that
the diagram looks something like this:</para>
@@ -385,7 +387,7 @@
<section id="CreatingaFormBean">
<title>Creating a Form Bean</title>
<para>One last thing that we need to do is to create a form bean.</para>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Switch to the Tree viewer in the editor for the struts-config.xml file, by
selecting the <emphasis>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2008-05-19 08:28:50 UTC (rev 8174)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2008-05-19 08:30:08 UTC (rev 8175)
@@ -86,7 +86,7 @@
<title>Client-Side Validation</title>
<para>Client-side <property>validation</property> uses a scripting language (like JavaScript) running in the client browser to actually do the <property>validation</property>. In a Struts application using the <property>Validation</property> Framework, however, you don't actually have to do any of the script coding. The <property>Validation</property> Framework handles this.</para>
<para>To see how this works in our application, you'll just need to make a couple of modifications to one of the JSP files.</para>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>Double-click inputname.jsp under <emphasis><property>StrutsHello > WEB-ROOT(WebContent) > pages</property></emphasis> to open it for editing</para></listitem>
<listitem><para>Find the tag near the top and hit Return to make a new line under it</para></listitem>
<listitem><para>In the JBoss Tools Palette view to the right, open the Struts HTML folder and click on the javascript tag</para></listitem>
@@ -123,7 +123,7 @@
</body>
</html:html>
]]></programlisting>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>Select<emphasis><property> File > Save </property></emphasis>from the menu bar</para></listitem>
<listitem><para>Start JBoss Application Server by clicking on its icon (a right-pointing arrow) in the toolbar</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>
@@ -148,7 +148,7 @@
<section id="EditingTheJSPFile">
<?dbhtml filename="EditingTheJSPFile.html"?>
<title>Editing the JSP File</title>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>Reopen inputname.jsp for editing</para></listitem>
<listitem><para>Delete the <emphasis role="italic"><property>"onsubmit"</property></emphasis> attribute in the <emphasis role="bold"><property><html:form></property></emphasis> element that you put in for client-side validation</para></listitem>
@@ -186,7 +186,7 @@
<section id="EditingTheAction">
<?dbhtml filename="EditingTheAction.html"?>
<title>Editing the Action</title>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>In the Web Projects view, expand the node under the <emphasis><property>StrutsHello > Configuration > default > struts-config.xml > action-mappings</property></emphasis> node, right-click the <emphasis><property>/greeting</property></emphasis> action, and then select <emphasis><property>Properties...</property></emphasis>from the context menu</para></listitem>
<listitem><para>In the Edit Properties window, insert the cursor into the value column for the input property and click on the <property>...</property> button</para></listitem>
@@ -198,7 +198,7 @@
<?dbhtml filename="EditingTheFormBean.html"?>
<title>Editing the Form Bean</title>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>Right-click the <emphasis><property>/greeting</property></emphasis> action again and select Open Form-bean Source to open the GetNameForm.java file for editing</para></listitem>
<listitem><para>Change the class that it extends from: <emphasis><property>org.apache.struts.action.ActionForm</property></emphasis> to <emphasis><property>org.apache.struts.validator.ValidatorForm</property></emphasis></para></listitem>
<listitem><para>Comment out a validate method</para></listitem>
@@ -250,7 +250,7 @@
}
]]></programlisting>
-<itemizedlist continuation="continues">
+<itemizedlist>
<listitem><para>Select <emphasis><property>File > Save All </property></emphasis>from the menu bar</para></listitem>
<listitem><para>Reload the application into JBoss AS by clicking on the "Change Time Stamp" icon (a finger pointing with a little star) in the toolbar</para></listitem>
<listitem><para>Run the application</para></listitem>
17 years, 11 months
JBoss Tools SVN: r8174 - in trunk/struts/docs/struts_tools_ref_guide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-05-19 04:28:50 -0400 (Mon, 19 May 2008)
New Revision: 8174
Modified:
trunk/struts/docs/struts_tools_ref_guide/en/master.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-286 - correcting errors found by XML validator
Modified: trunk/struts/docs/struts_tools_ref_guide/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-05-19 08:28:37 UTC (rev 8173)
+++ trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-05-19 08:28:50 UTC (rev 8174)
@@ -42,7 +42,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- <para>Version: 2.1.0.CR1</para>
+ Version: 2.1.0.CR1
</releaseinfo>
</bookinfo>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2008-05-19 08:28:37 UTC (rev 8173)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2008-05-19 08:28:50 UTC (rev 8174)
@@ -184,11 +184,10 @@
</imageobject>
</mediaobject>
</figure>
+
+ <para>Find more information about editor features <ulink url="&jsflink;#editors_features"
+ >here</ulink>.</para>
</section>
-
- <para>Find more information about editor features <ulink url="&jsflink;#editors_features"
- >here</ulink>.</para>
-
</section>
<section id="GraphicalEditorForTilesFiles132">
17 years, 11 months
JBoss Tools SVN: r8173 - in trunk/seam/docs/reference/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-05-19 04:28:37 -0400 (Mon, 19 May 2008)
New Revision: 8173
Modified:
trunk/seam/docs/reference/en/master.xml
trunk/seam/docs/reference/en/modules/seam_preferences.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-286 - correcting errors found by XML validator
Modified: trunk/seam/docs/reference/en/master.xml
===================================================================
--- trunk/seam/docs/reference/en/master.xml 2008-05-17 06:22:49 UTC (rev 8172)
+++ trunk/seam/docs/reference/en/master.xml 2008-05-19 08:28:37 UTC (rev 8173)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../resources/support/docbook-dtd/docbookx.dtd"
+"http://www.oasis-open.org/docbook/xml/4.3CR3/docbookx.dtd"
[<!ENTITY intro SYSTEM "modules/intro.xml">
@@ -47,7 +47,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- <para>Version: 2.1.0.CR1</para>
+ Version: 2.1.0.CR1
</releaseinfo>
</bookinfo>
@@ -68,7 +68,5 @@
&crud_application_walkthrough;
&testng;
<!-- TODO: drools used in this section is not available for eclipse .3.3 &business_application; -->
-
-
-
+
</book>
Modified: trunk/seam/docs/reference/en/modules/seam_preferences.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_preferences.xml 2008-05-17 06:22:49 UTC (rev 8172)
+++ trunk/seam/docs/reference/en/modules/seam_preferences.xml 2008-05-19 08:28:37 UTC (rev 8173)
@@ -16,7 +16,7 @@
<section id="gen_pref">
<title>General Preferences</title>
-<para>Seam preferences can be set using the Seam preference page. Click on <property><emphasis>Window > Preferences > JBoss Tools > Web > Seam</emphasis>.</property></para>
+ <para>Seam preferences can be set using the Seam preference page. Click on <emphasis><property>Window > Preferences > JBoss Tools > Web > Seam</property>.</emphasis></para>
<para>On this page you can manage the Seam Runtime. Use the appropriate buttons to <property>Add</property> more runtimes or to <property>Remove</property> those that are not needed.</para>
@@ -46,7 +46,7 @@
<title>Validator Preferences</title>
<para>Seam preference page includes a subsection <property>Validator</property>.
- See <property><emphasis>Window > Preferences > JBoss Tools > Web > Seam > Validator</emphasis>.</property></para>
+ See <emphasis><property>Window > Preferences > JBoss Tools > Web > Seam > Validator</property>.</emphasis></para>
<para>On this page you can choose a severity level for the various Seam validator problems. For example, if you want to ignore the case when component
name is duplicated expand the <property>Components</property> node and select <property>Ignore</property> next to <property>Duplicate component name</property>.
After that you won't see the error.</para>
17 years, 11 months