Author: bbrodt
Date: 2011-03-16 15:31:01 -0400 (Wed, 16 Mar 2011)
New Revision: 29827
Removed:
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.ui/src/org/eclipse/bpel/ui/details/providers/XSDTypeOrElementContentProvider.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/properties/DialogVariableTypeSelector.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/FaultCatchNameSection.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSection.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
Log:
https://issues.jboss.org/browse/JBIDE-8045
Refactored type selection dialogs and properties sections so that the filters are limited
to only those types that are valid within the context of the selected variable or
property.
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/XSDTypeOrElementContentProvider.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/XSDTypeOrElementContentProvider.java 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/XSDTypeOrElementContentProvider.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -43,7 +43,9 @@
final public static int INCLUDE_ELEMENT_DECLARATIONS = 0x4;
final public static int INCLUDE_PRIMITIVES = 0x8;
- final public static int INLCUDE_ALL = 0xff;
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // fix typo
+ final public static int INCLUDE_ALL = 0xff;
static {
Iterator i = xsdPrimitiveTypes.iterator();
@@ -53,7 +55,7 @@
}
}
- private int fFilter = INLCUDE_ALL;
+ private int fFilter = INCLUDE_ALL;
public void setFilter ( int filter ) {
Deleted:
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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/MessageSelectorTypeDialog.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -1,62 +0,0 @@
-/*
- * 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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -56,6 +56,16 @@
*/
public class TypeSelectorDialog extends BrowseSelectorDialog {
+
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // additional filters for constraining XSD & message type selections
+ final public static int INCLUDE_SIMPLE_TYPES = 0x1;
+ final public static int INCLUDE_COMPLEX_TYPES = 0x2;
+ final public static int INCLUDE_ELEMENT_DECLARATIONS = 0x4;
+ final public static int INCLUDE_PRIMITIVES = 0x8;
+ final public static int INCLUDE_MESSAGE_TYPES = 0x10;
+ final public static int INCLUDE_ALL = 0xff;
+ final public static int INCLUDE_XSD_TYPES = INCLUDE_SIMPLE_TYPES |
INCLUDE_COMPLEX_TYPES;
/* Button id for complex types */
protected final static int BID_COMPLEX_TYPES = IDialogConstants.CLIENT_ID + 100;
@@ -88,8 +98,12 @@
/* Which types to filter ? */
- protected int FILTER_TYPES = XSDTypeOrElementContentProvider.INLCUDE_ALL;
+ protected int FILTER_TYPES = XSDTypeOrElementContentProvider.INCLUDE_ALL;
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ /* Which types to include as selections (checkboxes) in dialog ? */
+ protected int includeTypes = INCLUDE_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.
@@ -102,10 +116,12 @@
* @param parent the parent shell
* @param eObj any BPEL model object
*/
-
- public TypeSelectorDialog (Shell parent, EObject eObj ) {
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // add filter selection parameter
+ public TypeSelectorDialog (Shell parent, EObject eObj, int filter ) {
super(parent, new ModelLabelProvider(eObj));
+ this.includeTypes = filter;
this.modelObject = eObj;
resourceContentProvider = new XSDSchemaFromResourceContentProvider(
modelObject.eResource().getResourceSet() );
@@ -127,7 +143,7 @@
try {
FILTER_TYPES = settings.getInt(FILTER_TYPES_KEY);
} catch (Exception ex) {
- FILTER_TYPES = XSDTypeOrElementContentProvider.INLCUDE_ALL;
+ FILTER_TYPES = XSDTypeOrElementContentProvider.INCLUDE_ALL;
}
try {
@@ -135,14 +151,8 @@
} catch (Exception ex) {
showMessages = false;
}
-
- //
https://issues.jboss.org/browse/JBIDE-8075
- // enable/disable selection of Message objects
- messageTypeProvider.setFilter(showMessages?1:0);
}
-
-
/**
* Hook a load on the defaults into this dialog upon create.
*
@@ -153,9 +163,9 @@
Control control = super.createContents(parent);
- // Re-Create the state of the provider from the dialog settings.
- xsdTypeProvider.setFilter( FILTER_TYPES );
-
+ // Re-Create the state of the providers from the dialog settings.
+ setProviderFilters();
+
refresh();
return control;
@@ -204,7 +214,7 @@
showMessages = checked;
//
https://issues.jboss.org/browse/JBIDE-8075
// enable/disable selection of Message objects
- messageTypeProvider.setFilter(showMessages?1:0);
+ setProviderFilters();
bRefresh = true;
break;
@@ -222,7 +232,7 @@
} else {
FILTER_TYPES &= ~bits;
}
- xsdTypeProvider.setFilter (FILTER_TYPES);
+ setProviderFilters();
}
if (bRefresh) {
@@ -242,15 +252,21 @@
@Override
protected void createBrowseFilterGroupButtons ( Group group ) {
- createCheckButton(group,Messages.TypeSelectorDialog_14, BID_XSD_PRIMITIVES,
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ if ((includeTypes & INCLUDE_PRIMITIVES) > 0 )
+ createCheckButton(group,Messages.TypeSelectorDialog_14, BID_XSD_PRIMITIVES,
(FILTER_TYPES & XSDTypeOrElementContentProvider.INCLUDE_PRIMITIVES) > 0 );
- createCheckButton(group,Messages.TypeSelectorDialog_15, BID_SIMPLE_TYPES,
+ if ((includeTypes & INCLUDE_SIMPLE_TYPES) > 0 )
+ createCheckButton(group,Messages.TypeSelectorDialog_15, BID_SIMPLE_TYPES,
(FILTER_TYPES & XSDTypeOrElementContentProvider.INCLUDE_SIMPLE_TYPES) > 0
);
- createCheckButton(group,Messages.TypeSelectorDialog_16, BID_COMPLEX_TYPES,
+ if ((includeTypes & INCLUDE_COMPLEX_TYPES) > 0 )
+ createCheckButton(group,Messages.TypeSelectorDialog_16, BID_COMPLEX_TYPES,
(FILTER_TYPES & XSDTypeOrElementContentProvider.INCLUDE_COMPLEX_TYPES ) > 0
);
- createCheckButton(group,Messages.TypeSelectorDialog_17, BID_ELEMENT_DECLARATIONS,
+ if ((includeTypes & INCLUDE_ELEMENT_DECLARATIONS) > 0 )
+ createCheckButton(group,Messages.TypeSelectorDialog_17, BID_ELEMENT_DECLARATIONS,
(FILTER_TYPES & XSDTypeOrElementContentProvider.INCLUDE_ELEMENT_DECLARATIONS )
> 0 );
- createCheckButton(group,Messages.TypeSelectorDialog_18, BID_MESSAGES,
+ if ((includeTypes & INCLUDE_MESSAGE_TYPES) > 0 )
+ createCheckButton(group,Messages.TypeSelectorDialog_18, BID_MESSAGES,
showMessages);
super.createBrowseFilterGroupButtons( group );
@@ -335,4 +351,25 @@
{
this.requireLowerTreeSelection = enabled;
}
+
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ public void setIncludeTypes(int includeTypes) {
+ this.includeTypes = includeTypes;
+ }
+
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // update the provider filters for only those types selected and available
+ private void setProviderFilters() {
+
+ xsdTypeProvider.setFilter( FILTER_TYPES & includeTypes );
+
+ //
https://issues.jboss.org/browse/JBIDE-8075
+ // enable/disable selection of Message objects
+ if ( (includeTypes & INCLUDE_MESSAGE_TYPES) > 0 ) {
+ messageTypeProvider.setFilter( showMessages ? 1 : 0 );
+ }
+ else {
+ messageTypeProvider.setFilter( 0 );
+ }
+ }
}
Deleted:
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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDElementSelectorDialog.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -1,62 +0,0 @@
-/*
- * 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;
- }
-
-}
Deleted:
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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/XSDTypeSelectorDialog.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -1,57 +0,0 @@
-/*
- * 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/properties/DialogVariableTypeSelector.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DialogVariableTypeSelector.java 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DialogVariableTypeSelector.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -29,7 +29,8 @@
public class DialogVariableTypeSelector extends VariableTypeSelector {
public DialogVariableTypeSelector(Composite parent, int style, BPELEditor bpelEditor,
Shell shell, Callback callback, TabbedPropertySheetWidgetFactory wf) {
- super(parent, style, bpelEditor, wf, callback, false);
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ super(parent, style, bpelEditor, wf, callback);
this.shell = shell;
}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/FaultCatchNameSection.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/FaultCatchNameSection.java 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/FaultCatchNameSection.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -58,6 +58,7 @@
import org.eclipse.bpel.ui.commands.SetVariableCommand;
import org.eclipse.bpel.ui.commands.SetVariableKindCommand;
import org.eclipse.bpel.ui.commands.util.AutoUndoCommand;
+import org.eclipse.bpel.ui.dialogs.TypeSelectorDialog;
import org.eclipse.bpel.ui.uiextensionmodel.VariableExtension;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.BatchedMultiObjectAdapter;
@@ -609,8 +610,10 @@
}
});
+ //
https://issues.jboss.org/browse/JBIDE-8045
variableTypeSelector = new VariableTypeSelector(composite, SWT.NONE, getBPELEditor(),
- fWidgetFactory, new FaultVariableTypeCallback(), false);
+ fWidgetFactory, new FaultVariableTypeCallback(), false,
+ TypeSelectorDialog.INCLUDE_ELEMENT_DECLARATIONS |
TypeSelectorDialog.INCLUDE_MESSAGE_TYPES);
data = new FlatFormData();
data.top = new FlatFormAttachment(variableNameText, IDetailsAreaConstants.VSPACE+4);
data.left = new FlatFormAttachment(0,0);
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSection.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSection.java 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSection.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -18,6 +18,7 @@
import org.eclipse.bpel.ui.commands.CompoundCommand;
import org.eclipse.bpel.ui.commands.SetVariableKindCommand;
import org.eclipse.bpel.ui.commands.SetVariableTypeCommand;
+import org.eclipse.bpel.ui.dialogs.TypeSelectorDialog;
import org.eclipse.bpel.ui.uiextensionmodel.VariableExtension;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.BatchedMultiObjectAdapter;
@@ -186,8 +187,10 @@
protected void createClient(Composite parent) {
Composite composite = parentComposite = createFlatFormComposite(parent);
+ //
https://issues.jboss.org/browse/JBIDE-8045
variableTypeSelector = new VariableTypeSelector(composite, SWT.NONE, getBPELEditor(),
- fWidgetFactory, new VariableTypeCallback(), true);
+ fWidgetFactory, new VariableTypeCallback(), true,
+ TypeSelectorDialog.INCLUDE_ALL);
FlatFormData data = new FlatFormData();
data.top = new FlatFormAttachment(0,0);
data.left = new FlatFormAttachment(0,0);
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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableTypeSelector.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -33,6 +33,7 @@
import org.eclipse.bpel.ui.details.providers.OperationContentProvider;
import org.eclipse.bpel.ui.details.providers.PortTypeContentProvider;
import org.eclipse.bpel.ui.details.providers.VariableTypeTreeContentProvider;
+import org.eclipse.bpel.ui.dialogs.TypeSelectorDialog;
import org.eclipse.bpel.ui.uiextensionmodel.VariableExtension;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.BrowseUtil;
@@ -133,18 +134,21 @@
protected BPELEditor bpelEditor;
protected Callback callback;
protected Shell shell;
- protected boolean allowElements = false;
protected boolean nullFilterAdded = false;
+ protected int filter = TypeSelectorDialog.INCLUDE_ALL;
+ protected boolean requireLowerTreeSelection = false;
+
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // removed unused "allowElements" param
public VariableTypeSelector(Composite parent, int style, BPELEditor bpelEditor,
- TabbedPropertySheetWidgetFactory wf, Callback callback, boolean allowElements)
+ TabbedPropertySheetWidgetFactory wf, Callback callback)
{
super(parent, style);
this.bpelEditor = bpelEditor;
this.shell = bpelEditor.getSite().getShell();
this.wf = wf;
this.callback = callback;
- this.allowElements = allowElements;
Composite parentComposite = createComposite(this);
this.setLayout(new FillLayout(SWT.VERTICAL));
@@ -157,6 +161,17 @@
createDataTypeWidgets(parentComposite);
}
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // new constructor to allow constraining the filter checkboxes to only those types
+ // valid for the object being defined/modified
+ public VariableTypeSelector(Composite parent, int style, BPELEditor bpelEditor,
+ TabbedPropertySheetWidgetFactory wf, Callback callback, boolean
requireLowerTreeSelection, int filter)
+ {
+ this(parent, style, bpelEditor, wf, callback);
+ this.filter = filter;
+ this.requireLowerTreeSelection = requireLowerTreeSelection;
+ }
+
/**
* Refresh the given CComboViewer, and also make sure selectedObject is selected in it.
*/
@@ -661,7 +676,9 @@
dataTypeBrowseButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
- Object xsdType = BrowseUtil.browseForXSDTypeOrElement(bpelEditor.getProcess(),
getShell());
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ Object xsdType = BrowseUtil.browseForVariableType(
+ bpelEditor.getProcess(), getShell(),requireLowerTreeSelection,filter);
if (xsdType != null) {
lastChangeContext = DATATYPE_BROWSE_CONTEXT;
if (xsdType instanceof XSDTypeDefinition) {
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 2011-03-16
17:53:52 UTC (rev 29826)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/util/BrowseUtil.java 2011-03-16
19:31:01 UTC (rev 29827)
@@ -10,11 +10,9 @@
*******************************************************************************/
package org.eclipse.bpel.ui.util;
-import org.eclipse.bpel.ui.dialogs.MessageSelectorTypeDialog;
+import org.eclipse.bpel.ui.dialogs.TypeSelectorDialog;
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;
@@ -39,7 +37,14 @@
}
public static Object browseForXSDTypeOrElement(EObject eObject, Shell parent) {
- TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject);
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // changed TypeSelectorDialog
+ TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject,
+ TypeSelectorDialog.INCLUDE_SIMPLE_TYPES |
+ TypeSelectorDialog.INCLUDE_COMPLEX_TYPES |
+ TypeSelectorDialog.INCLUDE_ELEMENT_DECLARATIONS |
+ TypeSelectorDialog.INCLUDE_PRIMITIVES
+ );
if (dialog.open() != Window.OK) {
return null;
}
@@ -71,7 +76,10 @@
}
public static Object[] browseForXSDType(EObject eObject, Shell parent) {
- TypeSelectorDialog dialog = new XSDTypeSelectorDialog (parent,eObject);
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // removed use of specialized selection dialog
+ TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject,
+ TypeSelectorDialog.INCLUDE_XSD_TYPES);
if (dialog.open() != Window.OK) {
return null;
}
@@ -84,8 +92,11 @@
}
public static Object[] browseForXSDElement(EObject eObject, Shell parent, boolean
requireElementSelection) {
- XSDElementSelectorDialog dialog = new XSDElementSelectorDialog (parent,eObject);
- dialog.setRequireElementSelection(requireElementSelection);
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // removed use of specialized selection dialog
+ TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject,
+ TypeSelectorDialog.INCLUDE_ELEMENT_DECLARATIONS);
+ dialog.setRequireLowerTreeSelection(requireElementSelection);
if (dialog.open() != Window.OK) {
return null;
}
@@ -98,8 +109,11 @@
}
public static Object[] browseForMessageType(EObject eObject, Shell parent, boolean
requirePartSelection) {
- MessageSelectorTypeDialog dialog = new MessageSelectorTypeDialog (parent,eObject);
- dialog.setRequirePartSelection(requirePartSelection);
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ // removed use of specialized selection dialog
+ TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject,
+ TypeSelectorDialog.INCLUDE_MESSAGE_TYPES);
+ dialog.setRequireLowerTreeSelection(requirePartSelection);
if (dialog.open() != Window.OK) {
return null;
}
@@ -111,4 +125,19 @@
}
+
+ //
https://issues.jboss.org/browse/JBIDE-8045
+ public static Object[] browseForVariableType(EObject eObject, Shell parent, boolean
requireElementSelection, int filter) {
+ TypeSelectorDialog dialog = new TypeSelectorDialog (parent,eObject,filter);
+ dialog.setRequireLowerTreeSelection(requireElementSelection);
+ if (dialog.open() != Window.OK) {
+ return null;
+ }
+ Object obj[] = dialog.getResult();
+ if (obj != null && obj.length > 0) {
+ return obj;
+ }
+ return null;
+
+ }
}