JBoss Tools SVN: r25761 - in trunk/bpel/plugins: org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/util and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-10-12 15:44:34 -0400 (Tue, 12 Oct 2010)
New Revision: 25761
Added:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/DefinitionAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PropertyAliasAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/MessageSelectorTypeDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDElementSelectorDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDTypeSelectorDialog.java
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyAliasImpl.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyImpl.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/QueryImpl.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/util/MessagepropertiesConstants.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIMessagePropertiesAdapterFactory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIWSDLAdapterFactory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditMessagePropertyDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/ListAndViewDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BrowseUtil.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/WSDLImportHelper.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/ModelQuery.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/PropertyAlias.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/messages.properties
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Definitions.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Factory.java
Log:
https://jira.jboss.org/browse/JBIDE-7107
Complete rewrite of property and propertyAlias definition dialogs and enhancements/bug fixes in their corresponding model objects
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyAliasImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyAliasImpl.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyAliasImpl.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -38,6 +38,8 @@
import org.eclipse.wst.wsdl.Part;
import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.w3c.dom.Element;
@@ -681,16 +683,20 @@
.getAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_PROPERTY_NAME_ATTRIBUTE));
// resolve the qname to a property
// TODO could this reference an imported property?
- for (Iterator i = definition.getExtensibilityElements()
- .iterator(); i.hasNext();) {
- ExtensibilityElement extensibilityElement = (ExtensibilityElement) i
- .next();
- if (extensibilityElement instanceof Property) {
- Property property = (Property) extensibilityElement;
- if (property.getQName().equals(qname)
- && property != getPropertyName()) {
- setPropertyName(property);
- break;
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // check for null QName
+ if (qname!=null) {
+ for (Iterator i = definition.getExtensibilityElements()
+ .iterator(); i.hasNext();) {
+ ExtensibilityElement extensibilityElement = (ExtensibilityElement) i
+ .next();
+ if (extensibilityElement instanceof Property) {
+ Property property = (Property) extensibilityElement;
+ if (property.getQName().equals(qname)
+ && property != getPropertyName()) {
+ setPropertyName(property);
+ break;
+ }
}
}
}
@@ -704,11 +710,11 @@
definition,
element
.getAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_MESSAGE_TYPE_ATTRIBUTE));
- Message newMessage = (messageQName != null) ? (Message) definition
- .getMessage(messageQName)
- : null;
- if (newMessage != null && newMessage != getMessageType())
- setMessageType(newMessage);
+ if (messageQName!=null) {
+ Message newMessage = (Message) definition.getMessage(messageQName);
+ if (newMessage != null && newMessage != getMessageType())
+ setMessageType(newMessage);
+ }
}
} else {
setMessageType(null);
@@ -716,17 +722,31 @@
if (element != null
&& element
+ .hasAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE)) {
+ if (definition != null) {
+ String part = element.getAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE);
+ if (part != null && part != getPart())
+ setPart(part);
+ }
+ } else {
+ setType(null);
+ }
+
+ if (element != null
+ && element
.hasAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE)) {
if (definition != null) {
QName typeQName = createQName(
definition,
element
.getAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE));
- XSDTypeDefinition newType = ((DefinitionImpl) definition)
- .resolveTypeDefinition(typeQName.getNamespaceURI(),
- typeQName.getLocalPart());
- if (newType != null && newType != getType())
- setType(newType);
+ if (typeQName!=null) {
+ XSDTypeDefinition newType = ((DefinitionImpl) definition)
+ .resolveTypeDefinition(typeQName.getNamespaceURI(),
+ typeQName.getLocalPart());
+ if (newType != null && newType != getType())
+ setType(newType);
+ }
}
} else {
setType(null);
@@ -740,13 +760,14 @@
definition,
element
.getAttribute(MessagepropertiesConstants.PROPERTY_ALIAS_XSD_ELEMENT_ATTRIBUTE));
- XSDElementDeclaration newElement = ((DefinitionImpl) definition)
- .resolveElementDeclaration(elementQName
- .getNamespaceURI(), elementQName.getLocalPart());
- if (newElement != null && newElement != getXSDElement()) {
- setXSDElement(newElement);
+ if (elementQName!=null) {
+ XSDElementDeclaration newElement = ((DefinitionImpl) definition)
+ .resolveElementDeclaration(elementQName
+ .getNamespaceURI(), elementQName.getLocalPart());
+ if (newElement != null && newElement != getXSDElement()) {
+ setXSDElement(newElement);
+ }
}
-
}
} else {
setXSDElement(null);
@@ -792,27 +813,102 @@
+ qname.getLocalPart());
}
+ // handle "messageType" and "part" addressing
if (eAttribute == null
|| eAttribute == MessagepropertiesPackage.eINSTANCE
.getPropertyAlias_MessageType()) {
Message message = (Message) getMessageType();
QName qname = (message == null) ? null : message.getQName();
- if (qname != null)
+ if (qname != null) {
niceSetAttributeURIValue(
theElement,
MessagepropertiesConstants.PROPERTY_ALIAS_MESSAGE_TYPE_ATTRIBUTE,
qname.getNamespaceURI() + "#"
+ qname.getLocalPart());
+
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // make sure the "element" and "type" attributes get removed
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_XSD_ELEMENT_ATTRIBUTE,
+ null);
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE,
+ null);
+ }
}
if (eAttribute == null
|| eAttribute == MessagepropertiesPackage.eINSTANCE
- .getPropertyAlias_Part())
- niceSetAttribute(
- theElement,
- MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE,
- getPart());
+ .getPropertyAlias_Part()) {
+
+ if (getPart()!=null) {
+ niceSetAttribute(
+ theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE,
+ getPart());
+
+ // make sure the "element" and "type" attributes get removed
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_XSD_ELEMENT_ATTRIBUTE,
+ null);
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE,
+ null);
+ }
+ }
+
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // added type and element handling
+ // handle "type" addressing
+ if (eAttribute == null
+ || eAttribute == MessagepropertiesPackage.eINSTANCE
+ .getPropertyAlias_Type()) {
+ Object type = getType();
+ if (type instanceof XSDTypeDefinition) {
+ XSDTypeDefinition xsdType = (XSDTypeDefinition) type;
+ String uri = xsdType.getURI();
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE,
+ uri);
+
+ // make sure the "element", "messageType" and "part" attributes get removed
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_XSD_ELEMENT_ATTRIBUTE,
+ null);
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_MESSAGE_TYPE_ATTRIBUTE,
+ null);
+ niceSetAttribute(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE,
+ null);
+ }
+ }
+
+ // handle "element" addressing
+ if (eAttribute == null
+ || eAttribute == MessagepropertiesPackage.eINSTANCE
+ .getPropertyAlias_XSDElement()) {
+ Object elem = getXSDElement();
+ if (elem instanceof XSDElementDeclaration) {
+ XSDElementDeclaration xsdElement = (XSDElementDeclaration) elem;
+ String uri = xsdElement.getURI();
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_XSD_ELEMENT_ATTRIBUTE,
+ uri);
+
+ // make sure the "type", "messageType" and "part" attributes get removed
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_TYPE_ATTRIBUTE,
+ null);
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_MESSAGE_TYPE_ATTRIBUTE,
+ null);
+ niceSetAttribute(theElement,
+ MessagepropertiesConstants.PROPERTY_ALIAS_PART_ATTRIBUTE,
+ null);
+ }
+ }
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyImpl.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/PropertyImpl.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -32,6 +32,7 @@
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
+import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDTypeDefinition;
import org.w3c.dom.Element;
@@ -353,10 +354,11 @@
@Override
public void reconcileReferences(boolean deep) {
+ Definition definition = getEnclosingDefinition();
+ Element element = getElement();
if (element != null
&& element
.hasAttribute(MessagepropertiesConstants.PROPERTY_TYPE_ATTRIBUTE)) {
- Definition definition = getEnclosingDefinition();
QName qname = createQName(
definition,
element
@@ -370,6 +372,24 @@
}
}
}
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // added element handling
+ if (element != null
+ && element
+ .hasAttribute(MessagepropertiesConstants.PROPERTY_XSD_ELEMENT_ATTRIBUTE)) {
+ QName qname = createQName(
+ definition,
+ element
+ .getAttribute(MessagepropertiesConstants.PROPERTY_XSD_ELEMENT_ATTRIBUTE));
+ if (qname != null) {
+ XSDElementDeclaration xsdElement = ((DefinitionImpl) definition)
+ .resolveElementDeclaration(qname.getNamespaceURI(), qname
+ .getLocalPart());
+ if (xsdElement != null && getType() != xsdElement) {
+ setType(xsdElement);
+ }
+ }
+ }
super.reconcileReferences(deep);
}
@@ -392,21 +412,40 @@
if (theElement != null) {
if (eAttribute == null
|| eAttribute == MessagepropertiesPackage.eINSTANCE
- .getProperty_Name())
+ .getProperty_Name()) {
niceSetAttribute(theElement,
MessagepropertiesConstants.PROPERTY_NAME_ATTRIBUTE,
getName());
+ }
+
if (eAttribute == null
|| eAttribute == MessagepropertiesPackage.eINSTANCE
.getProperty_Type()) {
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // this is unfortunate, but the Property model object only has a "type" which serves both
+ // for "type" and "element" addressing - we just have to figure out which is which from the
+ // stored object type before serializing to WSDL.
Object type = getType();
if (type instanceof XSDTypeDefinition) {
XSDTypeDefinition xsdType = (XSDTypeDefinition) type;
String uri = xsdType.getURI();
niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_XSD_ELEMENT_ATTRIBUTE,
+ null);
+ niceSetAttributeURIValue(theElement,
MessagepropertiesConstants.PROPERTY_TYPE_ATTRIBUTE,
uri);
}
+ else if (type instanceof XSDElementDeclaration) {
+ XSDElementDeclaration xsdElement = (XSDElementDeclaration) type;
+ String uri = xsdElement.getURI();
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_XSD_ELEMENT_ATTRIBUTE,
+ uri);
+ niceSetAttributeURIValue(theElement,
+ MessagepropertiesConstants.PROPERTY_TYPE_ATTRIBUTE,
+ null);
+ }
}
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/QueryImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/QueryImpl.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/impl/QueryImpl.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -18,6 +18,7 @@
import javax.xml.namespace.QName;
+import org.eclipse.bpel.model.Expression;
import org.eclipse.bpel.model.messageproperties.MessagepropertiesPackage;
import org.eclipse.bpel.model.messageproperties.Query;
import org.eclipse.bpel.model.messageproperties.util.MessagepropertiesConstants;
@@ -39,6 +40,10 @@
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Query</b></em>'.
+ * CAUTION: We want to reuse the XPath editor for query expression, but unfortunately it requires that
+ * the model object implements the Expression interface (only used in the BPEL model currently).
+ * I have added the Expression methods by hand. These have essentially the same functionality as the Query
+ * interface, only the names are changed. See https://jira.jboss.org/browse/JBIDE-7107
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
@@ -50,7 +55,7 @@
*
* @generated
*/
-public class QueryImpl extends ExtensibilityElementImpl implements Query {
+public class QueryImpl extends ExtensibilityElementImpl implements Query, Expression {
/**
* The default value of the '{@link #getQueryLanguage() <em>Query Language</em>}' attribute.
* <!-- begin-user-doc -->
@@ -378,4 +383,44 @@
return elementType;
}
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // the Expression interface methods
+ public Object getBody() {
+ return getValue();
+ }
+
+ public void setBody(Object value) {
+ setValue(value.toString());
+ }
+
+ public String getExpressionLanguage() {
+ return getQueryLanguage();
+ }
+
+ public void setExpressionLanguage(String value) {
+ setQueryLanguage(value);
+ }
+
+ public void unsetExpressionLanguage() {
+ setQueryLanguage(null);
+ }
+
+ public boolean isSetExpressionLanguage() {
+ return getQueryLanguage()!=null;
+ }
+
+ public Boolean getOpaque() {
+ return null;
+ }
+
+ public void setOpaque(Boolean value) {
+ }
+
+ public void unsetOpaque() {
+ }
+
+ public boolean isSetOpaque() {
+ return false;
+ }
+
} //QueryImpl
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/util/MessagepropertiesConstants.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/util/MessagepropertiesConstants.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/messageproperties/util/MessagepropertiesConstants.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -53,6 +53,9 @@
public static final String PROPERTY_NAME_ATTRIBUTE = "name";
public static final String PROPERTY_TYPE_ATTRIBUTE = "type";
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // added to allow "element" addressing for <property> and <propertyAlias>
+ public static final String PROPERTY_XSD_ELEMENT_ATTRIBUTE = "element";
public static final String PROPERTY_ALIAS_PROPERTY_NAME_ATTRIBUTE = "propertyName";
public static final String PROPERTY_ALIAS_MESSAGE_TYPE_ATTRIBUTE = "messageType";
public static final String PROPERTY_ALIAS_PART_ATTRIBUTE = "part";
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -1287,7 +1287,7 @@
@Override
public boolean isDirty() {
- return this.fTextEditor.isDirty();
+ return this.fTextEditor.isDirty() || this.editDomain.getCommandStack().isDirty();
}
@Override
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -315,7 +315,17 @@
public static String EditMessagePropertyDialog_3;
public static String EditMessagePropertyDialog_4;
public static String EditMessagePropertyDialog_9;
+
+ // https://jira.jboss.org/browse/JBIDE-7107
+ public static String EditMessagePropertyDialog_11;
+ public static String EditMessagePropertyDialog_12;
+ public static String EditMessagePropertyDialog_13;
+ public static String EditMessagePropertyDialog_15;
+ public static String EditMessagePropertyDialog_16;
+
public static String EditMessagePropertyDialog_Type_1;
+ public static String EditMessagePropertyDialog_Element_1;
+ public static String EditMessagePropertyDialog_Message_1;
public static String EditPropertyAliasDialog_10;
public static String EditPropertyAliasDialog_3;
public static String EditPropertyAliasDialog_4;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIMessagePropertiesAdapterFactory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIMessagePropertiesAdapterFactory.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIMessagePropertiesAdapterFactory.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -57,6 +57,16 @@
public Adapter createPropertyAdapter() {
return provider.getAdapter( PropertyAdapter.class );
}
+
+ /**
+ * @see org.eclipse.bpel.model.messageproperties.util.MessagepropertiesAdapterFactory#createPropertyAdapter()
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * This adds the INamespace adapter to PropertyAlias objects (required for the XPath expression editor)
+ */
+ @Override
+ public Adapter createPropertyAliasAdapter() {
+ return provider.getAdapter( PropertyAliasAdapter.class );
+ }
/**
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIWSDLAdapterFactory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIWSDLAdapterFactory.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIWSDLAdapterFactory.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -60,6 +60,16 @@
}
/**
+ * @see org.eclipse.wst.wsdl.internal.util.WSDLAdapterFactory#createDefinitionAdapter()
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
+ */
+ @Override
+ public Adapter createDefinitionAdapter() {
+ return provider.getAdapter( DefinitionAdapter.class );
+ }
+
+ /**
* @see org.eclipse.wst.wsdl.internal.util.WSDLAdapterFactory#createMessageAdapter()
*/
@Override
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/DefinitionAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/DefinitionAdapter.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/DefinitionAdapter.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.adapters;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpel.model.adapters.BasicEObjectaAdapter;
+import org.eclipse.bpel.model.adapters.INamespaceMap;
+import org.eclipse.wst.wsdl.Definition;
+
+/*
+ * This adds the INamespace adapter to Definition objects (required for the XPath expression editor)
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class DefinitionAdapter extends BasicEObjectaAdapter implements INamespaceMap<String, String> {
+
+ /**
+ *
+ * @param key
+ * the namespace to get the reverse mapping for
+ * @return The reverse mapping of the Namespace to namespace prefixes.
+ * @see org.eclipse.bpel.model.adapters.INamespaceMap#getReverse(java.lang.Object)
+ */
+
+ public List<String> getReverse(String key) {
+ List<String> list = new ArrayList<String>(1);
+ list.add( ((Definition)getTarget()).getPrefix(key) );
+ return list;
+ }
+
+}
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PropertyAliasAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PropertyAliasAdapter.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PropertyAliasAdapter.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.adapters;
+
+import org.eclipse.bpel.model.adapters.BasicEObjectaAdapter;
+
+/*
+ * This adds the INamespace adapter to PropertyAlias objects (required for the XPath expression editor)
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class PropertyAliasAdapter extends BasicEObjectaAdapter {
+
+}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.bpel.ui.dialogs;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -17,6 +19,9 @@
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.commands.AddImportCommand;
import org.eclipse.bpel.ui.details.providers.ModelTreeLabelProvider;
+import org.eclipse.bpel.ui.details.tree.PartTreeNode;
+import org.eclipse.bpel.ui.details.tree.TreeNode;
+import org.eclipse.bpel.ui.details.tree.XSDElementDeclarationTreeNode;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.core.resources.IFile;
@@ -34,6 +39,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
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;
@@ -45,14 +51,22 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Part;
+import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDNamedComponent;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.util.XSDConstants;
/**
* @author Michal Chmielewski (michal.chmielewski(a)oracle.com)
* @date Jul 18, 2006
*
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * Enhanced to support element selection from the "lower" tree viewer
*/
public class BrowseSelectorDialog extends ListAndViewDialog {
@@ -72,6 +86,7 @@
protected IStructuredContentProvider resourceContentProvider = null;
protected ITreeContentProvider treeContentProvider = null;
+ protected Group checkButtonGroup;
protected Tree fTree;
protected TreeViewer fTreeViewer;
@@ -178,6 +193,28 @@
}
+ /**
+ * @see ListAndViewDialog#computeResult()
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * Added support for returning two results
+ */
+ @Override
+ protected void computeResult() {
+
+ List result = new ArrayList();
+ Object sel1[] = getSelectedElements();
+ TreeItem sel2[] = fTree.getSelection();
+ for (int i=0; i<sel1.length; ++i)
+ result.add(sel1[i]);
+ for (int i=0; i<sel2.length; ++i) {
+ Object data = sel2[i].getData();
+ if (data instanceof TreeNode)
+ data = ((TreeNode)data).getModelObject();
+ result.add(data);
+ }
+ setResult(result);
+ }
+
/**
* Ensure that the prefix mapping exists for the given namespace
* in the BPEL source.
@@ -416,21 +453,24 @@
}
protected void createBrowseFilterGroup(Composite parent) {
- Group group = new Group(parent,SWT.SHADOW_ETCHED_IN);
- group.setText( Messages.BrowseSelectorDialog_4 );
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // need to support enabling/disabling of this button group
+ // see BrowseUtils#browseForMessageType() for example
+ checkButtonGroup = new Group(parent,SWT.SHADOW_ETCHED_IN);
+ checkButtonGroup.setText( Messages.BrowseSelectorDialog_4 );
GridLayout layout = new GridLayout();
layout.makeColumnsEqualWidth = true;
layout.numColumns = 3;
- group.setLayout(layout);
+ checkButtonGroup.setLayout(layout);
GridData data = new GridData();
data.grabExcessVerticalSpace = false;
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
- group.setLayoutData(data);
+ checkButtonGroup.setLayoutData(data);
- createBrowseFilterGroupButtons ( group );
+ createBrowseFilterGroupButtons ( checkButtonGroup );
}
@@ -446,6 +486,16 @@
protected Object createLowerView(Composite parent) {
// Tree viewer for variable structure ...
fTree = new Tree(parent, SWT.BORDER );
+ fTree.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // update "OK" button enablement
+ refresh();
+ }
+
+ });
fTreeViewer = new TreeViewer(fTree);
fTreeViewer.setContentProvider( treeContentProvider );
@@ -515,7 +565,9 @@
} else {
handleNonEmptyList();
}
- }
+ }
+ // https://jira.jboss.org/browse/JBIDE-7107
+ updateOkState();
}
/**
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditMessagePropertyDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditMessagePropertyDialog.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditMessagePropertyDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -32,9 +32,11 @@
import org.eclipse.bpel.ui.util.WSDLImportHelper;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -43,12 +45,15 @@
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
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.Control;
import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
@@ -60,19 +65,30 @@
import org.eclipse.wst.wsdl.Message;
import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.util.XSDConstants;
/**
* Dialog for creating or editing message properties.
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * This has been completely reworked to support Properties of both XSD Simple Types and
+ * XSD Elements (previous version only supported Simple Types).
*/
public class EditMessagePropertyDialog extends Dialog {
+ protected static final int BID_USE_TYPE = IDialogConstants.CLIENT_ID + 30;
+ protected static final int BID_USE_ELEMENT = IDialogConstants.CLIENT_ID + 31;
// True if a new property is being created (as opposed to an existing being edited)
protected boolean isNew;
+ // True if the given propery will be replaced
+ protected boolean isReplacement;
protected Property property;
protected Object propertyType;
+ protected XSDTypeDefinition xsdTypeDefinition;
+ protected XSDElementDeclaration xsdElementDeclaration;
protected IFile targetFile;
protected URI propertyTypeFileURI;
protected BPELEditor bpelEditor;
@@ -81,7 +97,12 @@
// widgets
protected Text propertyNameText;
- protected Label typeNameText;
+ protected Label typeOrElementNameLabel;
+ protected Label typeOrElementNameText;
+ private Button typeRadio;
+ private Button elementRadio;
+ private int typeOrElement;
+
protected Button browseTypeButton;
protected Button newAliasButton;
protected Button editAliasButton;
@@ -101,27 +122,41 @@
@Override
public String getProperty() { return "aliasMsgType"; } //$NON-NLS-1$
@Override
- public int getInitialWeight() { return 30; }
+ public int getInitialWeight() { return 50; }
ModelLabelProvider labelProvider = new ModelLabelProvider();
public String getText(Object element) {
- return labelProvider.getText(((PropertyAlias)element).getMessageType());
+ PropertyAlias alias = (PropertyAlias)element;
+ String part = alias.getPart();
+ Object message = ((PropertyAlias)element).getMessageType();
+ String s = "";
+ if (message!=null) {
+ s = labelProvider.getText(message) + (part==null? "" : ("."+part) );
+ if (part!=null && alias.getQuery() != null) {
+ String query = alias.getQuery().getValue();
+ if (query != null && !"".equals(query)) { //$NON-NLS-1$
+ s += NLS.bind(Messages.EditMessagePropertyDialog_4, (new Object[] { query }));
+ }
+ }
+ }
+ return s;
}
}
- public class MessagePartColumn extends ColumnTableProvider.Column implements ILabelProvider {
+ public class XSDElementColumn extends ColumnTableProvider.Column implements ILabelProvider {
@Override
- public String getHeaderText() { return Messages.EditMessagePropertyDialog_2; }
+ public String getHeaderText() { return Messages.EditMessagePropertyDialog_15; }
@Override
- public String getProperty() { return "aliasMsgPart"; } //$NON-NLS-1$
+ public String getProperty() { return "aliasElement"; } //$NON-NLS-1$
@Override
- public int getInitialWeight() { return 70; }
+ public int getInitialWeight() { return 25; }
public String getText(Object element) {
PropertyAlias alias = (PropertyAlias)element;
- String s = (alias.getPart()==null? Messages.EditMessagePropertyDialog_3:alias.getPart());
- if (alias.getQuery() != null) {
+ XSDNamedComponent xsdElem = (XSDNamedComponent)alias.getXSDElement();
+ String s = (xsdElem==null? "":xsdElem.getName());
+ if (xsdElem!=null && alias.getQuery() != null) {
String query = alias.getQuery().getValue();
if (query != null && !"".equals(query)) { //$NON-NLS-1$
s += NLS.bind(Messages.EditMessagePropertyDialog_4, (new Object[] { query }));
@@ -131,6 +166,28 @@
}
}
+ public class XSDTypeColumn extends ColumnTableProvider.Column implements ILabelProvider {
+ @Override
+ public String getHeaderText() { return Messages.EditMessagePropertyDialog_16; }
+ @Override
+ public String getProperty() { return "aliasType"; } //$NON-NLS-1$
+ @Override
+ public int getInitialWeight() { return 25; }
+
+ public String getText(Object element) {
+ PropertyAlias alias = (PropertyAlias)element;
+ XSDNamedComponent xsdElem = (XSDNamedComponent)alias.getType();
+ String s = (xsdElem==null? "":xsdElem.getName());
+ if (xsdElem!=null && alias.getQuery() != null) {
+ String query = alias.getQuery().getValue();
+ if (query != null && !"".equals(query)) { //$NON-NLS-1$
+ s += NLS.bind(Messages.EditMessagePropertyDialog_4, (new Object[] { query }));
+ }
+ }
+ return s;
+ }
+ }
+
public EditMessagePropertyDialog(Shell parentShell, Property property, String newPropertyName, BPELEditor bpelEditor, TabbedPropertySheetWidgetFactory wf) {
super(parentShell);
@@ -139,15 +196,29 @@
this.property = property;
this.wf = wf;
isNew = (property == null);
- if (isNew) {
+ isReplacement = (property!=null && property.eIsProxy());
+ if (isReplacement)
+ newPropertyName = property.getName();
+ if (isNew || isReplacement) {
targetFile = bpelEditor.getEditModelClient().getArtifactsResourceInfo().getFile();
this.property = MessagepropertiesFactory.eINSTANCE.createProperty();
this.property.setName(newPropertyName);
+ typeOrElement = BID_USE_TYPE;
} else {
Object type = property.getType();
if (type instanceof XSDTypeDefinition) {
this.propertyType = type;
+ this.xsdTypeDefinition = (XSDTypeDefinition)type;
+ typeOrElement = BID_USE_TYPE;
}
+ else if (type instanceof XSDElementDeclaration) {
+ this.propertyType = type;
+ this.xsdElementDeclaration = (XSDElementDeclaration)type;
+ typeOrElement = BID_USE_ELEMENT;
+ }
+ else {
+ typeOrElement = BID_USE_TYPE;
+ }
}
}
@@ -172,12 +243,6 @@
};
// create widgets
- Label topLabel = new Label(composite, SWT.NONE);
- if (isNew) {
- topLabel.setText(Messages.EditMessagePropertyDialog_9);
- } else {
- topLabel.setText(Messages.EditMessagePropertyDialog_10);
- }
Label propertyNameLabel = new Label(composite, SWT.NONE);
propertyNameLabel.setText(Messages.EditMessagePropertyDialog_14);
propertyNameText = new Text(composite, SWT.BORDER);
@@ -187,10 +252,24 @@
}
// TODO: if the property name changes we need to update the aliases as well
propertyNameText.addListener(SWT.Modify, enablementListener);
+ if (isReplacement)
+ propertyNameText.setEnabled(false);
+
+ String groupText = Messages.EditMessagePropertyDialog_10;
+ // Property must have either XSD Type or XSD Element: create radio button group
+ Group typeOrElementRadioGroup = new Group(composite,SWT.SHADOW_ETCHED_IN);
+ typeOrElementRadioGroup.setText(groupText);
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = false;
+ layout.numColumns = 1;
+ typeOrElementRadioGroup.setLayout(layout);
+ typeRadio = createRadioButton(typeOrElementRadioGroup,Messages.EditMessagePropertyDialog_11, BID_USE_TYPE, typeOrElement == BID_USE_TYPE);
+ elementRadio = createRadioButton(typeOrElementRadioGroup,Messages.EditMessagePropertyDialog_12, BID_USE_ELEMENT, typeOrElement == BID_USE_ELEMENT);
+ typeRadio.addListener(SWT.Selection, enablementListener);
+ elementRadio.addListener(SWT.Selection, enablementListener);
- Label typeNameLabel = new Label(composite, SWT.NONE);
- typeNameLabel.setText(Messages.EditMessagePropertyDialog_Type_1);
- typeNameText = new Label(composite, SWT.NONE);
+ typeOrElementNameLabel = new Label(composite, SWT.NONE);
+ typeOrElementNameText = new Label(composite, SWT.NONE);
browseTypeButton = new Button(composite, SWT.PUSH);
browseTypeButton.setText(Messages.EditMessagePropertyDialog_18);
browseTypeButton.addListener(SWT.Selection, new Listener() {
@@ -240,7 +319,8 @@
aliasesTable.setHeaderVisible(true);
aliasesTableProvider = new ColumnTableProvider();
aliasesTableProvider.add(new MessageTypeColumn());
- aliasesTableProvider.add(new MessagePartColumn());
+ aliasesTableProvider.add(new XSDElementColumn());
+ aliasesTableProvider.add(new XSDTypeColumn());
aliasesTableViewer = new TableViewer(aliasesTable);
aliasesTableProvider.createTableLayout(aliasesTable);
aliasesTableViewer.setLabelProvider(aliasesTableProvider);
@@ -273,26 +353,31 @@
updateTypeFileText();
// layout widgets
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- topLabel.setLayoutData(data);
-
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ data.horizontalSpan = 1;
propertyNameLabel.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
propertyNameText.setLayoutData(data);
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 3;
+// data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+// topLabel.setLayoutData(data);
+ typeOrElementRadioGroup.setLayoutData(data);
data = new GridData(GridData.FILL_HORIZONTAL);
+ typeRadio.setLayoutData(data);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ elementRadio.setLayoutData(data);
+
+ data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 3;
separator.setLayoutData(data);
-
+ data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ typeOrElementNameLabel.setLayoutData(data);
data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- typeNameLabel.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- typeNameText.setLayoutData(data);
+ typeOrElementNameText.setLayoutData(data);
data = new GridData(GridData.HORIZONTAL_ALIGN_END);
browseTypeButton.setLayoutData(data);
@@ -315,15 +400,69 @@
data = new GridData(GridData.FILL_BOTH);
data.horizontalSpan = 3;
data.verticalSpan = 3;
- data.heightHint = 70;
+ data.heightHint = 200;
+ data.widthHint = 500;
aliasesTable.setLayoutData(data);
PlatformUI.getWorkbench().getHelpSystem().setHelp(
- parent, IHelpContextIds.PROPERTY_DIALOG);
+ parent, IHelpContextIds.PROPERTY_DIALOG);
+ composite.pack();
+
return composite;
}
+
+ protected Button createRadioButton(Composite parent, String label, int id, boolean checked) {
+
+ Button button = new Button(parent,SWT.RADIO);
+ button.setText(label);
+ button.setFont(JFaceResources.getDialogFont());
+ button.setData(new Integer(id));
+ button.setSelection( checked );
+
+ button.addSelectionListener (new SelectionAdapter() {
+ @Override
+ public void widgetSelected (SelectionEvent event) {
+ Button b = (Button) event.widget;
+ int val = ((Integer) b.getData()).intValue();
+
+ buttonPressed(val, b.getSelection(), true );
+ }
+ });
+
+ return button;
+
+ }
+ /**
+ * Handle the check button and radio button callbacks.
+ *
+ * @param id
+ * @param checked
+ * @param refresh unless this is set, no refresh is done.
+ */
+
+ protected void buttonPressed(int id, boolean checked, boolean bRefresh) {
+
+ switch (id) {
+
+ case BID_USE_ELEMENT:
+ case BID_USE_TYPE:
+ if (!checked)
+ return;
+ typeOrElement = id;
+ break;
+
+ default :
+ break;
+ }
+
+
+ if (bRefresh) {
+ updateTypeWidgets();
+ }
+ }
+
protected void updatePropertyAliasTable() {
aliasesFilter.setProperty(property);
//aliasesTableViewer.setInput(definition);
@@ -331,19 +470,17 @@
}
protected void updateTypeFileText() {
- if (property != null || propertyType != null) {
- Object type = this.propertyType;
- if (type == null) {
- type = property.getType();
- }
- if (type instanceof XSDTypeDefinition) {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) type;
- typeNameText.setText(typeDefinition.getName());
- } else if (type instanceof XSDElementDeclaration) {
- XSDElementDeclaration element = (XSDElementDeclaration) type;
- typeNameText.setText(element.getName());
- }
+ if (propertyType instanceof XSDTypeDefinition) {
+ xsdTypeDefinition = (XSDTypeDefinition) propertyType;
+ typeOrElementNameText.setText(xsdTypeDefinition.getName());
+ } else if (propertyType instanceof XSDElementDeclaration) {
+ xsdElementDeclaration = (XSDElementDeclaration) propertyType;
+ typeOrElementNameText.setText(xsdElementDeclaration.getName());
}
+ else
+ {
+ typeOrElementNameText.setText("");
+ }
}
@Override
@@ -391,7 +528,7 @@
protected boolean propertyNameExists(String name) {
if (!isNew && name.equals(property.getName())) return false;
- return getExistingPropertyNames().contains(name);
+ return !isReplacement && getExistingPropertyNames().contains(name);
}
protected Set getExistingPropertyNames() {
@@ -408,10 +545,19 @@
protected void updateTypeWidgets() {
// update type from file
- Object type = (property == null) ? propertyType : property.getType();
- if (type instanceof XSDTypeDefinition) {
- updateTypeFileText();
+ if (typeOrElement == BID_USE_ELEMENT ) {
+ typeOrElementNameLabel.setText(Messages.EditMessagePropertyDialog_Element_1);
+ typeRadio.setSelection(false);
+ elementRadio.setSelection(true);
+ propertyType = xsdElementDeclaration;
}
+ else {
+ typeOrElementNameLabel.setText(Messages.EditMessagePropertyDialog_Type_1);
+ typeRadio.setSelection(true);
+ elementRadio.setSelection(false);
+ propertyType = xsdTypeDefinition;
+ }
+ updateTypeFileText();
}
/**
@@ -419,9 +565,23 @@
* Updates the property type according to the user choice.
*/
protected void browsePropertyType() {
- Object xsdType = BrowseUtil.browseForXSDTypeOrElement(bpelEditor.getProcess(), getShell());
- if (xsdType != null) {
- propertyType = xsdType;
+ Object type = null;
+ Object result[] = null;
+ if (typeOrElement == BID_USE_TYPE)
+ result = BrowseUtil.browseForXSDType(bpelEditor.getProcess(), getShell());
+ else
+ result = BrowseUtil.browseForXSDElement(bpelEditor.getProcess(), getShell(),false);
+
+ if (result!=null && result.length>=1)
+ type = result[0];
+
+ if (type != null) {
+ propertyType = type;
+ if (typeOrElement == BID_USE_ELEMENT)
+ xsdElementDeclaration = (XSDElementDeclaration) type;
+ else
+ xsdTypeDefinition = (XSDTypeDefinition) type;
+
updateTypeFileText();
updateEnablement();
}
@@ -462,6 +622,20 @@
}
newAliasesList.clear();
}
+ else if (isReplacement) {
+ boolean found = false;
+ for (Object obj : definition.getEExtensibilityElements()) {
+ if (obj instanceof Property && ((Property)obj).getName().equals(property.getName())) {
+ property = (Property)obj;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ definition.getEExtensibilityElements().add(property);
+ property.setEnclosingDefinition(definition);
+ }
+ }
property.setName(propertyNameText.getText());
property.setType(propertyType);
@@ -482,6 +656,9 @@
protected void createAlias() {
EditPropertyAliasDialog dialog = new EditPropertyAliasDialog(getShell(), property, null, bpelEditor, wf);
if (dialog.open() == Window.OK) {
+ if (property.eResource()==null)
+ createProperty();
+
final PropertyAlias alias = dialog.getPropertyAlias();
if (alias != null) {
URI uri = getTargetFileURI();
@@ -495,14 +672,47 @@
newAliasesList.add(alias);
} else {
// add the alias now
+ if (isReplacement) {
+ alias.setPropertyName(property);
+ }
alias.setEnclosingDefinition(definition);
definition.getEExtensibilityElements().add(alias);
}
+ Object imported = null;
Object messageTypeObject = alias.getMessageType();
+ Object xsdElementObject = alias.getXSDElement();
+ Object typeObject = alias.getType();
if (messageTypeObject instanceof Message) {
- WSDLImportHelper.addImportAndNamespace(definition, ((Message)messageTypeObject).getEnclosingDefinition());
+ imported = ((Message)messageTypeObject).getEnclosingDefinition();
}
+ else if (xsdElementObject instanceof XSDElementDeclaration) {
+ EObject top = (XSDElementDeclaration)xsdElementObject;
+ while (top.eContainer() != null) {
+ top = top.eContainer();
+ if (top instanceof Definition) {
+ imported = top;
+ break;
+ }
+ }
+ }
+ else if (typeObject instanceof XSDTypeDefinition) {
+ EObject top = (XSDTypeDefinition)typeObject;
+ while (top.eContainer() != null) {
+ top = top.eContainer();
+ if (top instanceof Definition) {
+ imported = top;
+ break;
+ }
+ }
+ }
+ if (imported instanceof Definition) {
+ WSDLImportHelper.addImportAndNamespace(definition, (Definition)imported);
+ }
+ else if (imported instanceof XSDSchema) {
+ WSDLImportHelper.addImportAndNamespace(definition, (XSDSchema)imported,
+ bpelEditor.getEditModelClient().getPrimaryResourceInfo().getFile());
+ }
// This doesn't seem to introduce an updateElement automatically,
// so do it manually now, so that RolePortTypes (for example) who
// are affected by the new namespace will know about it.
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -10,88 +10,193 @@
*******************************************************************************/
package org.eclipse.bpel.ui.dialogs;
-import java.util.Iterator;
-
import org.eclipse.bpel.model.messageproperties.MessagepropertiesFactory;
+import org.eclipse.bpel.model.messageproperties.MessagepropertiesPackage;
import org.eclipse.bpel.model.messageproperties.Property;
import org.eclipse.bpel.model.messageproperties.PropertyAlias;
import org.eclipse.bpel.model.messageproperties.Query;
import org.eclipse.bpel.ui.BPELEditor;
import org.eclipse.bpel.ui.IHelpContextIds;
import org.eclipse.bpel.ui.Messages;
-import org.eclipse.bpel.ui.details.providers.ModelTreeContentProvider;
-import org.eclipse.bpel.ui.details.providers.ModelTreeLabelProvider;
-import org.eclipse.bpel.ui.details.providers.PartTreeContentProvider;
-import org.eclipse.bpel.ui.details.tree.ITreeNode;
-import org.eclipse.bpel.ui.details.tree.PartTreeNode;
-import org.eclipse.bpel.ui.properties.DialogVariableTypeSelector;
-import org.eclipse.bpel.ui.properties.VariableTypeSelector;
+import org.eclipse.bpel.ui.expressions.IEditorConstants;
+import org.eclipse.bpel.ui.properties.ExpressionSection;
+import org.eclipse.bpel.ui.util.BrowseUtil;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.commands.Command;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
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.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.wst.wsdl.Part;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticle;
import org.eclipse.xsd.XSDTypeDefinition;
/**
* Dialog for creating or editing a property alias.
+ * https://jira.jboss.org/browse/JBIDE-7107
+ * This has been completely reworked to support Properties of Message Types, XSD Simple Types and
+ * XSD Elements (previous version only supported Message Types).
+ *
+ * This also incorporates the XPath Expression editor for use in editing the Query expression.
*/
public class EditPropertyAliasDialog extends Dialog {
+ protected static final int BID_USE_TYPE = IDialogConstants.CLIENT_ID + 30;
+ protected static final int BID_USE_ELEMENT = IDialogConstants.CLIENT_ID + 31;
+ protected static final int BID_USE_MESSAGE = IDialogConstants.CLIENT_ID + 32;
+ // True if a new propertyAlias is being created (as opposed to an existing being edited)
+ protected boolean isNew;
protected BPELEditor bpelEditor;
- protected Definition wsdlDefinition;
protected Property property;
protected PropertyAlias alias;
- protected DialogVariableTypeSelector variableTypeSelector;
- protected Tree messagePartTree;
- protected TreeViewer messagePartViewer;
- protected boolean createAlias;
+ protected EObject activeTypeElementOrMessage;
+ protected Query activeQuery;
+ protected XSDTypeDefinition xsdTypeDefinition;
+ protected Query xsdTypeQuery;
+
+ protected XSDElementDeclaration xsdElementDeclaration;
+ protected Query xsdElementQuery;
+
+ protected Message message;
+ protected String messagePart;
+ protected Query messageQuery;
+
+ protected Label typeElementOrMessageNameLabel;
+ protected Label typeElementOrMessageNameText;
+ private Button typeRadio;
+ private Button elementRadio;
+ private Button messageRadio;
+ private int typeElementOrMessage;
+
+ private QueryEditor queryEditor;
+
+ protected Button browseTypeButton;
+
protected TabbedPropertySheetWidgetFactory wf;
- protected class PropertyAliasDialogCallback implements VariableTypeSelector.Callback {
- public void selectRadioButton(int index) {}
- public void selectXSDType(XSDTypeDefinition xsdType) {}
- public void selectXSDElement(XSDElementDeclaration xsdElement) {}
- public void selectMessageType(Message message) {
- variableTypeSelector.setVariableType(message);
- messagePartViewer.setInput(message);
- updateWidgets();
+ public class QueryEditor extends ExpressionSection {
+
+ public void create(Composite parent)
+ {
+ createControls(parent, null);
}
+
+ public void setInput(EObject obj)
+ {
+ basicSetInput(obj);
+ }
+
+ public String getQuery()
+ {
+ if (getExpressionEditor()!=null)
+ return getExpressionEditor().getEditorContent();
+ return null;
+ }
+
+ public String getQueryLanguage()
+ {
+ Object elm = selectedExpressionLanguage();
+ if (elm == NO_EXPRESSION || elm == null )
+ return null;
+ return getExpressionLanguage(elm);
+ }
+
+ @Override
+ protected String getExpressionType() {
+ return IEditorConstants.ET_ANY;
+ }
+
+ @Override
+ public BPELEditor getBPELEditor() {
+ return bpelEditor;
+ }
+
+ @Override
+ public TabbedPropertySheetWidgetFactory getWidgetFactory() {
+ return wf;
+ }
+
+ @Override
+ protected EStructuralFeature getStructuralFeature () {
+ fStructuralFeature = MessagepropertiesPackage.eINSTANCE.getPropertyAlias_Query();
+ return fStructuralFeature;
+ }
+
+ @Override
+ protected void setStructuralFeature ( EStructuralFeature feature ) {
+ fStructuralFeature = feature;
+ }
+
+ @Override
+ protected EStructuralFeature getStructuralFeature ( EObject eObject ) {
+ if (eObject != null)
+ return MessagepropertiesPackage.eINSTANCE.getPropertyAlias_Query();
+ return null;
+ }
+
+ @Override
+ protected Command wrapInShowContextCommand(Command inner) {
+ EditPropertyAliasDialog.this.updateWidgets();
+ return null;
+ }
+
}
-
+
public EditPropertyAliasDialog(Shell parentShell, Property property, PropertyAlias alias, BPELEditor bpelEditor, TabbedPropertySheetWidgetFactory wf) {
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE);
- this.createAlias = (alias == null);
+ this.isNew = (alias == null);
this.alias = alias;
this.property = property;
this.bpelEditor = bpelEditor;
this.wf = wf;
- if (alias != null && alias.getMessageType() != null) {
- Resource resource = ((EObject)alias.getMessageType()).eResource();
- wsdlDefinition = (Definition) resource.getContents().get(0);
+ if (isNew) {
+ typeElementOrMessage = BID_USE_MESSAGE;
+ this.alias = MessagepropertiesFactory.eINSTANCE.createPropertyAlias();
}
+ else {
+ if (alias.getMessageType() != null) {
+ typeElementOrMessage = BID_USE_MESSAGE;
+ message = (Message)alias.getMessageType();
+ messagePart = alias.getPart();
+ messageQuery = alias.getQuery();
+ }
+ else if (alias.getType() != null) {
+ typeElementOrMessage = BID_USE_TYPE;
+ xsdTypeDefinition = (XSDTypeDefinition)alias.getType();
+ xsdTypeQuery = alias.getQuery();
+ }
+ else if (alias.getXSDElement() != null) {
+ typeElementOrMessage = BID_USE_ELEMENT;
+ xsdElementDeclaration = (XSDElementDeclaration)alias.getXSDElement();
+ xsdElementQuery = alias.getQuery();
+ }
+ }
}
@Override
@@ -99,89 +204,333 @@
Composite composite = (Composite) super.createDialogArea(parent);
GridLayout layout = (GridLayout) composite.getLayout();
layout.makeColumnsEqualWidth = false;
- layout.numColumns = 2;
+ layout.numColumns = 3;
- // create widgets
- Label topLabel = new Label(composite, SWT.NONE);
- if (createAlias) {
- topLabel.setText(Messages.EditPropertyAliasDialog_3);
- } else {
- topLabel.setText(Messages.EditPropertyAliasDialog_4);
- }
- variableTypeSelector = new DialogVariableTypeSelector(composite, SWT.NONE, bpelEditor, getShell(), new PropertyAliasDialogCallback(), wf);
- variableTypeSelector.setVariableType(null);
- Label partLabel = new Label(composite, SWT.NONE);
- partLabel.setText(Messages.EditPropertyAliasDialog_8);
- messagePartTree = new Tree(composite, SWT.BORDER);
- messagePartViewer = new TreeViewer(messagePartTree);
- messagePartViewer.setContentProvider(new PartTreeContentProvider(true));
- messagePartViewer.setLabelProvider(new ModelTreeLabelProvider());
- messagePartViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
+ Listener enablementListener = new Listener() {
+ public void handleEvent(Event e) {
updateEnablement();
}
+ };
+
+ // create widgets
+ String groupText = Messages.EditMessagePropertyDialog_10;
+ // PropertyAlias must have either XSD Type or XSD Element or (message type and part): create radio button group
+ Group typeElementOrMessageRadioGroup = new Group(composite,SWT.SHADOW_ETCHED_IN);
+ typeElementOrMessageRadioGroup.setText(groupText);
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 1;
+ typeElementOrMessageRadioGroup.setLayout(layout);
+ messageRadio = createRadioButton(typeElementOrMessageRadioGroup,Messages.EditMessagePropertyDialog_13, BID_USE_MESSAGE, typeElementOrMessage == BID_USE_MESSAGE);
+ typeRadio = createRadioButton(typeElementOrMessageRadioGroup,Messages.EditMessagePropertyDialog_11, BID_USE_TYPE, typeElementOrMessage == BID_USE_TYPE);
+ elementRadio = createRadioButton(typeElementOrMessageRadioGroup,Messages.EditMessagePropertyDialog_12, BID_USE_ELEMENT, typeElementOrMessage == BID_USE_ELEMENT);
+ messageRadio.addListener(SWT.Selection, enablementListener);
+ typeRadio.addListener(SWT.Selection, enablementListener);
+ elementRadio.addListener(SWT.Selection, enablementListener);
+
+ // type label and text
+ typeElementOrMessageNameLabel = new Label(composite, SWT.NONE);
+ typeElementOrMessageNameText = new Label(composite, SWT.NONE);
+ browseTypeButton = new Button(composite, SWT.PUSH);
+ browseTypeButton.setText(Messages.EditMessagePropertyDialog_18);
+ browseTypeButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browsePropertyType();
+ }
});
+
// layout widgets
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- topLabel.setLayoutData(data);
+ GridData data;
+ queryEditor = new QueryEditor();
+ Group queryGroup = new Group(composite,SWT.SHADOW_ETCHED_IN);
+ queryGroup.setText("Query");
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 1;
+ queryGroup.setLayout(layout);
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 3;
+ queryGroup.setLayoutData(data);
+ queryEditor.create(queryGroup);
+
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 3;
+// data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+// topLabel.setLayoutData(data);
+ typeElementOrMessageRadioGroup.setLayoutData(data);
data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- variableTypeSelector.setLayoutData(data);
+ messageRadio.setLayoutData(data);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ typeRadio.setLayoutData(data);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ elementRadio.setLayoutData(data);
data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- partLabel.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.verticalSpan = 3;
- data.heightHint = 70;
- messagePartTree.setLayoutData(data);
+ typeElementOrMessageNameLabel.setLayoutData(data);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ typeElementOrMessageNameText.setLayoutData(data);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ browseTypeButton.setLayoutData(data);
+ // update widgets
updateWidgets();
PlatformUI.getWorkbench().getHelpSystem().setHelp(
parent, IHelpContextIds.PROPERTY_ALIAS_DIALOG);
+ composite.pack();
+
return composite;
}
+
+ protected Button createRadioButton(Composite parent, String label, int id, boolean checked) {
+
+ Button button = new Button(parent,SWT.RADIO);
+ button.setText(label);
+ button.setFont(JFaceResources.getDialogFont());
+ button.setData(new Integer(id));
+ button.setSelection( checked );
+
+ button.addSelectionListener (new SelectionAdapter() {
+ @Override
+ public void widgetSelected (SelectionEvent event) {
+ Button b = (Button) event.widget;
+ int val = ((Integer) b.getData()).intValue();
+
+ buttonPressed(val, b.getSelection(), true );
+ }
+ });
+
+ return button;
+
+ }
+ /**
+ * Handle the check button and radio button callbacks.
+ *
+ * @param id
+ * @param checked
+ * @param refresh unless this is set, no refresh is done.
+ */
+
+ protected void buttonPressed(int id, boolean checked, boolean bRefresh) {
+
+ switch (id) {
+
+ case BID_USE_ELEMENT:
+ case BID_USE_TYPE:
+ case BID_USE_MESSAGE:
+ if (!checked)
+ return;
+ typeElementOrMessage = id;
+ break;
+
+ default :
+ break;
+ }
+
+
+ if (bRefresh) {
+ updateWidgets();
+ }
+ }
+
protected void updateWidgets() {
- if (wsdlDefinition != null) {
- Message message = (Message)alias.getMessageType();
- messagePartViewer.setInput(message);
- variableTypeSelector.setVariableType(message);
- String partName = alias.getPart();
- if (partName != null) {
- Part part = null;
- for (Iterator iter = message.getEParts().iterator(); iter.hasNext();) {
- Part temp = (Part) iter.next();
- if (partName.equals(temp.getName())) {
- part = temp;
- break;
- }
- }
- if (part != null) {
- PartTreeNode node = new PartTreeNode(part, false);
- messagePartViewer.setSelection(new StructuredSelection(node), true);
- }
+ String s = queryEditor.getQuery();
+ if (s!=null && activeQuery!=null) {
+ activeQuery.setValue(s);
+ activeQuery.setQueryLanguage(queryEditor.getQueryLanguage());
+ }
+
+ if (typeElementOrMessage == BID_USE_TYPE) {
+ typeRadio.setSelection(true);
+ elementRadio.setSelection(false);
+ messageRadio.setSelection(false);
+ activeTypeElementOrMessage = xsdTypeDefinition;
+ if (xsdTypeQuery == null) {
+ xsdTypeQuery = MessagepropertiesFactory.eINSTANCE.createQuery();
}
- } else {
- //variableTypeSelector.setVariableType(null);
+ activeQuery = xsdTypeQuery;
+ typeElementOrMessageNameLabel.setText(Messages.EditMessagePropertyDialog_Type_1);
+
+ alias.setMessageType(null);
+ alias.setPart(null);
+ alias.setType(xsdTypeDefinition);
+ alias.setXSDElement(null);
}
+ else if (typeElementOrMessage == BID_USE_ELEMENT) {
+ typeRadio.setSelection(false);
+ elementRadio.setSelection(true);
+ messageRadio.setSelection(false);
+ activeTypeElementOrMessage = xsdElementDeclaration;
+ if (xsdElementQuery == null) {
+ xsdElementQuery = MessagepropertiesFactory.eINSTANCE.createQuery();
+ }
+ activeQuery = xsdElementQuery;
+ typeElementOrMessageNameLabel.setText(Messages.EditMessagePropertyDialog_Element_1);
+
+ alias.setMessageType(null);
+ alias.setPart(null);
+ alias.setType(null);
+ alias.setXSDElement(xsdElementDeclaration);
+ }
+ else if (typeElementOrMessage == BID_USE_MESSAGE) {
+ typeRadio.setSelection(false);
+ elementRadio.setSelection(false);
+ messageRadio.setSelection(true);
+ activeTypeElementOrMessage = message;
+ if (messageQuery == null) {
+ messageQuery = MessagepropertiesFactory.eINSTANCE.createQuery();
+ }
+ activeQuery = messageQuery;
+ typeElementOrMessageNameLabel.setText(Messages.EditMessagePropertyDialog_Message_1);
+
+ alias.setMessageType(message);
+ alias.setPart(messagePart);
+ alias.setType(null);
+ alias.setXSDElement(null);
+ }
+ alias.setQuery(activeQuery);
+ queryEditor.setInput(alias);
+
+ updateTypeElementOrMessageName();
updateEnablement();
}
+
+ protected void updateTypeElementOrMessageName() {
+ if (activeTypeElementOrMessage instanceof XSDTypeDefinition) {
+ xsdTypeDefinition = (XSDTypeDefinition) activeTypeElementOrMessage;
+ xsdTypeQuery = activeQuery;
+ typeElementOrMessageNameText.setText(xsdTypeDefinition.getName());
+ } else if (activeTypeElementOrMessage instanceof XSDElementDeclaration) {
+ xsdElementDeclaration = (XSDElementDeclaration) activeTypeElementOrMessage;
+ xsdElementQuery = activeQuery;
+ typeElementOrMessageNameText.setText(xsdElementDeclaration.getName());
+ } else if (activeTypeElementOrMessage instanceof Message) {
+ message = (Message) activeTypeElementOrMessage;
+ String s = message.getQName().getLocalPart();
+ messageQuery = activeQuery;
+ if (messagePart!=null) {
+ s += "." + messagePart;
+ }
+ typeElementOrMessageNameText.setText(s);
+ }
+ else
+ {
+ typeElementOrMessageNameText.setText("");
+ }
+ }
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- if (createAlias) {
+ if (isNew) {
newShell.setText(Messages.EditPropertyAliasDialog_9);
} else {
newShell.setText(Messages.EditPropertyAliasDialog_10);
}
}
+
+ /**
+ * Opens a dialog and let the user browse for an XSD type or element.
+ * Updates the property type according to the user choice.
+ */
+ protected void browsePropertyType() {
+
+ Object type = null;
+ Object part = null;
+ Object query = null;
+ Object result[] = null;
+ if (typeElementOrMessage == BID_USE_TYPE)
+ result = BrowseUtil.browseForXSDType(bpelEditor.getProcess(), getShell());
+ else if (typeElementOrMessage == BID_USE_ELEMENT)
+ result = BrowseUtil.browseForXSDElement(bpelEditor.getProcess(), getShell(), true);
+ else {
+ result = BrowseUtil.browseForMessageType(bpelEditor.getProcess(), getShell(), true);
+ }
+ if (result!=null) {
+ if (result.length>=1) {
+
+ type = result[0];
+ if (type instanceof Message) {
+ message = (Message) type;
+ if (result.length>=2) {
+ if (result[1] instanceof Part) {
+ part = result[1];
+ }
+ else if (result[1] instanceof XSDComponent) {
+ // The selected XSD component must be a child of the message part.
+ // Look for part and build query path to the component.
+ // TODO: move this search algorithm to ModelQuery class
+ for ( Part p : (EList<Part>)message.getEParts() ) {
+ XSDTypeDefinition def = p.getElementDeclaration().getTypeDefinition();
+ XSDComponent comp = (XSDComponent)result[1];
+ String s = "";
+ while ( comp.eContainer() instanceof XSDComponent ) {
+ comp = (XSDComponent)comp.eContainer();
+ if (def == comp) {
+ part = p.getName();
+ query = s;
+ break;
+ }
+ else
+ {
+ if (comp instanceof XSDParticle && ((XSDParticle)comp).getTerm() instanceof XSDNamedComponent)
+ {
+ XSDNamedComponent nc = (XSDNamedComponent)((XSDParticle)comp).getTerm();
+ s = "/" + nc.getName() + s;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (type instanceof XSDComponent) {
+ if (result.length>=2 && result[1] instanceof XSDComponent) {
+ XSDComponent comp = (XSDComponent)result[1];
+ query = "";
+ while ( comp.eContainer() instanceof XSDComponent ) {
+ comp = (XSDComponent)comp.eContainer();
+ if (comp instanceof XSDParticle && ((XSDParticle)comp).getTerm() instanceof XSDNamedComponent)
+ {
+ XSDNamedComponent nc = (XSDNamedComponent)((XSDParticle)comp).getTerm();
+ query = "/" + nc.getName() + query;
+ }
+ }
+ }
+ }
+ }
+
+ activeTypeElementOrMessage = (EObject)type;
+ if (query!=null)
+ activeQuery.setValue(query.toString());
+ else
+ activeQuery.setValue("");
+
+ if (typeElementOrMessage == BID_USE_TYPE) {
+ xsdTypeDefinition = (XSDTypeDefinition) type;
+ xsdTypeQuery = activeQuery;
+ }
+ else if (typeElementOrMessage == BID_USE_ELEMENT) {
+ xsdElementDeclaration = (XSDElementDeclaration) type;
+ xsdElementQuery = activeQuery;
+ }
+ else {
+ message = (Message)type;
+ if (part!=null)
+ messagePart = part.toString();
+ messageQuery = activeQuery;
+ }
+
+ // hack: don't fetch query from XPath Expression Editor
+ // because it will overwrite the currently selected element
+ activeQuery = null;
+ updateWidgets();
+ }
+ }
/**
* @return Returns the alias.
@@ -192,46 +541,27 @@
@Override
protected void okPressed() {
- if (alias == null) {
- alias = MessagepropertiesFactory.eINSTANCE.createPropertyAlias();
+ alias.setPropertyName(property);
+ if (typeElementOrMessage == BID_USE_TYPE) {
+ alias.setType(xsdTypeDefinition);
+ if (xsdTypeQuery!=null && (xsdTypeQuery.getValue()==null || xsdTypeQuery.getValue().isEmpty()) )
+ xsdTypeQuery = null;
+ alias.setQuery(xsdTypeQuery);
}
- Message message = (Message)variableTypeSelector.getVariableType();
-
- ModelTreeContentProvider tcp = (ModelTreeContentProvider)messagePartViewer.getContentProvider();
- String part = null;
- String query = ""; //$NON-NLS-1$
- ITreeNode result = (ITreeNode)((IStructuredSelection) messagePartViewer.getSelection()).getFirstElement();
- while (result != null) {
- String qname = "";
- if (result.getModelObject() instanceof XSDElementDeclaration) {
- XSDElementDeclaration xsd = (XSDElementDeclaration)result.getModelObject();
- qname = xsd.getQName();
- }
- if (result instanceof PartTreeNode) {
- part = result.getLabel();
- break;
- }
- if (!query.equals("")) { //$NON-NLS-1$
- query = qname + "/" + query; //$NON-NLS-1$
- } else {
- query = qname;
- }
- result = (ITreeNode)tcp.getParent(result);
+ else if (typeElementOrMessage == BID_USE_ELEMENT) {
+ alias.setXSDElement(xsdElementDeclaration);
+ if (xsdElementQuery!=null && (xsdElementQuery.getValue()==null || xsdElementQuery.getValue().isEmpty()) )
+ xsdElementQuery = null;
+ alias.setQuery(xsdElementQuery);
}
- if (query.length() > 0)
- query = "/" + query; //$NON-NLS-1$
- else
- query = null;
-
- alias.setPropertyName(property);
- alias.setMessageType(message);
- alias.setPart(part);
- Query queryObject = alias.getQuery();
- if (queryObject == null) {
- queryObject = MessagepropertiesFactory.eINSTANCE.createQuery();
+ else {
+ alias.setMessageType(message);
+ alias.setPart(messagePart);
+ if (messageQuery!=null && (messageQuery.getValue()==null || messageQuery.getValue().isEmpty()) )
+ messageQuery = null;
+ alias.setQuery(messageQuery);
}
- queryObject.setValue(query);
- alias.setQuery(queryObject);
+
super.okPressed();
}
@@ -245,10 +575,10 @@
protected void updateEnablement() {
// update the OK button
boolean isOK = true;
- if (variableTypeSelector.getVariableType() == null
- || (messagePartViewer.getSelection() == null) || (messagePartViewer.getSelection().isEmpty())) {
- isOK = false;
- }
+// if (variableTypeSelector.getVariableType() == null
+// || (messagePartViewer.getSelection() == null) || (messagePartViewer.getSelection().isEmpty())) {
+// isOK = false;
+// }
Button okButton = getButton(IDialogConstants.OK_ID);
if (okButton != null) {
okButton.setEnabled(isOK);
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/ListAndViewDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/ListAndViewDialog.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/ListAndViewDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -191,6 +191,8 @@
@Override
protected void handleSelectionChanged() {
handleUpperSelectionChanged();
+ // https://jira.jboss.org/browse/JBIDE-7107
+ updateOkState();
}
private void handleUpperSelectionChanged() {
@@ -208,6 +210,8 @@
}
validateCurrentSelection();
+ // https://jira.jboss.org/browse/JBIDE-7107
+ updateOkState();
}
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/MessageSelectorTypeDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/MessageSelectorTypeDialog.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/MessageSelectorTypeDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.dialogs;
+
+import org.eclipse.bpel.ui.details.providers.XSDTypeOrElementContentProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * New class added to support browsing for Message Types only.
+ * This dialog extends the general-purpose Type Selector but limits the selection
+ * to known Message Types only. This makes for a less confusing user experience.
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class MessageSelectorTypeDialog extends TypeSelectorDialog {
+
+ public MessageSelectorTypeDialog(Shell parent, EObject eObj) {
+ super(parent, eObj);
+ FILTER_TYPES = 0;
+ showMessages = true;
+ }
+
+ public void setRequirePartSelection(boolean enabled)
+ {
+ this.requireLowerTreeSelection = enabled;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ // TODO Auto-generated method stub
+ Control ctl = super.createContents(parent);
+ checkButtonGroup.setEnabled(false);
+ for (Control c : checkButtonGroup.getChildren())
+ c.setEnabled(false);
+ return ctl;
+ }
+
+}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -30,6 +30,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.wst.wsdl.Message;
@@ -72,7 +73,7 @@
protected final static int BID_XSD_PRIMITIVES = IDialogConstants.CLIENT_ID + 104;
/* Whether messages ought to be shown */
- private boolean showMessages = true;
+ protected boolean showMessages = true;
protected XSDTypeOrElementContentProvider xsdTypeProvider = new XSDTypeOrElementContentProvider();
@@ -87,9 +88,14 @@
/* Which types to filter ? */
- private int FILTER_TYPES = XSDTypeOrElementContentProvider.INLCUDE_ALL;
+ protected int FILTER_TYPES = XSDTypeOrElementContentProvider.INLCUDE_ALL;
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // set by caller if a selection from the lower tree (typically message parts or XSD elements)
+ // are required before "OK" button can be enabled.
+ protected boolean requireLowerTreeSelection = true;
+
/**
* Create a brand new shiny Type Selector Dialog.
*
@@ -256,7 +262,27 @@
return list;
}
+ // https://jira.jboss.org/browse/JBIDE-7107
@Override
+ protected void updateOkState() {
+ super.updateOkState();
+
+ boolean enabled = true;
+ computeResult();
+ Object obj = getFirstResult();
+ // We need to check whether namespace prefix has been already defined
+ if (obj instanceof Message) {
+ if (!checkNamespace((Message) obj)){
+ enabled = false;
+ }
+ }
+ if ( getResult().length!=2 && this.requireLowerTreeSelection )
+ enabled = false;
+
+ getOkButton().setEnabled(enabled);
+ }
+
+ @Override
protected void okPressed() {
computeResult();
Object obj = getFirstResult();
@@ -266,6 +292,8 @@
return;
}
}
+ if ( getResult().length!=2 && this.requireLowerTreeSelection )
+ return;
super.okPressed();
}
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDElementSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDElementSelectorDialog.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDElementSelectorDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.dialogs;
+
+import org.eclipse.bpel.ui.details.providers.XSDTypeOrElementContentProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * New class added to support browsing for XSD Elements only.
+ * This dialog extends the general-purpose Type Selector but limits the selection
+ * to known XSD Elements only. This makes for a less confusing user experience.
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class XSDElementSelectorDialog extends TypeSelectorDialog {
+
+ public XSDElementSelectorDialog(Shell parent, EObject eObj) {
+ super(parent, eObj);
+ FILTER_TYPES = XSDTypeOrElementContentProvider.INCLUDE_ELEMENT_DECLARATIONS;
+ showMessages = false;
+ }
+
+ public void setRequireElementSelection(boolean enabled)
+ {
+ this.requireLowerTreeSelection = enabled;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ // TODO Auto-generated method stub
+ Control ctl = super.createContents(parent);
+ checkButtonGroup.setEnabled(false);
+ for (Control c : checkButtonGroup.getChildren())
+ c.setEnabled(false);
+ return ctl;
+ }
+
+}
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDTypeSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDTypeSelectorDialog.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDTypeSelectorDialog.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.dialogs;
+
+import org.eclipse.bpel.ui.details.providers.XSDTypeOrElementContentProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * New class added to support browsing for XSD Simple Types only.
+ * This dialog extends the general-purpose Type Selector but limits the selection
+ * to known XSD Simple Types only. This makes for a less confusing user experience.
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
+public class XSDTypeSelectorDialog extends TypeSelectorDialog {
+
+ public XSDTypeSelectorDialog(Shell parent, EObject eObj) {
+ super(parent, eObj);
+ FILTER_TYPES = XSDTypeOrElementContentProvider.INCLUDE_TYPES;
+ showMessages = false;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ // TODO Auto-generated method stub
+ Control ctl = super.createContents(parent);
+ checkButtonGroup.setEnabled(false);
+ for (Control c : checkButtonGroup.getChildren())
+ c.setEnabled(false);
+ return ctl;
+ }
+
+}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2010-10-12 19:44:34 UTC (rev 25761)
@@ -199,10 +199,11 @@
DurationSelector_Months_1=Mont&hs
DurationSelector_Seconds_5=Se&conds
DurationSelector_Years_1=Ye&ars
-EditMessagePropertyDialog_10=Edit the existing Property.
+EditMessagePropertyDialog_9=Create Property
+EditMessagePropertyDialog_10=Defined As
EditMessagePropertyDialog_14=Na&me\:
EditMessagePropertyDialog_18=Bro&wse...
-EditMessagePropertyDialog_1=Message Type
+EditMessagePropertyDialog_1=Message Type && Part
EditMessagePropertyDialog_20=Aliases
EditMessagePropertyDialog_21=N&ew...
EditMessagePropertyDialog_22=E&dit...
@@ -212,11 +213,20 @@
EditMessagePropertyDialog_2=Part
EditMessagePropertyDialog_3=<none>
EditMessagePropertyDialog_4=\: {0}
-EditMessagePropertyDialog_9=Create a new Property.
+
+# https://jira.jboss.org/browse/JBIDE-7107
+EditMessagePropertyDialog_11=Simple Type
+EditMessagePropertyDialog_12=Element
+EditMessagePropertyDialog_13=Message Type
+EditMessagePropertyDialog_15=Element
+EditMessagePropertyDialog_16=Simple Type
+
EditMessagePropertyDialog_Type_1=Type\:
+EditMessagePropertyDialog_Element_1=Element\:
+EditMessagePropertyDialog_Message_1=Message\:
EditPropertyAliasDialog_10=Edit Property Alias
-EditPropertyAliasDialog_3=Create a new property alias.
-EditPropertyAliasDialog_4=Edit the existing property alias.
+EditPropertyAliasDialog_3=Create Property Alias
+EditPropertyAliasDialog_4=Edit Property Alias
EditPropertyAliasDialog_8=&Part\:
EditPropertyAliasDialog_9=Create Property Alias
EndNodeAdapter_End_1=End
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -216,8 +216,18 @@
BPELEditor bpelEditor = getBPELEditor();
Shell shell = bpelEditor.getEditorSite().getShell();
EditMessagePropertyDialog dialog = new EditMessagePropertyDialog(shell, property, null, bpelEditor, fWidgetFactory);
- if (dialog.open() == Window.OK) {
- if (property != null) {
+ int rtn = dialog.open();
+ if (rtn == Window.OK) {
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // this fixes a nasty bug caused by manual editing of the ProcessArtifacts.wsdl
+ if (property != null && dialog.getProperty()!=null) {
+ if (property.eIsProxy()) {
+ // the Propery is not resolved (it was probably removed from the WSDL)
+ // remove the old Property before adding the newly created one.
+ Command cmd = new RemovePropertyCommand((CorrelationSet)getInput(), property);
+ getCommandFramework().execute(wrapInShowContextCommand(cmd));
+ property = dialog.getProperty();
+ }
Command cmd = new AddPropertyCommand((CorrelationSet)getInput(), property);
getCommandFramework().execute(wrapInShowContextCommand(cmd));
propertyViewer.setSelection(new StructuredSelection(property));
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -609,7 +609,9 @@
DecoratedLabel label = new DecoratedLabel(composite,SWT.LEFT);
label.setText(Messages.VariableTypeSelector_Data_Type_2);
wf.adapt(label);
- dataTypeLabel = new StatusLabel2( label );
+ dataTypeLabel = new StatusLabel2( label );
+ // https://jira.jboss.org/browse/JBIDE-7107
+ dataTypeLabel.getLabel().setBackground(this.getBackground());
dataTypeNameText = createHyperlink(composite, "", SWT.NONE); //$NON-NLS-1$
dataTypeNameText.setToolTipText(Messages.VariableTypeSelector_3);
dataTypeNameText.addHyperlinkListener(new HyperlinkAdapter() {
@@ -642,7 +644,8 @@
data = new FlatFormData();
data.left = new FlatFormAttachment(0,IDetailsAreaConstants.HSPACE);
data.right = new FlatFormAttachment(dataTypeNameText, -IDetailsAreaConstants.HSPACE);
- // data.top = new FlatFormAttachment(dataTypeNameText, IDetailsAreaConstants.VSPACE, SWT.TOP);
+ // https://jira.jboss.org/browse/JBIDE-7107
+ data.top = new FlatFormAttachment(dataTypeNameText, -IDetailsAreaConstants.VSPACE, SWT.TOP);
data.bottom = new FlatFormAttachment(dataTypeNameText,0,SWT.BOTTOM);
dataTypeLabel.setLayoutData(data);
@@ -677,8 +680,11 @@
dataTypeTreeLabel.setLayoutData(data);
data = new FlatFormData();
- data.left = new FlatFormAttachment(0, BPELUtil.calculateLabelWidth(dataTypeLabel.getLabel(), STANDARD_LABEL_WIDTH_SM));
- data.top = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.TOP);
+ // https://jira.jboss.org/browse/JBIDE-7107
+// data.left = new FlatFormAttachment(0, BPELUtil.calculateLabelWidth(dataTypeLabel.getLabel(), STANDARD_LABEL_WIDTH_SM));
+// data.top = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.TOP);
+ data.left = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.LEFT);
+ data.top = new FlatFormAttachment(dataTypeTreeLabel,0, SWT.BOTTOM);
data.right = new FlatFormAttachment(100, -IDetailsAreaConstants.HSPACE) ;
data.bottom = new FlatFormAttachment(100, -IDetailsAreaConstants.HSPACE);
dataTypeTree.setLayoutData(data);
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BrowseUtil.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BrowseUtil.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BrowseUtil.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.eclipse.bpel.ui.util;
+import org.eclipse.bpel.ui.dialogs.MessageSelectorTypeDialog;
import org.eclipse.bpel.ui.dialogs.PartnerLinkTypeSelectorDialog;
import org.eclipse.bpel.ui.dialogs.TypeSelectorDialog;
+import org.eclipse.bpel.ui.dialogs.XSDElementSelectorDialog;
+import org.eclipse.bpel.ui.dialogs.XSDTypeSelectorDialog;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jface.window.Window;
@@ -19,6 +22,15 @@
import org.eclipse.wst.wsdl.PortType;
+/*
+ * Added some new methods that browse for Message Types and XSD Simple Types and Elements.
+ * These disable the type selection radio buttons and limit the display to only those types
+ * that are relevant.
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7107
+ * @author Bob Brodt
+ * @date Oct 12, 2010
+ */
public class BrowseUtil {
public static PortType browseForPortType(ResourceSet resourceSet, Shell parent) {
@@ -58,4 +70,45 @@
}
+ public static Object[] browseForXSDType(EObject eObject, Shell parent) {
+ TypeSelectorDialog dialog = new XSDTypeSelectorDialog (parent,eObject);
+ if (dialog.open() != Window.OK) {
+ return null;
+ }
+ Object obj[] = dialog.getResult();
+ if (obj != null && obj.length > 0) {
+ return obj;
+ }
+ return null;
+
+ }
+
+ public static Object[] browseForXSDElement(EObject eObject, Shell parent, boolean requireElementSelection) {
+ XSDElementSelectorDialog dialog = new XSDElementSelectorDialog (parent,eObject);
+ dialog.setRequireElementSelection(requireElementSelection);
+ if (dialog.open() != Window.OK) {
+ return null;
+ }
+ Object obj[] = dialog.getResult();
+ if (obj != null && obj.length > 0) {
+ return obj;
+ }
+ return null;
+
+ }
+
+ public static Object[] browseForMessageType(EObject eObject, Shell parent, boolean requirePartSelection) {
+ MessageSelectorTypeDialog dialog = new MessageSelectorTypeDialog (parent,eObject);
+ dialog.setRequirePartSelection(requirePartSelection);
+ if (dialog.open() != Window.OK) {
+ return null;
+ }
+ Object obj[] = dialog.getResult();
+ if (obj != null && obj.length > 0) {
+ return obj;
+ }
+ return null;
+
+ }
+
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/WSDLImportHelper.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/WSDLImportHelper.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/WSDLImportHelper.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -315,7 +315,11 @@
// importingDefinition.getImports().put(importedSchema.getTargetNamespace(),
// imports);
importingDefinition.addImport(_import);
- } else {
+ }
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // ignore an inconsequential error here
+ else if ( !importingUri.equals(importedUri) )
+ {
// TODO handle errors here?
throw new IllegalStateException();
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/ModelQuery.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/ModelQuery.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/ModelQuery.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -29,7 +29,9 @@
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.wsdl.WSDLElement;
+import org.eclipse.wst.wsdl.util.WSDLParser;
import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.util.XSDParser;
import org.w3c.dom.Element;
@@ -536,7 +538,42 @@
try {
return ((Number)elm.getUserData(key)).intValue();
} catch (Throwable t) {
- //
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // this was added as a result of https://jira.jboss.org/browse/JBIDE-7116 since we need to
+ // be able to report line information for various types of WSDL objects...
+ // if the requested item is line/column information, maybe it's in an imported WSDL or XSD.
+ // We'll have to get this info from the WSDLParser or XSDParser. Luckily we remembered to set
+ // the TRACK_LOCATION loader option for the WSDL Resource loader, right?
+ EObject eObj = (EObject) elm.getUserData("emf.model");
+ if (eObj instanceof XSDConcreteComponent) {
+ switch (what) {
+ case LOOKUP_NUMBER_LINE_NO :
+ def = XSDParser.getStartLine( ((XSDConcreteComponent)eObj).getElement() );
+ break;
+ case LOOKUP_NUMBER_COLUMN_NO :
+ def = XSDParser.getStartColumn( ((XSDConcreteComponent)eObj).getElement() );
+ break;
+ default:
+ return def;
+ }
+ }
+ else if (eObj instanceof WSDLElement) {
+ switch (what) {
+ case LOOKUP_NUMBER_LINE_NO :
+ def = WSDLParser.getStartLine( ((WSDLElement)eObj).getElement() );
+ break;
+ case LOOKUP_NUMBER_COLUMN_NO :
+ def = WSDLParser.getStartColumn( ((WSDLElement)eObj).getElement() );
+ break;
+ default:
+ return def;
+ }
+ }
+ else
+ return def;
+
+ // found it! Set this info in the adaptable Element for next time
+ elm.setUserData(key, new Integer(def), null);
}
return def;
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/PropertyAlias.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/PropertyAlias.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/PropertyAlias.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -100,8 +100,9 @@
* A <vprop:propertyAlias> element MUST use one of the three following
* combinations of attributes:
*
- * messageType and part,
- * type or element
+ * 1. both messageType and part
+ * 2. type
+ * 3. element
*/
@ARule(
@@ -127,7 +128,9 @@
// good
fDuplicateKey = nn + "/messageType/" + fMessageTypeName + "/" + fMessagePartName + "/" + fPropertyName;
- } else if (isEmpty(fMessageTypeName) && isEmpty(fMessageTypeName) ) {
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // sheesh! fix a typo
+ } else if (isEmpty(fMessageTypeName) && isEmpty(fMessagePartName) ) {
if (isEmpty(fTypeName) && isNonEmpty(fElementName)) {
// good, element name
@@ -181,8 +184,9 @@
IProblem problem;
INode typeNode = null;
-
- if (isNonEmpty(fMessageTypeName) ) {
+
+ // https://jira.jboss.org/browse/JBIDE-7107
+ if (isNonEmpty(fMessageTypeName) && isNonEmpty(fMessagePartName)) {
// good
INode msgType = mModelQuery.lookup(mNode.rootNode(),
IModelQueryLookups.LOOKUP_NODE_MESSAGE_TYPE,fMessageTypeName);
@@ -205,15 +209,18 @@
problem.fill("BPELC_MSG__PART",
toString(mNode.nodeName()),
fMessagePartName,
- msgType
+ fMessageTypeName
);
}
}
+
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // reversed type and element...
+ // wow, Michal must have been tired when he was writing this ;)
+ } else if (isNonEmpty(fTypeName)) {
+ // good, type name
- } if (isNonEmpty(fElementName)) {
- // good, element name
-
typeNode = mModelQuery.lookup(mNode.rootNode(),
IModelQueryLookups.LOOKUP_NODE_XSD_TYPE, fTypeName);
@@ -227,8 +234,8 @@
);
}
- } else if (isNonEmpty(fTypeName) ) {
- // good, type name
+ } else if (isNonEmpty(fElementName) ) {
+ // good, element name
typeNode = mModelQuery.lookup(mNode.rootNode(),
IModelQueryLookups.LOOKUP_NODE_XSD_ELEMENT, fElementName);
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/messages.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/messages.properties 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/vprop/messages.properties 2010-10-12 19:44:34 UTC (rev 25761)
@@ -0,0 +1,13 @@
+# https://jira.jboss.org/browse/JBIDE-7107
+# This was missing!
+BPELC_PROPERTY__UNSET.summary = Missing "{1}" or "{2}" attribute for this <{0}>
+BPELC_PROPERTY__UNSET = Either "{1}" or "{2}" attribute is required on this <{0}>
+BPELC_PROPERTY__UNSET.fix = Provide a valid "{1}" or "{2}" attribute for this <{0}>
+
+BPELC__DUPLICATE.summary = Duplicate <{0} name="{1}">
+BPELC__DUPLICATE = This <{0}> with name="{1}" was already defined previously
+BPELC__DUPLICATE.fix = Change the "name" attribute of this <{0}> to something other than "{1}"
+
+BPELC_MSG__PART.summary = Undefined message "{2}/{1}" for <{0}>
+BPELC_MSG__PART = This <{0}> uses undefined message part "{1}" in message type "{2}"
+BPELC_MSG__PART.fix = Provide a valid message type and part attribute for this <{0}>
\ No newline at end of file
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Definitions.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Definitions.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Definitions.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -61,35 +61,24 @@
for (EObject obj : unresolved) {
String location = "unkonwn";
- int startLine = 1, startCol = 1;
- Node node = null;
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // line/column gathering was moved to ModelQuery class
if (obj instanceof Import) {
location = ((Import)obj).getLocationURI();
- node = ((Import)obj).getElement();
- startLine = WSDLParser.getStartLine(node);
- startCol = WSDLParser.getStartColumn(node);
}
else if ( obj instanceof XSDImportImpl ) {
location = ((XSDImportImpl)obj).getSchemaLocation();
- node = ((XSDImportImpl)obj).getElement();
- startLine = XSDParser.getStartLine(node);
- startCol = XSDParser.getStartColumn(node);
}
else if ( obj instanceof XSDIncludeImpl ) {
location = ((XSDIncludeImpl)obj).getSchemaLocation();
- node = ((XSDIncludeImpl)obj).getElement();
- startLine = XSDParser.getStartLine(node);
- startCol = XSDParser.getStartColumn(node);
}
IProblem problem = createWarning( (INode)mModelQuery.adapt(obj,INode.class,IModelQuery.ADAPT_HINT_NONE) );
problem.fill("BPELC_IMPORT__UNRESOVED", //$NON-NLS-1$
toString(mNode.nodeName()),
- location,
- definition.getLocation());
- problem.setAttribute(IProblem.LINE_NUMBER, startLine);
- problem.setAttribute(IProblem.COLUMN_NUMBER, startCol);
+ location, // location of the unresolved document being imported
+ definition.getLocation()); // location of document doing the importing
}
}
@@ -107,7 +96,6 @@
file.deleteMarkers(IBPELMarker.ID, false, IResource.DEPTH_INFINITE);
// System.out.println("deleted markers from "+file);
} catch (CoreException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Factory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Factory.java 2010-10-12 18:21:11 UTC (rev 25760)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/wsdl/Factory.java 2010-10-12 19:44:34 UTC (rev 25761)
@@ -47,7 +47,10 @@
String nsURI = qname.getNamespaceURI();
if (IConstants.XMLNS_XPATH_EXPRESSION_LANGUAGE.equals ( nsURI ) ||
- IConstants.XMLNS_XPATH_EXPRESSION_LANGUAGE_2.equals (nsURI ) )
+ IConstants.XMLNS_XPATH_EXPRESSION_LANGUAGE_2.equals (nsURI ) ||
+ // https://jira.jboss.org/browse/JBIDE-7107
+ // oops - also create validator for Definitions
+ IConstants.XMLNS_WSDL.equals (nsURI ))
{
return createValidator( qname.getLocalPart() );
}
14 years, 1 month
JBoss Tools SVN: r25760 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-10-12 14:21:11 -0400 (Tue, 12 Oct 2010)
New Revision: 25760
Modified:
trunk/build/parent/pom.xml
Log:
Fix for maven warning: 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.sonatype.tycho:maven-osgi-packaging-plugin
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2010-10-12 17:58:23 UTC (rev 25759)
+++ trunk/build/parent/pom.xml 2010-10-12 18:21:11 UTC (rev 25760)
@@ -37,21 +37,6 @@
<configuration>
<format>'v'yyyyMMdd-HHmm'-${BUILD_ALIAS}'</format>
<archiveSite>true</archiveSite>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>tycho-maven-plugin</artifactId>
- <version>${tychoVersion}</version>
- <extensions>true</extensions>
- </plugin>
-
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-packaging-plugin</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
<environments>
<environment>
<os>macosx</os>
@@ -81,8 +66,16 @@
</environments>
</configuration>
</plugin>
+
<plugin>
<groupId>org.sonatype.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tychoVersion}</version>
<configuration>
@@ -751,8 +744,85 @@
</repository>
</repositories>
</profile>
+ <profile>
+ <id>dgolovin</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>helios</id>
+ <url>file:///media/Data/updates/helios-sp1</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>birt26</id>
+ <url>http://download.eclipse.org/birt/update-site/2.6/
+ </url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>jboss-swtbot-helios</id>
+ <url>http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/
+ </url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>m2eclipse-extras</id>
+ <url>http://m2eclipse.sonatype.org/sites/m2e-extras/</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>jboss-xulrunner-1.9.1.2</id>
+ <url>http://download.jboss.org/jbosstools/updates/requirements/xulrunner-1.9.1.2/
+ </url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>google eclipse plugins</id>
+ <url>http://dl.google.com/eclipse/plugin/3.6</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
+ </profiles>
- </profiles>
<pluginRepositories>
<pluginRepository>
<id>sonatype-maven-central</id>
14 years, 1 month
JBoss Tools SVN: r25759 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-12 13:58:23 -0400 (Tue, 12 Oct 2010)
New Revision: 25759
Modified:
trunk/build/parent/pom.xml
Log:
add helios-remote-target
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2010-10-12 16:54:30 UTC (rev 25758)
+++ trunk/build/parent/pom.xml 2010-10-12 17:58:23 UTC (rev 25759)
@@ -230,7 +230,28 @@
</repositories>
</profile>
+ <!-- Time saver: to build everything from scratch from a single repo containing all deps in .target -->
<profile>
+ <id>helios-remote-target</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jbosstools-target-platform-repo</id>
+ <url>http://download.jboss.org/jbosstools/updates/target-platform/latest/</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
+
+ <profile>
<id>jbds-no-target</id>
<activation>
<activeByDefault>false</activeByDefault>
14 years, 1 month
JBoss Tools SVN: r25758 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-12 12:54:30 -0400 (Tue, 12 Oct 2010)
New Revision: 25758
Modified:
trunk/build/parent/pom.xml
Log:
rename repo id
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2010-10-12 16:53:40 UTC (rev 25757)
+++ trunk/build/parent/pom.xml 2010-10-12 16:54:30 UTC (rev 25758)
@@ -217,7 +217,7 @@
</activation>
<repositories>
<repository>
- <id>helios</id>
+ <id>jbosstools-target-platform-repo</id>
<url>${target.platform.URL}</url>
<layout>p2</layout>
<snapshots>
14 years, 1 month
JBoss Tools SVN: r25757 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-12 12:53:40 -0400 (Tue, 12 Oct 2010)
New Revision: 25757
Modified:
trunk/build/parent/pom.xml
Log:
parameterize target.platform.URL
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2010-10-12 16:50:17 UTC (rev 25756)
+++ trunk/build/parent/pom.xml 2010-10-12 16:53:40 UTC (rev 25757)
@@ -19,6 +19,8 @@
<memoryOptions2>-XX:MaxPermSize=256m</memoryOptions2>
<systemProperties></systemProperties>
<target.platform>e36-wtp32</target.platform>
+ <!-- could also use http://download.jboss.org/jbosstools/updates/target-platform/latest/ -->
+ <target.platform.URL>file://home/hudson/static_build_env/jbds/target-platform/e361-wtp322.target/</target.platform.URL>
</properties>
<build>
@@ -216,8 +218,7 @@
<repositories>
<repository>
<id>helios</id>
- <!-- could also use http://download.jboss.org/jbosstools/updates/target-platform/latest/ -->
- <url>file://home/hudson/static_build_env/jbds/target-platform/e361-wtp322.target/</url>
+ <url>${target.platform.URL}</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
14 years, 1 month
JBoss Tools SVN: r25756 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-12 12:50:17 -0400 (Tue, 12 Oct 2010)
New Revision: 25756
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/ELValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7313
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/ELValidationTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/ELValidationTest.java 2010-10-12 16:02:29 UTC (rev 25755)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/ELValidationTest.java 2010-10-12 16:50:17 UTC (rev 25756)
@@ -56,8 +56,8 @@
project.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
JobUtils.waitForIdle();
-// project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
-// JobUtils.waitForIdle();
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle();
number = getMarkersNumberByGroupName(file, IValidator.MARKED_RESOURCE_MESSAGE_GROUP);
assertEquals("Problem marker was not found.", 1, number);
14 years, 1 month
JBoss Tools SVN: r25755 - in trunk: hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-10-12 12:02:29 -0400 (Tue, 12 Oct 2010)
New Revision: 25755
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
Log:
Remove warnings.
Modified: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-10-12 15:55:41 UTC (rev 25754)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-10-12 16:02:29 UTC (rev 25755)
@@ -22,7 +22,6 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties 2010-10-12 15:55:41 UTC (rev 25754)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/build.properties 2010-10-12 16:02:29 UTC (rev 25755)
@@ -1,5 +1,4 @@
-source.. = src/,\
- resources/
+source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-10-12 15:55:41 UTC (rev 25754)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-10-12 16:02:29 UTC (rev 25755)
@@ -1,7 +1,6 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
public class AlwaysHideSelectionBarWithoutPromptTest extends PreferencesTestCase{
14 years, 1 month
JBoss Tools SVN: r25754 - in trunk: drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-10-12 11:55:41 -0400 (Tue, 12 Oct 2010)
New Revision: 25754
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
Log:
Fixes for JBDS 4.0.0.Beta1
Modified: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -89,6 +89,7 @@
private static String testDroolsRuntimeLocation = null;
@BeforeClass
public static void setUpTest() {
+ jbt.closeReportUsageWindowIfOpened(false);
DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = System.getProperty("java.io.tmpdir");
DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION = DroolsAllBotTests.DROOLS_RUNTIME_LOCATION + File.separator + "drools";
// Create directory for Drools Runtime which will be created as a part of test
Modified: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -11,6 +11,7 @@
package org.jboss.tools.drools.ui.bot.test.smoke;
+import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
@@ -34,6 +35,7 @@
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.ViewType;
@@ -120,17 +122,14 @@
});
// Clear Editor
gefEditor.activateTool("Marquee");
- gefEditor.mouseDrag(0,0,editorBounds.width - editorBounds.x, editorBounds.height - editorBounds.y);
- KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
+ gefEditor.drag(0,0,editorBounds.width - editorBounds.x, editorBounds.height - editorBounds.y);
+ gefEditor.setFocus();
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
// Draw each component
String[] tools = new String[]{"Start Event","End Event","Rule Task",
"Gateway [diverge]","Gateway [converge]","Reusable Sub-Process",
"Script Task"
- /*
- ,"Timer Event","Error Event","Message Event","User Task",
-
- "Embedded Sub-Process","Log","Email"
- */
};
int xspacing = 100;
int xoffset = 10;
@@ -138,20 +137,20 @@
int yoffset = 10;
for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
gefEditor.activateTool(tools[toolIndex]);
- gefEditor.mouseMoveLeftClick(xspacing * (toolIndex % 3) + xoffset,
+ gefEditor.click(xspacing * (toolIndex % 3) + xoffset,
yspacing * (toolIndex / 3) + yoffset);
}
// Add Sequence Flow between Start and End Node
gefEditor.activateTool("Sequence Flow");
// Click on Start Node
- gefEditor.mouseMoveLeftClick(xoffset + 5, yoffset + 5);
+ gefEditor.click(xoffset + 5, yoffset + 5);
// Click on End Node
- gefEditor.mouseMoveLeftClick(xspacing + xoffset + 5, yoffset + 5);
+ gefEditor.click(xspacing + xoffset + 5, yoffset + 5);
gefEditor.save();
checkFullRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
// check synchronization with Properties View
gefEditor.activateTool("Select");
- gefEditor.mouseMoveLeftClick(xoffset + 5, yoffset + 5);
+ gefEditor.click(xoffset + 5, yoffset + 5);
SWTBotTree tree = eclipse.showView(ViewType.PROPERTIES).tree();
String id = tree.getTreeItem("Id").cell(1);
String name = tree.getTreeItem("Name").cell(1);
@@ -161,9 +160,11 @@
// Delete each component
gefEditor.activateTool("Select");
for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
- gefEditor.mouseMoveLeftClick(xspacing * (toolIndex % 3) + xoffset + 10,
+ gefEditor.click(xspacing * (toolIndex % 3) + xoffset + 10,
yspacing * (toolIndex / 3) + yoffset + 10);
- KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
+ gefEditor.setFocus();
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
}
// Restore maximized editor
bot.menu(IDELabel.Menu.WINDOW)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -80,7 +80,7 @@
bot.button("Next >").click();
bot.shell(IDELabel.Shell.IMPORT_JSF_PROJECT).activate();
- bot.textWithLabel("web.xml Location*").setText(webXmlFileLocation);
+ bot.textWithLabel("web.xml Location:*").setText(webXmlFileLocation);
bot.button(WidgetVariables.NEXT_BUTTON).click();
SWTJBTExt.addServerToServerViewOnWizardPage(bot, JBOSS_SERVER_GROUP, JBOSS_SERVER_TYPE);
bot.sleep(1000L);
Modified: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -73,7 +73,7 @@
public void run() {
Class<? extends JSPMultiPageEditorPart> cls = JSPMultiPageEditorPart.class;
try {
- Field field = cls.getDeclaredField("container"); //$NON-NLS-1$
+ Field field = cls.getDeclaredField("tabFolderContainer"); //$NON-NLS-1$
field.setAccessible(true);
CTabFolder tabFolder = (CTabFolder) field.get(jspMultiPageEditor);
CTabItem[] tabItems = tabFolder.getItems();
Modified: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/ImportStrutsProjectTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -62,7 +62,7 @@
bot.button("Next >").click();
bot.shell(IDELabel.Shell.IMPORT_STRUTS_PROJECT).activate();
- bot.textWithLabel("web.xml Location*").setText(webXmlFileLocation);
+ bot.textWithLabel("web.xml Location:*").setText(webXmlFileLocation);
bot.button(WidgetVariables.NEXT_BUTTON).click();
// Check if there is defined Application Server if not create one
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -507,15 +507,31 @@
* @param cancel selecte if ok or cancel button is used
*/
public void closeReportUsageWindowIfOpened(boolean cancel) {
+ boolean usageWindowAppeared = false;
+ // Check Usage Reporting For JBT
try {
bot.shell("JBoss Tools Usage").activate();
bot.button(
cancel ? IDELabel.Button.CANCEL
: IDELabel.Button.OK).click();
log.info("Report usage window closed");
+ usageWindowAppeared = true;
} catch (WidgetNotFoundException wnfe) {
- log.info("Report usage window didn't appear");
+ // do nothing continue to try to close JBDS Usage Report Dialog
}
+ // Check Usage Reporting For JBDS
+ if (!usageWindowAppeared){
+ try {
+ bot.shell("JBoss Developer Studio Usage").activate();
+ bot.button(
+ cancel ? IDELabel.Button.CANCEL
+ : IDELabel.Button.OK).click();
+ log.info("Report usage window closed");
+ usageWindowAppeared = true;
+ } catch (WidgetNotFoundException wnfe) {
+ log.info("Report usage window didn't appear");
+ }
+ }
}
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -565,21 +565,21 @@
public static class CreateGroupDialog{
- public static final String NAME = "Name*";
+ public static final String NAME = "Name:*";
}
public static class AddPaletteGroupDialog{
- public static final String NAME = "Name*";
+ public static final String NAME = "Name:*";
}
public static class AddPaletteMacroDialog{
- public static final String NAME = "Name*";
- public static final String START_TEXT = "Start Text";
- public static final String END_TEXT = "End Text";
+ public static final String NAME = "Name:*";
+ public static final String START_TEXT = "Start Text:";
+ public static final String END_TEXT = "End Text:";
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -158,15 +158,19 @@
}
} catch (Exception e) {
bot.button(0).click();
+ delay();
SWTBotTree innerTree = bot.tree();
delay();
innerTree.expandNode(JBOSS_SERVER_GROUP).select(JBOSS_SERVER_RUNTIME_TYPE); //$NON-NLS-1$ //$NON-NLS-2$
- delay();
+ bot.sleep(Timing.time1S());
bot.button("Next >").click(); //$NON-NLS-1$
+ bot.sleep(Timing.time1S());
bot.textWithLabel("Home Directory").setText(JBOSS_EAP_HOME); //$NON-NLS-1$
+ bot.sleep(Timing.time1S());
bot.button("Finish").click(); //$NON-NLS-1$
- delay();
+ bot.sleep(Timing.time10S());
bot.button("Finish").click(); //$NON-NLS-1$
+ bot.sleep(Timing.time10S());
try {
bot.button("Yes").click(); //$NON-NLS-1$
openErrorLog();
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -33,7 +33,6 @@
//Test Hide Selection Bar button without confirm
- selectPrompt();
bot.toolbarButtonWithTooltip(HID_SEL_BAR).click();
checkIsHide();
@@ -43,14 +42,6 @@
openPage();
checkIsHide();
- //Test Hide Selection Bar button with confirm
-
- selectPrompt();
- selectSelection();
- bot.toolbarButtonWithTooltip(HID_SEL_BAR).click();
- bot.shell("Confirm hide selection bar").activate();
- bot.button(IDELabel.Button.OK).click();
- checkIsHide();
}
private void checkIsHide(){
@@ -74,17 +65,7 @@
}
private void selectSelection(){
- bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
- bot.shell(PREF_FILTER_SHELL_TITLE).activate();
- bot.checkBox(SHOW_SELECTION_TAG_BAR).click();
- bot.button("OK").click(); //$NON-NLS-1$
+ bot.toolbarToggleButton(SHOW_SELECTION_BAR).click();
}
- private void selectPrompt(){
- bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
- bot.shell(PREF_FILTER_SHELL_TITLE).activate();
- bot.checkBox(ASK_FOR_CONFIRM).click();
- bot.button("OK").click(); //$NON-NLS-1$
- }
-
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -7,17 +7,19 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.vpe.ui.bot.test.Activator;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
public abstract class PreferencesTestCase extends VPEAutoTestCase{
- protected static final String SHOW_SELECTION_TAG_BAR = "Show selection tag bar"; //$NON-NLS-1$
+ protected static final String SHOW_SELECTION_BAR = "Show Selection Bar"; //$NON-NLS-1$
protected static final String SHOW_NON_VISUAL_TAGS = "Show non-visual tags"; //$NON-NLS-1$
protected static final String SHOW_BORDER_FOR_UNKNOWN_TAGS = "Show border for unknown tags"; //$NON-NLS-1$
protected static final String SHOW_RESOURCE_BUNDLES = "Show resource bundles usage as EL expressions"; //$NON-NLS-1$
protected static final String ASK_FOR_ATTRIBUTES = "Ask for tag attributes during tag insert"; //$NON-NLS-1$
- protected static final String ASK_FOR_CONFIRM = "Ask for confirmation when closing Selection Bar"; //$NON-NLS-1$
protected static final String SELECT_DEFAULT_TAB = "Select the default active editor's tab"; //$NON-NLS-1$
protected static final String EDITOR_SPLITTING = "Visual/Source editors splitting"; //$NON-NLS-1$
protected static final String SHOW_TEXY_FORMAT = "Show text formatting bar"; //$NON-NLS-1$
@@ -62,23 +64,34 @@
protected void setUp() throws Exception {
super.setUp();
openPage();
- bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
- bot.shell(PREF_FILTER_SHELL_TITLE).activate();
- setPreferencesToDefault();
- bot.button("OK").click(); //$NON-NLS-1$
+ setPreferencesToDefault(true);
}
@Override
protected void tearDown() throws Exception {
openPage();
- bot.toolbarButtonWithTooltip("Preferences").click(); //$NON-NLS-1$
- bot.shell("Preferences (Filtered)").activate(); //$NON-NLS-1$
- setPreferencesToDefault();
- bot.button("OK").click(); //$NON-NLS-1$
+ setPreferencesToDefault(true);
super.tearDown();
}
- void setPreferencesToDefault() throws WidgetNotFoundException{
+ void setPreferencesToDefault(boolean fromEditor) throws WidgetNotFoundException{
+ SWTBotToolbarToggleButton tbShowSelectionBar = bot.toolbarToggleButton(SHOW_SELECTION_BAR);
+ if (!tbShowSelectionBar.isChecked()){
+ tbShowSelectionBar.click();
+ }
+ if (fromEditor){
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click(); //$NON-NLS-1$
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate(); //$NON-NLS-1$
+ }
+ else{
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click(); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTBotTree preferenceTree = bot.tree();
+ preferenceTree
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS) //$NON-NLS-1$
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB) //$NON-NLS-1$
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS) //$NON-NLS-1$
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE).select();
+ }
SWTBotCheckBox checkBox = bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS);
if (!checkBox.isChecked()) {
checkBox.click();
@@ -87,10 +100,7 @@
if (checkBox.isChecked()) {
checkBox.click();
}
- checkBox = bot.checkBox(SHOW_SELECTION_TAG_BAR);
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
+
checkBox = bot.checkBox(SHOW_RESOURCE_BUNDLES);
if (checkBox.isChecked()) {
checkBox.click();
@@ -99,10 +109,6 @@
if (!checkBox.isChecked()) {
checkBox.click();
}
- checkBox = bot.checkBox(ASK_FOR_CONFIRM);
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
checkBox = bot.checkBox(SHOW_TEXY_FORMAT);
if (!checkBox.isChecked()) {
checkBox.click();
@@ -111,6 +117,7 @@
combo.setSelection("Visual/Source"); //$NON-NLS-1$
combo = bot.comboBoxWithLabel(EDITOR_SPLITTING);
combo.setSelection("Vertical splitting with Source Editor on the top"); //$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -29,27 +29,11 @@
closePage();
openPage();
checkIsShow();
-
- //Test Hide Selection Bar button with confirm
-
- bot.toolbarButtonWithTooltip(HID_SEL_BAR).click();
- bot.shell("Confirm hide selection bar").activate(); //$NON-NLS-1$
- bot.button("OK").click(); //$NON-NLS-1$
- checkIsHide();
- //Test Show selection after reopen
-
- closePage();
- openPage();
- checkIsHide();
-
}
private void selectSelection(){
- bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
- bot.shell(PREF_FILTER_SHELL_TITLE).activate();
- bot.checkBox(SHOW_SELECTION_TAG_BAR).click();
- bot.button("OK").click(); //$NON-NLS-1$
+ bot.toolbarToggleButton(SHOW_SELECTION_BAR).click();
}
private void checkIsHide(){
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2010-10-12 15:49:57 UTC (rev 25753)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2010-10-12 15:55:41 UTC (rev 25754)
@@ -2,15 +2,11 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
public class CancelTagLibDefenitionTest extends VPEAutoTestCase{
- @Override
- protected void createJSFProject(String jsfProjectName) {
- super.createJSFProject(jsfProjectName);
- }
-
public void testCancelTagLibDefenition(){
openPalette();
openPage();
@@ -23,20 +19,23 @@
bot.button("Browse...").click(); //$NON-NLS-1$
bot.shell("Edit TLD").activate(); //$NON-NLS-1$
-
+ delay();
//Test cancel TLD
SWTBotTree tree = bot.tree();
delay();
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("html_basic.tld [h]").select(); //$NON-NLS-1$ //$NON-NLS-2$
+ SWTBotTreeItem item = tree.expandNode(projectProperties.getProperty("JSFProjectName"));
+ delay();
+ item.getNode("html_basic.tld [h]").select(); //$NON-NLS-1$ //$NON-NLS-2$
+ delay();
bot.button("Cancel").click(); //$NON-NLS-1$
//Test check fields
bot.shell("Import Tags from TLD File").activate(); //$NON-NLS-1$
- assertEquals("", bot.textWithLabel("TLD File*").getText()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("", bot.textWithLabel("Name*").getText()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("", bot.textWithLabel("Default Prefix").getText()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("", bot.textWithLabel("Library URI").getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("", bot.textWithLabel("TLD File:*").getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("", bot.textWithLabel("Name:*").getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("", bot.textWithLabel("Default Prefix:").getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("", bot.textWithLabel("Library URI:").getText()); //$NON-NLS-1$ //$NON-NLS-2$
bot.button("Cancel").click(); //$NON-NLS-1$
}
14 years, 1 month
JBoss Tools SVN: r25753 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: condition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-10-12 11:49:57 -0400 (Tue, 12 Oct 2010)
New Revision: 25753
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/ButtonIsDisabled.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
Log:
ButtonIsDisabled condition added
EclipseBot #createProject shell not found fixed
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-12 15:37:25 UTC (rev 25752)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-10-12 15:49:57 UTC (rev 25753)
@@ -38,17 +38,18 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
+import org.jboss.tools.ui.bot.ext.condition.ButtonIsDisabled;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ServerServer;
import org.jboss.tools.ui.bot.ext.gen.IServer;
import org.jboss.tools.ui.bot.ext.gen.IServerRuntime;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ServerServer;
import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.IDELabel.PreferencesDialog;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
import org.jboss.tools.ui.bot.ext.types.ViewType;
-import org.jboss.tools.ui.bot.ext.types.IDELabel.PreferencesDialog;
/**
* Provides Eclipse common operation based on SWTBot element operations
@@ -207,12 +208,15 @@
waitForShell(IDELabel.Shell.NEW_JAVA_PROJECT);
// JavaProjectWizard
+ SWTBotShell shell = bot.activeShell();
bot.textWithLabel(IDELabel.JavaProjectWizard.PROJECT_NAME).setText(
entity.getProjectName());
+
+ bot.waitWhile(new ButtonIsDisabled(IDELabel.Button.FINISH));
bot.button(IDELabel.Button.FINISH).click();
// Wait for shell closing JavaProjectWizard
- waitForClosedShell(IDELabel.Shell.NEW_JAVA_PROJECT);
+ waitForClosedShell(shell);
util.waitForNonIgnoredJobs();
}
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/ButtonIsDisabled.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/ButtonIsDisabled.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/ButtonIsDisabled.java 2010-10-12 15:49:57 UTC (rev 25753)
@@ -0,0 +1,36 @@
+package org.jboss.tools.ui.bot.ext.condition;
+
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.utils.StringUtils;
+import org.eclipse.swtbot.swt.finder.utils.internal.Assert;
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+
+/**
+ * SWTBot Condition checking if a button is disabled
+ * @author jpeterka
+ *
+ */
+public class ButtonIsDisabled extends DefaultCondition {
+
+ private String text;
+
+ public ButtonIsDisabled(String text) {
+ Assert.isNotNull(text, "The button text was null"); //$NON-NLS-1$
+ Assert.isLegal(!StringUtils.isEmpty(text), "The button text was empty"); //$NON-NLS-1$
+ this.text = text;
+ }
+
+ public String getFailureMessage() {
+ return "The button '" + text + "' is not disabled"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public boolean test() throws Exception {
+ try {
+ SWTBotButton button = bot.buttonWithLabel(text);
+ return !button.isEnabled();
+ } catch (WidgetNotFoundException e) {
+ }
+ return false;
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/ButtonIsDisabled.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Tools SVN: r25752 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-12 11:37:25 -0400 (Tue, 12 Oct 2010)
New Revision: 25752
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
Log:
JBIDE-7319
https://jira.jboss.org/browse/JBIDE-7319
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-10-12 15:34:12 UTC (rev 25751)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-10-12 15:37:25 UTC (rev 25752)
@@ -61,13 +61,13 @@
long end = System.currentTimeMillis();
seamProject.fullBuildTime += end - begin;
- try {
- //It is important to save results of build right after the build is done.
- //Otherwise, at Eclipse restart, the results can be lost.
- seamProject.store();
- } catch (IOException e) {
- SeamCorePlugin.getDefault().logError(e);
- }
+// try {
+// //It is important to save results of build right after the build is done.
+// //Otherwise, at Eclipse restart, the results can be lost.
+// seamProject.store();
+// } catch (IOException e) {
+// SeamCorePlugin.getDefault().logError(e);
+// }
seamProject.postBuild();
} finally {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-10-12 15:34:12 UTC (rev 25751)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-10-12 15:37:25 UTC (rev 25752)
@@ -77,11 +77,24 @@
switch (context.getKind()) {
case ISaveContext.SNAPSHOT:
case ISaveContext.FULL_SAVE:
+ IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (IProject p: ps) {
+ SeamProject sp = (SeamProject)SeamCorePlugin.getSeamProject(p, false);
+ if(sp != null && sp.getModificationsSinceLastStore() > 0) {
+// sp.printModifications();
+ try {
+ sp.store();
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
break;
case ISaveContext.PROJECT_SAVE:
SeamProject sp = (SeamProject)SeamCorePlugin.getSeamProject(context.getProject(), false);
try {
- if(sp != null) {
+ if(sp != null && sp.getModificationsSinceLastStore() > 0) {
+ sp.printModifications();
//Not any project is a seam project
sp.store();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-10-12 15:34:12 UTC (rev 25751)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-10-12 15:37:25 UTC (rev 25752)
@@ -110,6 +110,8 @@
ProjectValidationContext validationContext;
+ protected int modifications = 0;
+
/**
*
*/
@@ -284,6 +286,7 @@
public void addSeamProject(SeamProject p) {
if(dependsOn.contains(p)) return;
dependsOn.add(p);
+ modifications++;
p.addDependentSeamProject(this);
if(!p.isStorageResolved) {
p.resolve();
@@ -314,7 +317,7 @@
* @param p
*/
public void addDependentSeamProject(SeamProject p) {
- usedBy.add(p);
+ if(usedBy.add(p)) modifications++;
}
public Map<String, Set<ISeamNamespace>> getNamespaces() {
@@ -329,6 +332,7 @@
if(!dependsOn.contains(p)) return;
p.usedBy.remove(this);
dependsOn.remove(p);
+ modifications++;
IPath[] ps = sourcePaths2.keySet().toArray(new IPath[0]);
for (int i = 0; i < ps.length; i++) {
IPath pth = ps[i];
@@ -413,6 +417,11 @@
} finally {
fireChanges();
+
+ modifications = 0;
+ namespaces.modifications = 0;
+ components.modifications = 0;
+ factories.modifications = 0;
}
}
@@ -479,6 +488,25 @@
scopesMap.put(types[i], scopes[i]);
}
}
+
+ public int getModificationsSinceLastStore() {
+ return modifications +
+ namespaces.modifications +
+ components.modifications +
+ factories.modifications +
+ ((validationContext != null) ? validationContext.getModificationsSinceLastStore() : 0);
+ }
+
+ public void printModifications() {
+ System.out.println(project.getName());
+ System.out.println("" + modifications);
+ System.out.println("namespaces " + namespaces.modifications);
+ System.out.println("components " + components.modifications);
+ System.out.println("factories " + factories.modifications);
+ if(validationContext != null)
+ System.out.println("validationContext " + validationContext.getModificationsSinceLastStore());
+ }
+
/**
* Stores results of last build, so that on exit/enter Eclipse
* load them without rebuilding project
@@ -498,6 +526,11 @@
if(validationContext != null) validationContext.store(root);
XMLUtilities.serialize(root, file.getAbsolutePath());
+
+ modifications = 0;
+ namespaces.modifications = 0;
+ components.modifications = 0;
+ factories.modifications = 0;
}
/*
@@ -785,6 +818,7 @@
* @param source
*/
public void registerComponents(LoadedDeclarations ds, IPath source) {
+ boolean isThisProject = pathCheck.isThisProject(source);
ISeamNamespace[] ns = ds.getNamespaces().toArray(new ISeamNamespace[0]);
ISeamComponentDeclaration[] components = ds.getComponents().toArray(new ISeamComponentDeclaration[0]);
@@ -848,7 +882,7 @@
Change cc = new Change(c, null, null, null);
cc.addChildren(changes);
List<Change> cchanges = Change.addChange(null, cc);
- fireChanges(cchanges);
+ fireChanges(cchanges, isThisProject);
//TODO if java, fire to others
}
if(nameChanged) {
@@ -897,7 +931,7 @@
} else if(c != null) {
c.addDeclaration(loaded);
List<Change> changes = Change.addChange(null, new Change(c, null, null, loaded));
- fireChanges(changes);
+ fireChanges(changes, isThisProject);
}
if(loaded instanceof ISeamJavaComponentDeclaration) {
@@ -908,7 +942,7 @@
SeamComponent cii = (SeamComponent)ci;
cii.addDeclaration(loaded);
List<Change> changes = Change.addChange(null, new Change(ci, null, null, loaded));
- fireChanges(changes);
+ fireChanges(changes, isThisProject);
affectedComponents.add(cii);
}
SeamComponent empty = this.components.getByName("");
@@ -920,7 +954,7 @@
List<Change> changes = Change.addChange(null, new Change(empty, null, x, null));
c.addDeclaration(x);
changes = Change.addChange(changes, new Change(empty, null, null, x));
- fireChanges(changes);
+ fireChanges(changes, isThisProject);
}
}
}
@@ -947,7 +981,7 @@
empty.addDeclaration(d);
changes = Change.addChange(changes, new Change(empty, null, null, d));
}
- fireChanges(changes);
+ fireChanges(changes, isThisProject);
}
}
} else if(loaded instanceof ISeamXmlComponentDeclaration) {
@@ -961,7 +995,7 @@
addedComponents = sc.revalidate(addedComponents);
}
- fireChanges(addedComponents);
+ fireChanges(addedComponents, isThisProject);
componentDeclarationsRemoved(currentComponents);
@@ -978,7 +1012,7 @@
}
if(current != null) {
List<Change> changes = current.merge(loaded);
- fireChanges(changes);
+ fireChanges(changes, isThisProject);
continue;
}
if(factories[i].getParent() == null) {
@@ -987,7 +1021,7 @@
this.factories.addFactory(factories[i]);
addedFactories = Change.addChange(addedFactories, new Change(this, null, null, loaded));
}
- fireChanges(addedFactories);
+ fireChanges(addedFactories, isThisProject);
factoryDeclarationsRemoved(currentFactories);
@@ -1116,7 +1150,7 @@
changes = Change.addChange(changes, new Change(c, null, null, j));
}
if(changes != null) c.revalidate(changes);
- fireChanges(changes);
+ fireChanges(changes, pathCheck.isThisProject(xml.getSourcePath()));
}
public boolean isPathLoaded(IPath source) {
@@ -1152,7 +1186,7 @@
components.removePath(source);
- fireChanges(changes);
+ fireChanges(changes, false);
// revalidate();
@@ -1161,7 +1195,7 @@
if(fs != null) for (ISeamFactory f: fs) {
changes = Change.addChange(changes, new Change(this, null, f, null));
}
- fireChanges(changes);
+ fireChanges(changes, false);
firePathRemovedToDependentProjects(source);
}
@@ -1221,7 +1255,7 @@
}
}
- fireChanges(changes);
+ fireChanges(changes, false);
}
/*
@@ -1275,7 +1309,7 @@
removeVariable(c);
changes = Change.addChange(changes, new Change(this, null, c, null));
}
- fireChanges(changes);
+ fireChanges(changes, false);
}
/**
@@ -1347,6 +1381,7 @@
public void setImports(String source, List<String> paths) {
if(equalLists(imports.get(source), paths)) return;
+ modifications++;
synchronized(variables) {
variables.allVariablesPlusShort = null;
variables.byName = null;
@@ -1365,6 +1400,7 @@
public void removeImports(String source) {
if(!imports.containsKey(source)) return;
+ modifications++;
synchronized(variables) {
variables.allVariablesPlusShort = null;
}
@@ -1609,15 +1645,16 @@
if(postponedChanges == null) return;
List<Change> changes = postponedChanges;
postponedChanges = null;
- fireChanges(changes);
+ fireChanges(changes, false);
}
/**
*
* @param changes
*/
- void fireChanges(List<Change> changes) {
+ void fireChanges(List<Change> changes, boolean increaseModification) {
if(changes == null || changes.isEmpty()) return;
+ if(increaseModification) modifications++;
if(postponedChanges != null) {
postponedChanges.addAll(changes);
return;
@@ -1842,10 +1879,19 @@
p.getComponents().add(c);
}
- class NamespaceStorage {
+ class Storage {
+ protected int modifications = 0;
+
+ protected void increaseModification(IPath path) {
+ if(pathCheck.isThisProject(path)) modifications++;
+ }
+
+ }
+
+ class NamespaceStorage extends Storage {
Map<IPath, Set<ISeamNamespace>> namespacesBySource = new HashMap<IPath, Set<ISeamNamespace>>();
Map<String, Set<ISeamNamespace>> namespacesByURI = new HashMap<String, Set<ISeamNamespace>>();
-
+
public void clear() {
namespacesBySource.clear();
namespacesByURI.clear();
@@ -1877,7 +1923,7 @@
s = new HashSet<ISeamNamespace>();
namespacesByURI.put(n.getURI(), s);
}
- s.add(n);
+ if(s.add(n)) increaseModification(n.getSourcePath());
}
IPath path = n.getSourcePath();
if(path != null) {
@@ -1886,7 +1932,9 @@
fs = new HashSet<ISeamNamespace>();
namespacesBySource.put(path, fs);
}
- fs.add(n);
+ if(fs.add(n)) {
+ increaseModification(n.getSourcePath());
+ }
}
}
@@ -1894,19 +1942,24 @@
Set<ISeamNamespace> sd = namespacesBySource.get(path);
if(sd == null) return;
for (ISeamNamespace d: sd) {
- if(d.getURI() != null)
- namespacesByURI.remove(d.getURI());
+ if(d.getURI() != null) {
+ if(namespacesByURI.remove(d.getURI()) != null) {
+ increaseModification(d.getSourcePath());
+ }
+ }
}
namespacesBySource.remove(path);
}
public void removeNamespace(ISeamNamespace n) {
- namespacesByURI.remove(n.getURI());
+ if(namespacesByURI.remove(n.getURI()) != null) {
+ increaseModification(n.getSourcePath());
+ }
IPath path = n.getSourcePath();
if(path != null) {
Set<ISeamNamespace> fs = namespacesBySource.get(path);
if(fs != null) {
- fs.remove(n);
+ if(fs.remove(n)) increaseModification(n.getSourcePath());
}
if(fs.isEmpty()) {
namespacesBySource.remove(fs);
@@ -1916,16 +1969,15 @@
}
- class ComponentStorage {
+ class ComponentStorage extends Storage {
private Set<ISeamComponent> allComponentsSet = new HashSet<ISeamComponent>();
Map<String, SeamComponent> allComponents = new HashMap<String, SeamComponent>();
Map<String, SeamJavaComponentDeclaration> javaDeclarations = new HashMap<String, SeamJavaComponentDeclaration>();
- ISeamJavaComponentDeclaration[] javaDeclarationsArray = null;
+ ISeamJavaComponentDeclaration[] javaDeclarationsArray = null;
-
Map<IPath, Set<SeamComponentDeclaration>> declarationsBySource = new HashMap<IPath, Set<SeamComponentDeclaration>>();
Map<String, Set<SeamComponentDeclaration>> declarationsByClassName = new HashMap<String, Set<SeamComponentDeclaration>>();
-
+
public void clear() {
synchronized(allComponentsSet) {
allComponentsSet.clear();
@@ -1937,6 +1989,7 @@
}
declarationsBySource.clear();
declarationsByClassName.clear();
+ modifications = 1;
}
public ISeamComponent[] getAllComponentsArray() {
@@ -1988,13 +2041,13 @@
declarationsBySource.put(path, sc);
}
synchronized(sc) {
- sc.add(d);
+ if(sc.add(d)) increaseModification(d.getSourcePath());
}
if(d instanceof ISeamJavaComponentDeclaration) {
SeamJavaComponentDeclaration jd = (SeamJavaComponentDeclaration)d;
for (ISeamContextVariable v: jd.getDeclaredVariables()) addVariable(v);
synchronized(javaDeclarations) {
- javaDeclarations.put(jd.getClassName(), jd);
+ if(javaDeclarations.put(jd.getClassName(), jd) != jd) increaseModification(jd.getSourcePath());
javaDeclarationsArray = null;
}
addDeclaration(jd.getClassName(), jd);
@@ -2012,7 +2065,7 @@
Set<SeamComponentDeclaration> sc = declarationsBySource.get(path);
if(sc != null) {
synchronized(sc) {
- sc.remove(d);
+ if(sc.remove(d)) increaseModification(d.getSourcePath());
}
if(sc.isEmpty()) declarationsBySource.remove(path);
}
@@ -2049,14 +2102,14 @@
removeDeclarationWithClass(d);
}
}
- declarationsBySource.remove(path);
+ if(declarationsBySource.remove(path) != null) increaseModification(path);
}
private void removeDeclarationWithClass(SeamComponentDeclaration d) {
if(d instanceof ISeamJavaComponentDeclaration) {
SeamJavaComponentDeclaration jd = (SeamJavaComponentDeclaration)d;
synchronized(javaDeclarations) {
- javaDeclarations.remove(jd.getClassName());
+ if(javaDeclarations.remove(jd.getClassName()) != null) increaseModification(jd.getSourcePath());
javaDeclarationsArray = null;
}
for (ISeamContextVariable v: jd.getDeclaredVariables()) removeVariable(v);
@@ -2085,13 +2138,13 @@
sc = new HashSet<SeamComponentDeclaration>();
declarationsByClassName.put(className, sc);
}
- sc.add(d);
+ if(sc.add(d)) increaseModification(d.getSourcePath());
}
private void removeDeclaration(String className, SeamComponentDeclaration d) {
Set<SeamComponentDeclaration> sc = declarationsByClassName.get(className);
if(sc != null) {
- sc.remove(d);
+ if(sc.remove(d)) increaseModification(d.getSourcePath());
if(sc.isEmpty()) {
declarationsByClassName.remove(className);
}
@@ -2100,12 +2153,12 @@
}
- class FactoryStorage {
+ class FactoryStorage extends Storage {
private Set<ISeamFactory> allFactories = new HashSet<ISeamFactory>();
private ISeamFactory[] allFactoriesArray = null;
Map<IPath, Set<ISeamFactory>> factoriesBySource = new HashMap<IPath, Set<ISeamFactory>>();
SeamMessages messages = null;
-
+
public void clear() {
synchronized(allFactories) {
allFactories.clear();
@@ -2113,6 +2166,7 @@
}
factoriesBySource.clear();
messages = null;
+ modifications = 1;
}
public ISeamFactory[] getAllFactoriesArray() {
@@ -2132,7 +2186,7 @@
public void addFactory(ISeamFactory f) {
synchronized(allFactories) {
- allFactories.add(f);
+ if(allFactories.add(f)) increaseModification(f.getSourcePath());
allFactoriesArray = null;
}
IPath path = f.getSourcePath();
@@ -2142,32 +2196,34 @@
fs = new HashSet<ISeamFactory>();
factoriesBySource.put(path, fs);
}
- fs.add(f);
+ if(fs.add(f)) increaseModification(f.getSourcePath());
}
addVariable(f);
- if(f instanceof SeamMessages) {
+ if(f instanceof SeamMessages && f != messages) {
messages = (SeamMessages)f;
+ modifications++;
}
}
public void removeFactory(ISeamFactory f) {
synchronized(allFactories) {
- allFactories.remove(f);
+ if(allFactories.remove(f)) increaseModification(f.getSourcePath());
allFactoriesArray = null;
}
IPath path = f.getSourcePath();
if(path != null) {
Set<ISeamFactory> fs = factoriesBySource.get(path);
if(fs != null) {
- fs.remove(f);
+ if(fs.remove(f)) increaseModification(f.getSourcePath());
}
if(fs.isEmpty()) {
factoriesBySource.remove(fs);
}
}
removeVariable(f);
- if(f == messages) {
+ if(f == messages && f != null) {
messages = null;
+ increaseModification(f.getSourcePath());
}
}
@@ -2176,13 +2232,16 @@
if(fs == null) return null;
for (ISeamFactory f: fs) {
synchronized(allFactories) {
- allFactories.remove(f);
+ if(allFactories.remove(f)) increaseModification(f.getSourcePath());
allFactoriesArray = null;
}
removeVariable(f);
- if(f == messages) messages = null;
+ if(f == messages) {
+ messages = null;
+ modifications++;
+ }
}
- factoriesBySource.remove(path);
+ if(factoriesBySource.remove(path) != null) increaseModification(path);
return fs;
}
@@ -2198,6 +2257,7 @@
public void clear() {
allVariables.clear();
clearCopies();
+ modifications = 1;
}
synchronized void clearCopies() {
@@ -2310,4 +2370,29 @@
}
}
+ PathCheck pathCheck = new PathCheck();
+
+ class PathCheck {
+ Map<IPath, Boolean> paths = new HashMap<IPath, Boolean>();
+
+ public boolean isThisProject(IPath path) {
+ if(path.toString().equals("/seam77")) {
+ System.out.println("hh");
+ }
+ Boolean b = paths.get(path);
+ if(b == null) {
+ IFile f = null;
+ try {
+ f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ } catch (Exception e) {
+ System.out.println("Bad path=" + path);
+ }
+ b = !(f != null && f.exists() && f.getProject() != project);
+ paths.put(path, b);
+ }
+ return b.booleanValue();
+ }
+
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2010-10-12 15:34:12 UTC (rev 25751)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2010-10-12 15:37:25 UTC (rev 25752)
@@ -74,7 +74,7 @@
void revalidatePackages() {
List<Change> changes = SeamPackageUtil.revalidatePackages(this, componentMap, getComponents(), packages);
- ((SeamProject)getSeamProject()).fireChanges(changes);
+ ((SeamProject)getSeamProject()).fireChanges(changes, false);
}
public void validatePackage(SeamComponent c) {
14 years, 1 month