JBoss Tools SVN: r11883 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-19 12:30:03 -0500 (Wed, 19 Nov 2008)
New Revision: 11883
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
Log:
junit for JBIDE-3144, JBIDE-3214
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml 2008-11-19 17:30:03 UTC (rev 11883)
@@ -0,0 +1,23 @@
+<!1DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="#{request.contextPath}/layout/template.xhtml">
+<ui:define name="body">
+<div id="body_test">
+<rich:dataTable style="#{test.dataTablecolor}">
+ <rich:column style="#{test.columnColor}">#{test.color}</rich:column>
+</rich:dataTable>
+<rich:scrollableDataTable style="#{test.scrolable}" width="100px;" height="100px;" >
+ <rich:columns style="#{test.columnsColor}"> </rich:columns>
+</rich:scrollableDataTable>
+<rich:dataGrid style="#{test.richDataGrid}">
+ssssssssss
+</rich:dataGrid>
+</div>
+</ui:define>
+<ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml 2008-11-19 17:30:03 UTC (rev 11883)
@@ -0,0 +1,86 @@
+<tests>
+ <test id="body_test">
+ <DIV ID="body_test" STYLE="-moz-user-modify: read-write;">
+ <TABLE STYLE="background-color: red;" CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: green;" CLASS="dr-table-cell rich-table-cell">
+ <SPAN>
+ #{test.color}
+</SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ <TABLE>
+ <TR>
+ <TD>
+ <DIV CLASS="dr-table-hidden" STYLE="width: 100px; height: 100px;">
+ <TABLE WIDTH="100" STYLE="background-color: blue;" CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TBODY>
+ </TBODY>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);" CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);" CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);" CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);" CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD STYLE="background-color: rgb(160, 32, 240);" CLASS="dr-table-cell rich-table-cell">
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ <TD>
+ <DIV STYLE="overflow: scroll; width: 17px; height: 100%;">
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <DIV STYLE="overflow: scroll; width: 100%; height: 17px;">
+ </DIV>
+ <BR _MOZ_DIRTY="" TYPE="_moz"></BR>
+
+ </TD>
+ </TR>
+ </TABLE>
+ <TABLE STYLE="background-color: pink;" CLASS="dr-table rich-table" >
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TBODY>
+ </TBODY>
+ <SPAN>
+ ssssssssss
+</SPAN>
+ </TABLE>
+ </DIV>
+ </test>
+</tests>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml 2008-11-19 17:30:03 UTC (rev 11883)
@@ -0,0 +1,24 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="./layout/template.xhtml">
+
+<ui:define name="body">
+ <h:form id="test_el">
+ <f:loadBundle basename="demo.resources" var="msg" />
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel style="#{test.color} ">123456789 #{test.scope} #{test.scope} #{test.scope}
+ <div style="width : 109px; height : 106px; background-color:green;"></div>
+ <h:outputText value="#{msg.hello_message}" />
+ #{msg.prompt_message} #{test.scope}
+ </rich:panel>
+ </h:form>
+</ui:define>
+</ui:composition>
+
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2008-11-19 17:30:03 UTC (rev 11883)
@@ -0,0 +1,29 @@
+<tests>
+ <test id="test_el">
+<DIV
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%; display: table;">
+ <SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+ Error Messages
+</SPAN>
+ <DIV CLASS="dr-pnl rich-panel" STYLE="">
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <SPAN>
+ 123456789 Test El expression Test El expression Test El expression
+</SPAN>
+ <DIV
+ STYLE="width: 109px; height: 106px; background-color: green; -moz-user-modify: read-write;">
+ <BR VPE:PSEUDO-ELEMENT="yes"
+ STYLE="font-style: italic; color: green; -moz-user-modify: read-only;">
+ </BR>
+ </DIV>
+ <SPAN>
+ Hello
+</SPAN>
+ <SPAN>
+ Name: Test El expression
+</SPAN>
+ </DIV>
+ </DIV>
+</DIV>
+</test>
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-19 15:56:15 UTC (rev 11882)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-19 17:30:03 UTC (rev 11883)
@@ -20,14 +20,14 @@
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
/**
* @author mareshkau
*
*/
-public class JBIDE3144Test extends VpeTest{
+public class JBIDE3144Test extends ComponentContentTest{
/**
* Test Page
@@ -37,6 +37,7 @@
/* (non-Javadoc)
* @see org.jboss.tools.vpe.ui.test.VpeTest#setUp()
*/
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -45,6 +46,13 @@
JsfAllTests.IMPORT_PROJECT_NAME);
elValuesMap = new HashMap<String, String>();
elValuesMap.put("request.contextPath", "./"); //$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.dataTablecolor", "background-color:red;"); //$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.columnColor", "background-color:green;"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ elValuesMap.put("test.columnsColor", "background-color:#A020F0;"); //$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.scrolable", "background-color:blue;"); //$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.richDataGrid", "background-color:pink;"); //$NON-NLS-1$ //$NON-NLS-2$
+ elValuesMap.put("test.scope", "Test El expression"); //$NON-NLS-1$//$NON-NLS-2$
ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
int i = 0;
for (Entry<String, String> string : elValuesMap.entrySet()) {
@@ -77,11 +85,16 @@
checkSourceSelection(part);
}
- public void testJBIDE3144EditingOfSimpleTextNodes() {
- fail("Implement test case");
+ public void testJBIDE3144Test2() throws Throwable {
+ performContentTest("JBIDE/3144/test.xhtml"); //$NON-NLS-1$
}
- public void testJBIDE3144EditingJSFElements() {
- fail("Implement test case");
+ public void testJBIDE3214() throws Throwable {
+ performContentTest("JBIDE/3144/jbide3214test.xhtml"); //$NON-NLS-1$
}
-}
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_PROJECT_NAME;
+ }
+ }
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNamedNodeMapInvocationHandler.java 2008-11-19 17:30:03 UTC (rev 11883)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.proxy;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeNamedNodeMapInvocationHandler implements InvocationHandler {
+
+ private NamedNodeMap namedNodeMap;
+ private VpePageContext pageContext;
+
+ /**
+ * @param node
+ */
+ public VpeNamedNodeMapInvocationHandler(VpePageContext pageContext,NamedNodeMap namedNodeMap) {
+ this.namedNodeMap = namedNodeMap;
+ this.pageContext = pageContext;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ Object result = method.invoke(namedNodeMap, args);
+ if(result instanceof Node) {
+ return VpeProxyUtil.createProxyForELExpressionNode(pageContext, (Node)result);
+ }
+ return result;
+ }
+
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-19 15:56:15 UTC (rev 11882)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2008-11-19 17:30:03 UTC (rev 11883)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.ResourceUtil;
import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -49,6 +50,8 @@
} else if(result instanceof Attr) {
result = VpeProxyUtil.createProxyForELExpressionNode(pageContext,
(Node)result);
+ } else if(result instanceof NamedNodeMap) {
+ result = VpeProxyUtil.createProxyForNamedNodeMap(pageContext, (NamedNodeMap)result);
}
return result;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java 2008-11-19 15:56:15 UTC (rev 11882)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeProxyUtil.java 2008-11-19 17:30:03 UTC (rev 11883)
@@ -16,6 +16,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -49,4 +50,13 @@
return proxy;
}
+
+ public static NamedNodeMap createProxyForNamedNodeMap(VpePageContext pageContext,
+ NamedNodeMap namedNodeMap) {
+ NamedNodeMap proxy =(NamedNodeMap)Proxy.newProxyInstance(NamedNodeMap.class.getClassLoader(),
+ new Class[] {NamedNodeMap.class},
+ new VpeNamedNodeMapInvocationHandler(pageContext,namedNodeMap));
+
+ return proxy;
+ }
}
17 years, 5 months
JBoss Tools SVN: r11882 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-19 10:56:15 -0500 (Wed, 19 Nov 2008)
New Revision: 11882
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/ViewIdsTree.java
Log:
Null pointer prevented.
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/ViewIdsTree.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/ViewIdsTree.java 2008-11-19 15:54:37 UTC (rev 11881)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/ViewIdsTree.java 2008-11-19 15:56:15 UTC (rev 11882)
@@ -25,7 +25,7 @@
XModelObject f = SeamPagesDiagramStructureHelper.getInstance().getParentFile(c);
pages = f.getChildByPath("Pages");
- XModelObject[] ps = pages.getChildren();
+ XModelObject[] ps = pages == null ? new XModelObject[0] : pages.getChildren();
pageMap = new TreeMap<String, XModelObject>();
17 years, 5 months
JBoss Tools SVN: r11881 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-11-19 10:54:37 -0500 (Wed, 19 Nov 2008)
New Revision: 11881
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3221
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-11-19 15:50:08 UTC (rev 11880)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2008-11-19 15:54:37 UTC (rev 11881)
@@ -265,19 +265,25 @@
/*
* Add indentation for nested groups
*/
- String[] ids = activeChildId.split(GROUP_COUNT_SEPARATOR);
+
List<nsIDOMElement> indentTds = new ArrayList<nsIDOMElement>();
- if (ids.length > 1) {
- for (int i = 1; i <= ids.length - 1; i++) {
- nsIDOMElement spacerTd = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- nsIDOMElement spacerImg = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
- spacerTd.appendChild(spacerImg);
- ComponentUtil.setImg(spacerImg, PANEL_MENU_GROUP_ICON_SPACER_PATH);
- setDefaultImgAttributes(spacerImg);
- tableBodyRow.appendChild(spacerTd);
- indentTds.add(spacerTd);
+
+ if (activeChildId != null) {
+ String[] ids = activeChildId.split(GROUP_COUNT_SEPARATOR);
+
+ if (ids.length > 1) {
+ for (int i = 1; i <= ids.length - 1; i++) {
+ nsIDOMElement spacerTd = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement spacerImg = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ spacerTd.appendChild(spacerImg);
+ ComponentUtil.setImg(spacerImg,
+ PANEL_MENU_GROUP_ICON_SPACER_PATH);
+ setDefaultImgAttributes(spacerImg);
+ tableBodyRow.appendChild(spacerTd);
+ indentTds.add(spacerTd);
+ }
}
}
@@ -503,7 +509,8 @@
boolean findOnlyPanelMenuParent) {
Element parent = (Element) sourceElement.getParentNode();
- while (true) {
+ while ((parent.getParentNode() != null)
+ && (parent.getParentNode().getNodeType() == Node.ELEMENT_NODE)) {
if (findOnlyPanelMenuParent) {
if ((parent!=null) && parent.getNodeName().endsWith(PANEL_MENU_END_TAG)) {
break;
17 years, 5 months
JBoss Tools SVN: r11880 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-11-19 10:50:08 -0500 (Wed, 19 Nov 2008)
New Revision: 11880
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3220
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-11-19 13:44:54 UTC (rev 11879)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2008-11-19 15:50:08 UTC (rev 11880)
@@ -544,7 +544,8 @@
private static final Element getItemParent(Element sourceItemElement,
boolean findOnlyPanelMenuParent) {
Element parent = (Element) sourceItemElement.getParentNode();
- while (true) {
+ while ((parent.getParentNode() != null)
+ && (parent.getParentNode().getNodeType() == Node.ELEMENT_NODE)) {
if (findOnlyPanelMenuParent) {
if (parent.getNodeName().endsWith(PANEL_MENU_END_TAG)) {
break;
17 years, 5 months
JBoss Tools SVN: r11879 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-19 08:44:54 -0500 (Wed, 19 Nov 2008)
New Revision: 11879
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
Log:
CODING IN PROGRESS - issue JBIDE-3026: Components with unworked <f:selectItem> nested tag.
https://jira.jboss.org/jira/browse/JBIDE-3026
Item #1 has been fixed: "<f:select Item> doesn't work inside next components:
<h:selectOneMenu>, <h:selectOneListbox>, <h:selectManyListbox>, <h:selectManyMenu>"
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-11-19 12:07:35 UTC (rev 11878)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-11-19 13:44:54 UTC (rev 11879)
@@ -66,9 +66,9 @@
.getAttribute(element, JSF.ATTR_ITEM_DISABLED));
nsIDOMElement option = visualDocument.createElement(HTML.TAG_OPTION);
- if (disabledItem)
-
+ if (disabledItem) {
option.setAttribute(HTML.ATTR_DISABLED, Constants.TRUE);
+ }
VpeCreationData creationData = new VpeCreationData(option);
if (attrPresents(disabled) && Constants.TRUE.equalsIgnoreCase(disabled)) {
@@ -198,10 +198,15 @@
@Override
public Attr getOutputAttributeNode(Element element) {
-
- if (element.hasAttribute(JSF.ATTR_ITEM_LABEL))
- return element.getAttributeNode(JSF.ATTR_ITEM_LABEL);
- return null;
+ Attr outputAttributeNode;
+
+ if (element.hasAttribute(JSF.ATTR_ITEM_LABEL)) {
+ outputAttributeNode = element.getAttributeNode(JSF.ATTR_ITEM_LABEL);
+ } else if (element.hasAttribute(JSF.ATTR_ITEM_VALUE)) {
+ outputAttributeNode = element.getAttributeNode(JSF.ATTR_ITEM_VALUE);
+ } else {
+ outputAttributeNode = null;
+ }
+ return outputAttributeNode;
}
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2008-11-19 12:07:35 UTC (rev 11878)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/JSF.java 2008-11-19 13:44:54 UTC (rev 11879)
@@ -34,6 +34,8 @@
public static final String ATTR_FOR = "for"; //$NON-NLS-1$
public static final String ATTR_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
+
+ public static final String ATTR_ITEM_VALUE = "itemValue"; //$NON-NLS-1$
public static final String ATTR_DISABLED = "disabled"; //$NON-NLS-1$
17 years, 5 months
JBoss Tools SVN: r11878 - in trunk/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-11-19 07:07:35 -0500 (Wed, 19 Nov 2008)
New Revision: 11878
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
added item "dump selected element" to context menu for debugging
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2008-11-19 07:02:59 UTC (rev 11877)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2008-11-19 12:07:35 UTC (rev 11878)
@@ -28,6 +28,7 @@
public static final boolean VISUAL_ADD_PSEUDO_ELEMENT;
public static final boolean VISUAL_CONTEXTMENU_DUMP_SOURCE;
+ public static final boolean VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT;
public static final boolean VISUAL_CONTEXTMENU_DUMP_MAPPING;
public static final boolean VISUAL_DUMP_PRINT_HASH;
@@ -53,6 +54,7 @@
VISUAL_ADD_PSEUDO_ELEMENT = "true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID + "/debug/visual/add_pseudo_element")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_CONTEXTMENU_DUMP_SOURCE = "true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID + "/debug/visual/contextmenu/dump_source")); //$NON-NLS-1$ //$NON-NLS-2$
+ VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT = "true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID + "/debug/visual/contextmenu/dump_selected_element")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_CONTEXTMENU_DUMP_MAPPING = "true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID + "/debug/visual/contextmenu/dump_mapping")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_DUMP_PRINT_HASH = "true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID + "/debug/visual/dump_print_hash")); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-19 07:02:59 UTC (rev 11877)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-19 12:07:35 UTC (rev 11878)
@@ -1626,7 +1626,25 @@
}
});
}
+
+ if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT) {
+ manager.add(new Action("Dump Selected Element") { //$NON-NLS-1$
+ public void run() {
+ VpeNodeMapping nodeMapping = SelectionUtil
+ .getNodeMappingBySourceSelection(
+ sourceEditor, domMapping);
+
+ if (nodeMapping != null) {
+
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.dumpNode(nodeMapping.getVisualNode());
+ }
+ }
+ });
+ }
+
if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_MAPPING) {
manager.add(new Action("Dump Mapping") { //$NON-NLS-1$
public void run() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java 2008-11-19 07:02:59 UTC (rev 11877)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/util/DOMTreeDumper.java 2008-11-19 12:07:35 UTC (rev 11878)
@@ -136,7 +136,7 @@
*
* @param node the node
*/
- private void dumpNode(nsIDOMNode node) {
+ public void dumpNode(nsIDOMNode node) {
dumpNode(node, false);
}
17 years, 5 months
JBoss Tools SVN: r11877 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-19 02:02:59 -0500 (Wed, 19 Nov 2008)
New Revision: 11877
Modified:
trunk/i18n/build.xml
Log:
Moved generated po files to live under target/po.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-19 06:48:59 UTC (rev 11876)
+++ trunk/i18n/build.xml 2008-11-19 07:02:59 UTC (rev 11877)
@@ -9,7 +9,6 @@
<!-- Target locations: -->
<property name="target.dir" location="target" />
- <property name="podir" value="${basedir}${file.separator}po" />
<property name="propdir" value="${target.dir}${file.separator}prop" />
<property name="jardir" value="${target.dir}${file.separator}jars" />
<property name="zipdir" value="${target.dir}${file.separator}zips" />
@@ -89,7 +88,7 @@
<delete dir="po/qps" />
<delete dir="po/en_AA" />
- <delete dir="${podir}" includes="**/*.pot,**/en.po,**/qps.po,**/en_AA.po" />
+ <delete dir="target/po" />
<delete dir="${propdir}" />
<delete dir="target/manifests" />
<delete dir="${jardir}" />
@@ -115,7 +114,7 @@
<!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
<!-- FIXME includes should be just plugins/*/src/**/*.properties.
See https://jira.jboss.org/jira/browse/JBIDE-2972 includes="plugins/*/*/**/*.properties" -->
- <prop2pot srcDir="@{moduledir}" dstDir="${podir}/${module}" includes="plugins/*/src/**/*.properties" >
+ <prop2pot srcDir="@{moduledir}" dstDir="po/${module}" includes="plugins/*/src/**/*.properties" >
<!-- next two are Maven style, not currently used in JBT: -->
<!--
<fileset erroronmissingdir="false" dir="${plugindir}/src/main/java"/>
@@ -145,14 +144,14 @@
<!-- autogenerated "translations" -->
<target name="en" depends="init" description="Generate English PO files from POT files">
- <pot2en srcDir="${podir}" locale="en" />
+ <pot2en srcDir="po" dstDir="target/po" locale="en" />
</target>
<target name="qps" depends="init" description="Generate Pseudo-translation PO files for qps locale from POT files">
- <pot2en srcDir="${podir}" locale="qps" pseudo="true" />
+ <pot2en srcDir="po" dstDir="target/po" locale="qps" pseudo="true" />
</target>
<target name="en_AA" depends="init" description="Generate Pseudo-translation PO files for en_AA locale from POT files">
- <pot2en srcDir="${podir}" locale="en_AA" pseudo="true" />
+ <pot2en srcDir="po" dstDir="target/po" locale="en_AA" pseudo="true" />
</target>
<target name="po2prop" depends="init" description="Generate Java properties files from translated PO files">
@@ -161,6 +160,9 @@
<po2prop srcDir="po" dstDir="${propdir}" failonnull="true">
<unbundlemapper />
</po2prop>
+ <po2prop srcDir="target/po" dstDir="${propdir}" failonnull="true">
+ <unbundlemapper />
+ </po2prop>
</target>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
17 years, 5 months
JBoss Tools SVN: r11876 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert: b2j/translate and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-11-19 01:48:59 -0500 (Wed, 19 Nov 2008)
New Revision: 11876
Added:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/AbstractConvertWizardPage.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
JBIDE-3218: jbpm converter module codes review
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-11-19 06:48:59 UTC (rev 11876)
@@ -31,17 +31,18 @@
Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
Bpmn_Pool_Choose_WizardPage_Name=PoolPage
-Bpmn_Pool_Choose_WizardPage_Message=BPMN Pools
-Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_Pool_Choose_WizardPage_Title=BPMN Pools
+Bpmn_Pool_Choose_WizardPage_ViewerTitle=BPMN pools
+Bpmn_Pool_Choose_WizardPage_Message=Select BPMN pools to translate
Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
-Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
Bpmn_Translate_Message_WizardPage_Name=MessagePage
Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occurred during conversion
-Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
Bpmn_EAnnotations_Element_Name=eAnnotations
Bpmn_Details_Element_Name=details
Bpmn_Value_Attribute_Name=value
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -58,6 +58,7 @@
public static String Bpmn_Pool_Choose_WizardPage_Name;
public static String Bpmn_Pool_Choose_WizardPage_Message;
public static String Bpmn_Pool_Choose_WizardPage_Title;
+ public static String Bpmn_Pool_Choose_WizardPage_ViewerTitle;
public static String Bpmn_GeneratedFile_Location_WizardPage_Name;
public static String Bpmn_GeneratedFile_Location_WizardPage_Message;
public static String Bpmn_GeneratedFile_Location_WizardPage_Title;
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -32,19 +32,10 @@
*/
public class BPMN2JPDL extends BPMNTranslator {
- Document bpmnDocument;
- List<Document> processDefs = new ArrayList<Document>();
+ private Document bpmnDocument;
+ private List<Document> processDefs = new ArrayList<Document>();
+ private Map<String, Element> map = new HashMap<String, Element>();
- Map<String, Element> map = new HashMap<String, Element>();
-
- public Map<String, Element> getMap() {
- return map;
- }
-
- public void setMap(Map<String, Element> map) {
- this.map = map;
- }
-
public BPMN2JPDL() {
}
@@ -408,14 +399,7 @@
warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ edge.attributeValue(B2JMessages.Bpmn_Element_ID));
}
- transition
- .addAttribute(
- B2JMessages.To,
- map
- .get(
- edge
- .attributeValue(B2JMessages.Bpmn_FlowTarget_Attribute_Name))
- .attributeValue(B2JMessages.Dom_Element_Name));
+ transition.addAttribute(B2JMessages.To,map.get(edge.attributeValue(B2JMessages.Bpmn_FlowTarget_Attribute_Name)).attributeValue(B2JMessages.Dom_Element_Name));
}
/*
@@ -463,4 +447,11 @@
this.processDefs = processDefs;
}
+ public Map<String, Element> getMap() {
+ return map;
+ }
+
+ public void setMap(Map<String, Element> map) {
+ this.map = map;
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -32,14 +32,12 @@
*/
public class GraphicalFileGenerator extends BPMNTranslator {
- Document document;
-
+ private Document document;
// gpd.xml documents list
- List<Document> gpdDefs = new ArrayList<Document>();
-
+ private List<Document> gpdDefs = new ArrayList<Document>();
// the pool of gpd.xml name
- List<String> gpdPoolNames = new ArrayList<String>();
- Map<String, Element> map = new HashMap<String, Element>();
+ private List<String> gpdPoolNames = new ArrayList<String>();
+ private Map<String, Element> map = new HashMap<String, Element>();
public GraphicalFileGenerator(Document bpmnDiagramDocument,
Map<String, Element> map, String rootLocation, String bpmnFileName) {
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -38,9 +38,6 @@
private List<String> generatedGpdFoldersList = new ArrayList<String>();
public void createGeneratedFile(boolean isOverWrite) {
- if(!isOverWrite){
- return;
- }
String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
String location = super.getContainerPath((IContainer) super
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/AbstractConvertWizardPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/AbstractConvertWizardPage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/AbstractConvertWizardPage.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Grid Qian
+ *
+ * this class is a abstract wizard page.
+ */
+abstract public class AbstractConvertWizardPage extends WizardPage {
+
+ public String tableTitle;
+
+ public AbstractConvertWizardPage(String pageName, String pageTitle,
+ String tableTitle, String pageDescription) {
+ super(pageName);
+ this.setTitle(pageTitle);
+ this.setDescription(pageDescription);
+ this.tableTitle = tableTitle;
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+ createTableTitleArea(composite);
+ createTableViewer(composite);
+ addOtherAreas(composite);
+ setControl(composite);
+
+ initializePage();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ private Label createTableTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(tableTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ protected void addOtherAreas(Composite composite) {
+ // TODO if need, sub-class may overwrite this method to add other ui
+ // element
+ }
+
+ protected void initializePage() {
+ // TODO if need, sub-class may overwrite this method to do some
+ // initialize works
+ }
+
+ protected void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ // create a table view
+ abstract public void createTableViewer(Composite composite);
+
+}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -24,53 +24,30 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
/**
* @author Grid Qian
*
- * the wizardpage used by user to choose the bpmn file
+ * the wizardpage used by user to choose the bpmn file
*/
-public class BPMNResourcesChoicePage extends WizardPage {
-
+public class BPMNResourcesChoicePage extends AbstractConvertWizardPage {
+
private TreeViewer viewer;
private ISelection currentSelection;
private IWizard wizard;
public BPMNResourcesChoicePage(String pageName, String title,
- String description) {
- super(pageName);
- this.setTitle(title);
- this.setDescription(description);
+ String tableTitle, String description) {
+ super(pageName, title, tableTitle, description);
}
- public void createControl(Composite parent) {
- Composite composite = createDialogArea(parent);
-
- createListTitleArea(composite);
- createListViewer(composite);
- super.setControl(composite);
-
- initializePage();
- }
-
- private Label createListTitleArea(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- label.setText(B2JMessages.Bpmn_File_Choose_WizardPage_ViewerTitle);
- label.setFont(composite.getFont());
- return label;
- }
-
- private void createListViewer(Composite composite) {
+ public void createTableViewer(Composite composite) {
viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
| SWT.H_SCROLL | SWT.V_SCROLL);
viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -89,7 +66,7 @@
});
}
- private void initializePage() {
+ public void initializePage() {
wizard = this.getWizard();
viewer.setInput(ResourcesPlugin.getWorkspace());
if (this.currentSelection != null) {
@@ -105,23 +82,6 @@
return super.isPageComplete();
}
- private void updateControls() {
- super.getWizard().getContainer().updateButtons();
- }
-
- private Composite createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 7;
- layout.marginWidth = 7;
- layout.verticalSpacing = 4;
- layout.horizontalSpacing = 4;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
public void setSelection(ISelection selection) {
this.currentSelection = selection;
}
@@ -133,7 +93,7 @@
class ProjectFilter extends ViewerFilter {
private static String BPMN_FILE_EXT = "bpmn";
-
+
@Override
public boolean select(Viewer viewer, Object parent, Object element) {
boolean res = false;
@@ -144,26 +104,27 @@
}
}
if (element instanceof IContainer) {
- IContainer container = (IContainer)element;
+ IContainer container = (IContainer) element;
if (container.getProject().isAccessible()) {
res = hasBPMNResources(container);
}
}
return res;
}
-
+
private boolean hasBPMNResources(IContainer container) {
boolean res = false;
try {
IResource[] resources = container.members();
for (int i = 0; i < resources.length; i++) {
if (resources[i] instanceof IFile
- && ((IFile)resources[i]).getFileExtension().equalsIgnoreCase(BPMN_FILE_EXT)) {
+ && ((IFile) resources[i]).getFileExtension()
+ .equalsIgnoreCase(BPMN_FILE_EXT)) {
res = true;
break;
}
if (resources[i] instanceof IContainer) {
- if (hasBPMNResources((IContainer)resources[i])) {
+ if (hasBPMNResources((IContainer) resources[i])) {
res = true;
break;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -20,7 +20,6 @@
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -29,7 +28,6 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
@@ -40,42 +38,21 @@
* the wizardpage used by user to choose the bpmn pool from a bpmn
* diagram
*/
-public class BpmnPoolsChoicePage extends WizardPage {
+public class BpmnPoolsChoicePage extends AbstractConvertWizardPage {
CheckboxTableViewer listViewer;
Button selectButton;
Button deselectButton;
- String listTitle;
private Map<String, String> idMap;
private IWizard wizard;
- public BpmnPoolsChoicePage(String pageName, String title, String listTitle) {
- super(pageName);
- this.listTitle = listTitle;
- this.setDescription(title);
- this.setTitle(listTitle);
+ public BpmnPoolsChoicePage(String pageName, String title,
+ String tableTitle, String description) {
+ super(pageName, title, tableTitle, description);
}
- public void createControl(Composite parent) {
- Composite composite = createDialogArea(parent);
-
- createListTitleArea(composite);
- createListViewer(composite);
- addSelectionButtons(composite);
- setControl(composite);
-
- initializeViewer();
- }
-
- private Label createListTitleArea(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- label.setText(listTitle);
- label.setFont(composite.getFont());
- return label;
- }
-
- private void createListViewer(Composite composite) {
+ public void createTableViewer(Composite composite) {
listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH);
data.heightHint = 250;
@@ -110,7 +87,7 @@
});
}
- private void addSelectionButtons(Composite composite) {
+ public void addOtherAreas(Composite composite) {
Composite buttonComposite = new Composite(composite, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 0;
@@ -166,7 +143,7 @@
return button;
}
- private void initializeViewer() {
+ public void initializePage() {
if (listViewer == null) {
return;
}
@@ -184,19 +161,6 @@
changeComplete();
}
- private Composite createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 7;
- layout.marginWidth = 7;
- layout.verticalSpacing = 4;
- layout.horizontalSpacing = 4;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
public void changeComplete() {
if (listViewer.getCheckedElements().length != 0) {
setPageComplete(true);
@@ -211,7 +175,7 @@
public void setIdMap(Map<String, String> idMap) {
this.idMap = idMap;
- initializeViewer();
+ initializePage();
}
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -37,7 +37,7 @@
/**
* @author Grid Qian
*
- * the wizard for bpmn translation
+ * the wizard for bpmn translation
*/
public abstract class BpmnToWizard extends Wizard implements IExportWizard {
@@ -52,6 +52,7 @@
private IStructuredSelection targetLocationSelection;
// bpmn pool id:name map
private Map<String, String> idMap;
+ private boolean isOverWrite = true;
protected String bpmnFileName;
protected String bpmnFileParentPath;
@@ -70,19 +71,23 @@
bpmnResPage = new BPMNResourcesChoicePage(
B2JMessages.Bpmn_File_Choose_WizardPage_Name,
B2JMessages.Bpmn_File_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_File_Choose_WizardPage_ViewerTitle,
B2JMessages.Bpmn_File_Choose_WizardPage_Message);
bpmnResPage.setSelection(selection);
poolsPage = new BpmnPoolsChoicePage(
B2JMessages.Bpmn_Pool_Choose_WizardPage_Name,
B2JMessages.Bpmn_Pool_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_ViewerTitle,
B2JMessages.Bpmn_Pool_Choose_WizardPage_Message);
errorPage = new ErrorMessagesPage(
B2JMessages.Bpmn_Translate_Message_WizardPage_Name,
B2JMessages.Bpmn_Translate_Message_WizardPage_Title,
+ B2JMessages.Bpmn_Translate_Message_WizardpageViewer_Title,
B2JMessages.Bpmn_Translate_Message_WizardPage_Message);
locationPage = new GeneratedFileLocationPage(
B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Name,
B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Title,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle,
B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Message);
locationPage.setSelection(selection);
addPage(bpmnResPage);
@@ -128,11 +133,10 @@
}
public IWizardPage getNextPage(IWizardPage page) {
- if (page.getName()
- .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ if (page.getName().equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
errorList = translateBpmnToStrings();
errorPage.setPageComplete(true);
-
+
if (errorList.size() == 0) {
return locationPage;
}
@@ -145,16 +149,15 @@
}
public boolean performFinish() {
-
- createGeneratedFile(locationPage.isOverWrite());
+ createGeneratedFile(this.isOverWrite());
refreshWorkspace();
return true;
}
/*
* do the translation from bpmn to string list the sub class need to create
- * a string list to reserve these strings
- * the return list is error or warning messages
+ * a string list to reserve these strings the return list is error or
+ * warning messages
*/
public abstract List<String> translateBpmnToStrings();
@@ -241,4 +244,12 @@
IStructuredSelection targetLocationSelection) {
this.targetLocationSelection = targetLocationSelection;
}
+
+ public boolean isOverWrite() {
+ return isOverWrite;
+ }
+
+ public void setOverWrite(boolean isOverWrite) {
+ this.isOverWrite = isOverWrite;
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -14,48 +14,26 @@
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
/**
* @author Grid Qian
*
- * the wizardpage for showing the error and warning messages from translating
+ * the wizardpage for showing the error and warning messages from
+ * translating
*/
-public class ErrorMessagesPage extends WizardPage {
+public class ErrorMessagesPage extends AbstractConvertWizardPage {
private TableViewer listViewer;
-
- protected ErrorMessagesPage(String pageName, String title, String description) {
- super(pageName);
- this.setDescription(description);
- this.setTitle(title);
+ protected ErrorMessagesPage(String pageName, String title,
+ String tableTitle, String description) {
+ super(pageName, title, tableTitle, description);
}
- public void createControl(Composite parent) {
- Composite composite = createDialogArea(parent);
-
- createListTitleArea(composite);
- createListViewer(composite);
- setControl(composite);
- initializePage();
- }
-
- private Label createListTitleArea(Composite composite) {
- Label label = new Label(composite, SWT.NONE);
- label
- .setText(B2JMessages.Bpmn_Translate_Message_WizardpageViewer_Title);
- label.setFont(composite.getFont());
- return label;
- }
-
- private void createListViewer(Composite composite) {
+ public void createTableViewer(Composite composite) {
listViewer = new TableViewer(composite, SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH);
@@ -67,20 +45,7 @@
listViewer.setContentProvider(new ArrayContentProvider());
}
- private Composite createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 7;
- layout.marginWidth = 7;
- layout.verticalSpacing = 4;
- layout.horizontalSpacing = 4;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
- private void initializePage() {
+ public void initializePage() {
this.setPageComplete(false);
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-11-19 06:17:32 UTC (rev 11875)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-11-19 06:48:59 UTC (rev 11876)
@@ -12,7 +12,6 @@
package org.jboss.tools.jbpm.convert.bpmnto.wizard;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -25,15 +24,12 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
@@ -41,45 +37,21 @@
/**
* @author Grid Qian
*
- * the wizardpage for the generated file location
+ * the wizardpage for the generated file location
*/
-public class GeneratedFileLocationPage extends WizardPage {
+public class GeneratedFileLocationPage extends AbstractConvertWizardPage {
private TreeViewer viewer;
private ISelection currentSelection;
private Button button;
private IWizard wizard;
- private boolean isOverWrite = true;
-
protected GeneratedFileLocationPage(String pageName, String title,
- String description) {
- super(pageName);
- this.setDescription(description);
- this.setTitle(title);
+ String tableTitle, String description) {
+ super(pageName, title, tableTitle, description);
}
- public void createControl(Composite parent) {
- Composite composite = createDialogArea(parent);
-
- createListTitleArea(composite);
- createListViewer(composite);
- createCheckbox(composite);
- super.setControl(composite);
-
- initializePage();
-
- }
-
- private Label createListTitleArea(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label
- .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle);
- label.setFont(parent.getFont());
- return label;
- }
-
- private void createListViewer(Composite composite) {
+ public void createTableViewer(Composite composite) {
viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
| SWT.H_SCROLL | SWT.V_SCROLL);
viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -98,58 +70,40 @@
});
}
- private Button createCheckbox(Composite parent) {
- button = new Button(parent, SWT.CHECK | SWT.NONE);
+ public void addOtherAreas(Composite composite) {
+ button = new Button(composite, SWT.CHECK | SWT.NONE);
button
.setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_CheckBox);
- button.setFont(parent.getFont());
- button.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent arg0) {
+ button.setFont(composite.getFont());
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent arg0) {
}
+
public void widgetSelected(SelectionEvent arg0) {
- isOverWrite = button.getSelection();
- }});
- return button;
+ ((BpmnToWizard) wizard).setOverWrite(button.getSelection());
+ }
+ });
}
- private void initializePage() {
+ public void initializePage() {
wizard = this.getWizard();
viewer.setInput(ResourcesPlugin.getWorkspace());
- if (this.currentSelection != null) {
- if (currentSelection != null
- && currentSelection instanceof ITreeSelection) {
- // Select the parent project of this first bpmn file chosen
- ITreeSelection node = (ITreeSelection) currentSelection;
- TreePath[] paths = node.getPaths();
- if(paths.length == 0) {
- return;
- }
- TreePath projPath = new TreePath(new Object[] { paths[0]
- .getFirstSegment() });
- TreeSelection projSel = new TreeSelection(projPath);
- viewer.setSelection(projSel, true);
+ if (currentSelection != null
+ && currentSelection instanceof ITreeSelection) {
+ // Select the parent project of this first bpmn file chosen
+ ITreeSelection node = (ITreeSelection) currentSelection;
+ TreePath[] paths = node.getPaths();
+ if (paths.length == 0) {
+ return;
}
+ TreePath projPath = new TreePath(new Object[] { paths[0]
+ .getFirstSegment() });
+ TreeSelection projSel = new TreeSelection(projPath);
+ viewer.setSelection(projSel, true);
}
- button.setSelection(true);
+ button.setSelection(((BpmnToWizard) wizard).isOverWrite());
}
- private void updateControls() {
- super.getWizard().getContainer().updateButtons();
- }
-
- private Composite createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 7;
- layout.marginWidth = 7;
- layout.verticalSpacing = 4;
- layout.horizontalSpacing = 4;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
public boolean isPageComplete() {
if (viewer != null && viewer.getSelection() == null) {
return false;
@@ -164,23 +118,14 @@
public void setSelection(ISelection currentSelection) {
this.currentSelection = currentSelection;
}
-
- public boolean isOverWrite() {
- return isOverWrite;
- }
-
- public void setOverWrite(boolean isOverWrite) {
- this.isOverWrite = isOverWrite;
- }
-
}
class ProFilter extends ViewerFilter {
@Override
public boolean select(Viewer viewer, Object parent, Object element) {
if (element instanceof IContainer) {
- return ((IContainer)element).getProject().isAccessible();
+ return ((IContainer) element).getProject().isAccessible();
} else {
return false;
}
17 years, 5 months
JBoss Tools SVN: r11875 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-19 01:17:32 -0500 (Wed, 19 Nov 2008)
New Revision: 11875
Modified:
trunk/i18n/build.xml
Log:
Tidied up a little.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-19 04:22:05 UTC (rev 11874)
+++ trunk/i18n/build.xml 2008-11-19 06:17:32 UTC (rev 11875)
@@ -170,7 +170,7 @@
<attribute name="propname" />
<sequential>
<if>
- <!-- TODO fail on empty value -->
+ <!-- FIXME fail on empty value -->
<not>
<isset property="@{propname}"/>
</not>
@@ -218,12 +218,12 @@
generating manifests -->
<target name="manifests" depends="init" description="Generate fragment plugin manifests for langpack plugins">
<delete dir="target/manifests" />
- <processlocaleplugins rootdir="${propdir}" task="manifest" />
+ <processlocaleplugins rootdir="${propdir}" task="-manifest" />
</target>
<!-- Generates the manifests (one per locale) for one plugin. Called by processlocaleplugins. -->
- <target name="manifest">
+ <target name="-manifest">
<!-- NB don't depend on initTaskDefs here, or ant loads the
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
@@ -232,6 +232,7 @@
<checkprop propname="PLUGIN_VENDOR"/>
<for param="locale" list="${locales}">
<sequential>
+ <!-- FIXME -->
<var name="locale" value="@{locale}" />
<propertycopy override="true" property="localename" from="NAME_${locale}"/>
<checkprop propname="localename"/>
@@ -252,11 +253,11 @@
<target name="fragments" depends="init" description="Generate fragment plugin jars to contain translations" >
<delete dir="${jardir}" />
<mkdir dir="${jardir}/plugins" />
- <processlocaleplugins rootdir="${propdir}" task="fragment" />
+ <processlocaleplugins rootdir="${propdir}" task="-fragment" />
</target>
<!-- Jars up one fragment plugin. Called by processlocaleplugins. -->
- <target name="fragment">
+ <target name="-fragment">
<!-- NB don't depend on initTaskDefs here, or ant loads the
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
@@ -266,10 +267,12 @@
<for param="locale" list="${locales}">
<sequential>
+ <!-- FIXME -->
<var name="__locale" value="@{locale}" />
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
<checkprop propname="localename"/>
+ <!-- FIXME -->
<var name="jar" value="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
<echo level="verbose" message="Jarring up ${jar} from directory ${plugindir}"/>
<jar
@@ -291,6 +294,7 @@
<mkdir dir="${propdir}/features" />
<delete dir="${jardir}/features" />
<mkdir dir="${jardir}/features" />
+ <!-- FIXME -->
<var name="temp.file.sitefeatures" unset="true" />
<tempfile property="temp.file.sitefeatures" destdir="${target.dir}" prefix="site" suffix=".tmp" createfile="true" deleteonexit="false" />
<sequential>
@@ -310,11 +314,13 @@
regexp="^${jbt.srcdir}${file.separator}[^/\\]+${file.separator}features${file.separator}([^/\\]+)${file.separator}feature.xml"
select="\1" />
<checkprop propname="feature"/>
+ <!-- FIXME -->
<var name="featurename" value="${feature}" />
<var name="jarsize" value="0" />
<echo level="verbose" message="Processing feature ${feature} in module ${module}"/>
<for param="locale" list="${locales}">
<sequential>
+ <!-- FIXME -->
<var name="locale" value="@{locale}" />
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
@@ -326,6 +332,7 @@
<propertycopy override="true" property="plugins" from="feature.${feature}.plugins"/>
+ <!-- FIXME -->
<var name="temp.file.featureplugins" unset="true" />
<tempfile property="temp.file.featureplugins" destdir="${target.dir}" prefix="plugins" suffix=".tmp" createfile="true" deleteonexit="true" />
<for param="plugin" list="${plugins}" delimiter=" ">
@@ -342,6 +349,7 @@
</if>
</sequential>
</for>
+ <!-- FIXME -->
<var name="plugins" unset="true" />
<loadfile property="plugins" srcFile="${temp.file.featureplugins}"/>
<delete file="${temp.file.featureplugins}"/>
@@ -359,7 +367,7 @@
</feature>
-->
- <!-- TODO download-size="${jarsize}" install-size="${jarsize}" -->
+ <!-- FIXME download-size="${jarsize}" install-size="${jarsize}" -->
<copy overwrite="true"
todir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}">
<fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
@@ -395,6 +403,7 @@
<!-- Read in the above list of features -->
+ <!-- FIXME -->
<var name="features" unset="true" />
<loadfile property="features" srcFile="${temp.file.sitefeatures}"/>
<delete file="${temp.file.sitefeatures}"/>
@@ -407,9 +416,9 @@
</copy>
</target>
- <target name="p2">
+ <target name="p2" description="Generate metadata for Eclipse 3.4's update manager (P2)" >
<!-- Generate P2 metadata so that update manager won't take forever.
- http://wiki.eclipse.org/Equinox_p2_Metadata_Generator /home/sflaniga/apps/eclipse-ganymede/eclipse/eclipse
+ http://wiki.eclipse.org/Equinox_p2_Metadata_Generator
-->
<exec executable="eclipse">
17 years, 5 months
JBoss Tools SVN: r11874 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-18 23:22:05 -0500 (Tue, 18 Nov 2008)
New Revision: 11874
Modified:
trunk/i18n/build.xml
Log:
Changed to directory/file-naming format for pot/po files, to better suit the gettext tools used by the localisation team.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-19 00:11:48 UTC (rev 11873)
+++ trunk/i18n/build.xml 2008-11-19 04:22:05 UTC (rev 11874)
@@ -9,7 +9,7 @@
<!-- Target locations: -->
<property name="target.dir" location="target" />
- <property name="potdir" value="${target.dir}${file.separator}pot" />
+ <property name="podir" value="${basedir}${file.separator}po" />
<property name="propdir" value="${target.dir}${file.separator}prop" />
<property name="jardir" value="${target.dir}${file.separator}jars" />
<property name="zipdir" value="${target.dir}${file.separator}zips" />
@@ -83,144 +83,84 @@
</target>
<target name="clean" description="Remove generated files">
- <delete dir="${potdir}" />
+ <!-- obsolete dirs -->
+ <delete dir="target/pot" />
<delete dir="po/en" />
<delete dir="po/qps" />
<delete dir="po/en_AA" />
+
+ <delete dir="${podir}" includes="**/*.pot,**/en.po,**/qps.po,**/en_AA.po" />
<delete dir="${propdir}" />
+ <delete dir="target/manifests" />
<delete dir="${jardir}" />
<delete dir="${zipdir}" />
<delete dir="${target.dir}" includes="*.tmp" />
</target>
-
-<!-- This is fairly neat, but doesn't preserve the plugin ID...
- <target name="__prop2pot" depends="init"
+
+ <target name="prop2pot" depends="init"
description="Extract translation templates (POT) from the JBoss Tools English properties files">
- <mkdir dir="${potdir}" />
- <for param="srcdir">
+ <for param="moduledir" >
<path>
- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...}
- <dirset dir="${jbt.srcdir}" includes="*/plugins/*/*" excludes="${srcexcludes}" />
+ <dirset dir="${jbt.srcdir}" includes="*" excludes="i18n,.*" />
</path>
<sequential>
- <echo level="verbose" message="Extracting strings from @{srcdir}"/>
- <prop2pot srcDir="@{srcdir}" dstDir="${potdir}">
- <packagemapper from="*.properties" to="*.pot" />
+ <!-- FIXME create BundleNameMapper -->
+ <propertyregex override="true" property="module"
+ input="@{moduledir}"
+ regexp="^${jbt.srcdir}${file.separator}([^/\\]+).*"
+ select="\1" />
+ <checkprop propname="module"/>
+ <echo message="module=${module}" />
+
+ <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
+ <!-- FIXME includes should be just plugins/*/src/**/*.properties.
+ See https://jira.jboss.org/jira/browse/JBIDE-2972 includes="plugins/*/*/**/*.properties" -->
+ <prop2pot srcDir="@{moduledir}" dstDir="${podir}/${module}" includes="plugins/*/src/**/*.properties" >
+ <!-- next two are Maven style, not currently used in JBT: -->
+<!--
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main/java"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main/resources"/>
+
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main" excludes="java,resources"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src" excludes="main"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/jbosscore"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/jbossui"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/resources"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/template-src"/>
+ //<fileset dir="${plugindir}/templates"/>
+-->
+ <!-- rename to pluginID-org.jboss.ide.*/org.jboss.ide.*.pot -->
+ <chainedmapper>
+ <regexpmapper handledirsep="true" from="^plugins/([^/]+)/[^/]+/(.*)[.]properties$$" to="\1-\2~\2.pot" />
+ <filtermapper>
+ <!-- org/jboss/ide/* -> org.jboss.ide.* -->
+ <replacestring from="${file.separator}" to="."/>
+ <replacestring from="~" to="/"/>
+ </filtermapper>
+ </chainedmapper>
</prop2pot>
</sequential>
</for>
</target>
--->
-
- <target name="prop2pot" depends="init"
- description="Extract translation templates (POT) from the JBoss Tools English properties files">
- <mkdir dir="${potdir}" />
- <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
- <prop2pot srcDir="${jbt.srcdir}" dstDir="${potdir}" includes="*/plugins/*/src/**/*.properties">
- <!-- rename to pluginID-org.jboss.ide.*.pot -->
- <chainedmapper>
- <!-- rename -> "pluginID dash pathRelativeToSrc" -->
- <regexpmapper handledirsep="true" from="^.*/plugins/(.*)/src/(.*)" to="\1-\2" />
- <!-- rename org/jboss/ide/*.properties -> pluginID-org.jboss.ide.*.pot -->
- <packagemapper from="*.properties" to="*.pot" />
- <!-- rename -> pluginID/org.jboss.ide.*.pot:
- -->
- <!--<regexpmapper from="([^-]+)-(.*)" to="\1/\2"/>-->
-
- <!-- Silly idea: Replace plugin id in package names with ~
- <scriptmapper language="groovy" classpathref="dependency.classpath">
- //self.addMappedName source.toUpperCase()
- def m = source =~ /^([^-]+)-(.*)$$/
- if (m.matches())
- {
- def plugin = m[0][1]
- def resource = m[0][2]
- def regex2 = plugin+"(.*)"
- def m2 = resource =~ regex2
- if(m2.matches())
- self.addMappedName plugin+"-~"+m2[0][1]
- else
- self.addMappedName plugin+"-"+resource
- }
- </scriptmapper>
- -->
- </chainedmapper>
- </prop2pot>
- </target>
<!-- autogenerated "translations" -->
<target name="en" depends="init" description="Generate English PO files from POT files">
- <delete dir="po/en" />
- <mkdir dir="po/en" />
- <pot2en srcDir="${potdir}" dstDir="po/en" />
+ <pot2en srcDir="${podir}" locale="en" />
</target>
<target name="qps" depends="init" description="Generate Pseudo-translation PO files for qps locale from POT files">
- <delete dir="po/qps" />
- <mkdir dir="po/qps" />
- <pot2en srcDir="${potdir}" dstDir="po/qps" pseudo="true" />
+ <pot2en srcDir="${podir}" locale="qps" pseudo="true" />
</target>
<target name="en_AA" depends="init" description="Generate Pseudo-translation PO files for en_AA locale from POT files">
- <delete dir="po/en_AA" />
- <mkdir dir="po/en_AA" />
- <pot2en srcDir="${potdir}" dstDir="po/en_AA" pseudo="true" />
+ <pot2en srcDir="${podir}" locale="en_AA" pseudo="true" />
</target>
<target name="po2prop" depends="init" description="Generate Java properties files from translated PO files">
<delete dir="${propdir}" />
<mkdir dir="${propdir}" />
<po2prop srcDir="po" dstDir="${propdir}" failonnull="true">
- <unbundlemapper directoryPerLocale="true" />
-<!--
-
- <scriptmapper language="groovy" classpathref="dependency.classpath">
- <![CDATA[
-// 7 seconds on hot run
- // map locale/pluginID-org.jboss.ide.*.po -> locale/pluginID/org/jboss/ide/*.properties
- static def exp
- if (exp == null)
- {
- println "null"
- exp = /^([^\/\\]+[\/\\][^-]+)-(.*)[.]po$$/
- }
- def m = source =~ exp
- if (m.matches())
- {
- def localeAndPlugin = m[0][1]
- def resource = m[0][2].replace '.' '/'
- self.addMappedName localeAndPlugin+"/"+resource+".properties";
- }
-
- ]]>
- </scriptmapper>
- -->
- </po2prop>
-<!--
- <for param="locale" list="${locales}">
- <sequential>
- <for param="plugindir">
- <path>
- <dirset dir="po/@{locale}" includes="*" />
- </path>
- <sequential>
- <po2prop srcDir="@{plugindir}" dstDir="${propdir}/@{locale}" locale="@{locale}" failonnull="true">
- <chainedmapper>
- <filtermapper>
- <replacestring from="${file.separator}" to="-"/>
- </filtermapper>
-
- <unpackagemapper from="*.po" to="*.properties" />
- <filtermapper>
- <replacestring from="/" to="-"/>
- </filtermapper>
- </chainedmapper>
- </po2prop>
- </sequential>
- </for>
- </sequential>
- </for>
--->
-
+ <unbundlemapper />
+ </po2prop>
</target>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@@ -250,29 +190,23 @@
<sequential>
<for param="plugindir">
<path>
- <dirset dir="@{rootdir}" includes="*/*/plugins/*" />
+ <dirset dir="@{rootdir}" includes="*/*" />
</path>
<sequential>
<!-- FIXME -->
- <propertyregex override="true" property="locale"
- input="@{plugindir}"
- regexp="^(a){rootdir}${file.separator}([^/\\]+)${file.separator}.*"
- select="\1" />
- <checkprop propname="locale"/>
<propertyregex override="true" property="module"
input="@{plugindir}"
- regexp="^(a){rootdir}${file.separator}[^/\\]+${file.separator}([^/\\]+).*"
+ regexp="^(a){rootdir}[/\\]([^/\\]+).*"
select="\1" />
<checkprop propname="module"/>
<propertyregex override="true" property="plugin"
input="@{plugindir}"
- regexp="^(a){rootdir}${file.separator}[^/\\]+${file.separator}[^/\\]+${file.separator}plugins${file.separator}(.*)"
+ regexp="^(a){rootdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
select="\1" />
<checkprop propname="plugin"/>
- <propertycopy override="true" property="localename" from="NAME_${locale}"/>
- <echo level="verbose" message="@{plugindir} contains ${locale} props for plugin ${plugin} in module ${module}"/>
+ <echo level="verbose" message="@{plugindir} contains props for plugin ${plugin} in module ${module}"/>
<antcall target="@{task}">
- <param name="plugin" value="@{plugin}"/>
+ <param name="plugin" value="${plugin}"/>
<param name="plugindir" value="@{plugindir}"/>
</antcall>
</sequential>
@@ -283,29 +217,34 @@
<!-- Processes the generated props directory, one plugin at a time,
generating manifests -->
<target name="manifests" depends="init" description="Generate fragment plugin manifests for langpack plugins">
- <delete dir="${propdir}" includes="*/*/plugins/*/META-INF/MANIFEST.MF"/>
+ <delete dir="target/manifests" />
<processlocaleplugins rootdir="${propdir}" task="manifest" />
</target>
- <!-- Generates the manifest for one plugin. Called by processlocaleplugins. -->
+ <!-- Generates the manifests (one per locale) for one plugin. Called by processlocaleplugins. -->
<target name="manifest">
<!-- NB don't depend on initTaskDefs here, or ant loads the
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
<checkprop propname="plugin"/>
- <checkprop propname="locale"/>
- <checkprop propname="localename"/>
<checkprop propname="PLUGIN_VERSION"/>
<checkprop propname="PLUGIN_VENDOR"/>
- <copy overwrite="true" file="plugin-template.mf" tofile="${plugindir}/META-INF/MANIFEST.MF">
- <filterchain>
- <expandproperties/>
- </filterchain>
- </copy>
- <!-- for debug output:
- <concat><filelist files="${plugindir}/META-INF/MANIFEST.MF"></filelist></concat>
+ <for param="locale" list="${locales}">
+ <sequential>
+ <var name="locale" value="@{locale}" />
+ <propertycopy override="true" property="localename" from="NAME_${locale}"/>
+ <checkprop propname="localename"/>
+ <copy overwrite="true" file="plugin-template.mf" tofile="target/manifests/${plugin}/${locale}">
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </copy>
+<!-- for debug output:
+ <concat><filelist files="target/manifests/${plugin}/${locale}"></filelist></concat>
-->
+ </sequential>
+ </for>
</target>
<!-- Processes the generated props directory, one plugin at a time,
@@ -322,39 +261,28 @@
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
<checkprop propname="plugin"/>
- <checkprop propname="locale"/>
- <checkprop propname="localename"/>
<checkprop propname="PLUGIN_VERSION"/>
<checkprop propname="PLUGIN_VENDOR"/>
- <property name="jar" value="${jardir}/plugins/${plugin}.nl-${locale}_${PLUGIN_VERSION}.jar" />
- <echo level="verbose" message="Jarring up ${jar} from directory ${plugindir}"/>
- <!-- we exclude "*" because we only want about.properties and
- plugin.properties from the top-level -->
- <jar
- destfile="${jar}"
- update="no"
- basedir="${plugindir}"
- excludes="*"
- duplicate="fail"
- manifest="${plugindir}/META-INF/MANIFEST.MF">
- <!-- todo consider an inline manifest -->
- <include name="about.properties"/>
- <!-- NB features contain feature.properties but all are currently empty -->
- <include name="plugin.properties"/>
- <!-- FIXME too many source paths, see https://jira.jboss.org/jira/browse/JBIDE-2972 -->
- <!-- next two are Maven style, not currently used in JBT:
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main/java"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main/resources"/>
- -->
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main" excludes="java,resources"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/src" excludes="main"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/jbosscore"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/jbossui"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/resources"/>
- <!-- <fileset dir="${plugindir}/templates"/> -->
- <fileset erroronmissingdir="false" dir="${plugindir}/template-src"/>
- <!-- TODO identify and list unincluded directories -->
- </jar>
+
+ <for param="locale" list="${locales}">
+ <sequential>
+ <var name="__locale" value="@{locale}" />
+ <propertycopy override="true" property="localename" from="NAME_@{locale}"/>
+ <checkprop propname="localename"/>
+
+ <var name="jar" value="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
+ <echo level="verbose" message="Jarring up ${jar} from directory ${plugindir}"/>
+ <jar
+ destfile="${jar}"
+ update="no"
+ basedir="${plugindir}"
+ duplicate="fail"
+ includes="**/*_(a){locale}.properties"
+ manifest="target/manifests/${plugin}/@{locale}">
+ </jar>
+ </sequential>
+ </for>
+
</target>
<target name="features" depends="init"
@@ -528,6 +456,8 @@
</for>
</target>
+ <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features" />
+
<target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features, p2, zips"
description="Runs all targets in an appropriate order"/>
17 years, 5 months