diff options
author | kwilk | 2012-06-28 20:56:12 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2012-06-28 20:56:12 +0000 |
commit | 4ae001566ddb6e00cb66851c495012db7ed807d1 (patch) | |
tree | 5ae28a5fe643a37122e994278b594a24fd6c4c97 /plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui | |
parent | 25073e175a543429ce734ecd85a7cc52d18d0506 (diff) | |
download | org.eclipse.osee-4ae001566ddb6e00cb66851c495012db7ed807d1.tar.gz org.eclipse.osee-4ae001566ddb6e00cb66851c495012db7ed807d1.tar.xz org.eclipse.osee-4ae001566ddb6e00cb66851c495012db7ed807d1.zip |
feature[ats_7JQVG]: Widget changes for cross branch reference editing
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui')
8 files changed, 288 insertions, 43 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java index a18a7e4f482..6b53ef0fd26 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java @@ -87,7 +87,6 @@ public class ArtifactEditor extends AbstractEventArtifactEditor { @Override public void showBusy(boolean busy) { - super.showBusy(busy); ArtifactFormPage page = getFormPage(); if (page != null) { page.showBusy(busy); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java index 173d73b3580..99b1adb5130 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java @@ -36,7 +36,7 @@ import org.eclipse.swt.widgets.Listener; public class XBranchSelectWidget extends GenericXWidget implements Listener { public static final String WIDGET_ID = XBranchSelectWidget.class.getSimpleName(); - private BranchSelectComposite selectComposite; + protected BranchSelectComposite selectComposite; private Composite composite; private IOseeBranch defaultBranch; @@ -141,7 +141,7 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { Displays.ensureInDisplayThread(new Runnable() { @Override public void run() { - if (Strings.isValid(toolTip) != false) { + if (Strings.isValid(toolTip)) { XBranchSelectWidget.super.setToolTip(toolTip); if (selectComposite != null && selectComposite.isDisposed() != true) { selectComposite.setToolTipText(toolTip); @@ -158,6 +158,7 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { public void handleEvent(Event event) { super.validate(); notifyListeners(event); + notifyXModifiedListeners(); } public void addListener(Listener listener) { @@ -184,5 +185,4 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { public BranchSelectComposite getSelectComposite() { return selectComposite; } - }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidgetWithSave.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidgetWithSave.java new file mode 100644 index 00000000000..eafc970f5b6 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidgetWithSave.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2012 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.ui.skynet.widgets; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.util.Result; +import org.eclipse.osee.framework.jdk.core.util.Collections; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +public class XBranchSelectWidgetWithSave extends XBranchSelectWidget implements IAttributeWidget { + + private Artifact artifact; + private IAttributeType attributeType; + + public XBranchSelectWidgetWithSave(String label) { + super(label); + addXModifiedListener(new DirtyListener()); + } + + public List<IOseeBranch> getStored() throws OseeCoreException { + return artifact.getAttributeValues(attributeType); + } + + @Override + public Artifact getArtifact() { + return artifact; + } + + @Override + public void saveToArtifact() throws OseeCoreException { + artifact.setAttributeFromValues(attributeType, Arrays.asList(getSelection())); + } + + @Override + public void revert() throws OseeCoreException { + setAttributeType(getArtifact(), getAttributeType()); + } + + @Override + public Result isDirty() { + if (isEditable()) { + try { + Collection<IOseeBranch> storedValues = getStored(); + Collection<IOseeBranch> widgetInput = Arrays.asList(getSelection()); + if (!Collections.isEqual(widgetInput, storedValues)) { + return new Result(true, getAttributeType() + " is dirty"); + } + } catch (OseeCoreException ex) { + // Do nothing + } + } + return Result.FalseResult; + } + + @Override + public void setAttributeType(Artifact artifact, IAttributeType attributeTypeName) throws OseeCoreException { + this.artifact = artifact; + this.attributeType = attributeTypeName; + List<IOseeBranch> storedBranchReference = getStored(); + if (!storedBranchReference.isEmpty()) { + setSelection(storedBranchReference.get(0)); + } + } + + @Override + public IAttributeType getAttributeType() { + return attributeType; + } + + private class DirtyListener implements XModifiedListener { + @Override + public void widgetModified(XWidget widget) { + isDirty(); + } + } + +} diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewWithSave.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewWithSave.java new file mode 100644 index 00000000000..d31d753c13e --- /dev/null +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewWithSave.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright (c) 2012 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.ui.skynet.widgets; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.util.Result; +import org.eclipse.osee.framework.jdk.core.util.Collections; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +/** + * XListDropViewer with save artifacts/state + */ +public class XListDropViewWithSave extends XListDropViewer implements IAttributeWidget { + + private Artifact artifact; + private IAttributeType attributeType; + + public XListDropViewWithSave(String displayLabel) { + super(displayLabel); + addXModifiedListener(dirtyListener); + singleItemMode = true; + } + + public List<Artifact> getStored() throws OseeCoreException { + return artifact.getAttributeValues(attributeType); + } + + @Override + public Artifact getArtifact() { + return artifact; + } + + @Override + public void setAttributeType(Artifact artifact, IAttributeType attributeTypeName) throws OseeCoreException { + this.artifact = artifact; + this.attributeType = attributeTypeName; + List<Artifact> storedArtifacts = getStored(); + if (!storedArtifacts.isEmpty()) { + setSelected(storedArtifacts); + setInput(storedArtifacts); + } + } + + @Override + public void saveToArtifact() throws OseeCoreException { + List<Artifact> artifacts = getArtifacts(); + Collection<Artifact> saveItems = null; + if (!artifacts.isEmpty()) { + saveItems = Arrays.asList(artifacts.get(0)); + } else { + saveItems = java.util.Collections.emptyList(); + } + artifact.setAttributeFromValues(CoreAttributeTypes.ArtifactReference, saveItems); + } + + @Override + public void revert() throws OseeCoreException { + setAttributeType(getArtifact(), getAttributeType()); + } + + @Override + public IAttributeType getAttributeType() { + return attributeType; + } + + @Override + public Result isDirty() { + if (isEditable()) { + try { + List<Artifact> enteredValues = new ArrayList<Artifact>(); + Collections.flatten(getArtifacts(), enteredValues); + Collection<Artifact> storedValues = getStored(); + if (!Collections.isEqual(enteredValues, storedValues)) { + return new Result(true, getAttributeType() + " is dirty"); + } + } catch (OseeCoreException ex) { + // Do nothing + } + } + return Result.FalseResult; + } + private final XModifiedListener dirtyListener = new XModifiedListener() { + @Override + public void widgetModified(XWidget widget) { + isDirty(); + } + }; +} diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java index e87f8a67110..ac819c2c05e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java @@ -13,12 +13,15 @@ package org.eclipse.osee.framework.ui.skynet.widgets; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.List; +import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.operation.ClientLogger; import org.eclipse.osee.framework.core.operation.Operations; +import org.eclipse.osee.framework.jdk.core.util.Collections; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider; import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactTransfer; @@ -49,6 +52,8 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable private Menu popupMenu; + protected boolean singleItemMode; + public XListDropViewer(String displayLabel) { super(displayLabel); this.myArrayContentProvider = new ArrayContentProvider(); @@ -71,7 +76,7 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable private void createRemoveFromMenuItem(final Menu popupMenu) { removeFromMenuItem = new MenuItem(popupMenu, SWT.PUSH); - removeFromMenuItem.setText("Remove From This Blam's Parameters "); + removeFromMenuItem.setText("Remove"); removeFromMenuItem.addSelectionListener(new SelectionAdapter() { @Override @@ -79,15 +84,20 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable IStructuredSelection structuredSelection = (IStructuredSelection) myTableViewer.getSelection(); Iterator<?> iterator = structuredSelection.iterator(); - Object orginalInput = getInput(); - Collection<Object> modList = getCollectionInput(); + Collection<Object> items = getCollectionInput(); + if (items != null && !items.isEmpty()) { + List<Object> modList = new ArrayList<Object>(); - while (iterator.hasNext()) { - modList.remove(iterator.next()); - } + while (iterator.hasNext()) { + modList.remove(iterator.next()); + } - myArrayContentProvider.inputChanged(myTableViewer, orginalInput, modList); - refresh(); + Object orginalInput = getInput(); + myArrayContentProvider.inputChanged(myTableViewer, orginalInput, modList); + setInput(modList); + notifyXModifiedListeners(); + refresh(); + } } }); @@ -107,8 +117,8 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable TextTransfer transfer = TextTransfer.getInstance(); String data = (String) cb.getContents(transfer); Branch branch = BranchSelectionDialog.getBranchFromUser(); - Operations.executeAsJob(new StringGuidsToArtifactListOperation(new ClientLogger( - Activator.class), data, branch, XListDropViewer.this), true); + Operations.executeAsJob(new StringGuidsToArtifactListOperation(new ClientLogger(Activator.class), + data, branch, XListDropViewer.this), true); } finally { cb.dispose(); } @@ -119,16 +129,24 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable }); } + public List<Artifact> getArtifacts() { + return Collections.castAll(getData()); + } + + public List<Artifact> getSelectedArtifacts() { + List<Object> selectedArtifacts = new ArrayList<Object>(); + Collections.flatten(getSelected(), selectedArtifacts); + return Collections.castAll(Artifact.class, selectedArtifacts); + } + /** * Adds artifacts to the viewer's input. */ public void addToInput(Artifact... artifacts) { - ArrayList<Object> objects = new ArrayList<Object>(); - + List<Object> objects = new ArrayList<Object>(); for (Artifact artifact : artifacts) { objects.add(artifact); } - addToInput(objects); } @@ -150,12 +168,14 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable } } + @SuppressWarnings("unchecked") @Override - public Object getData() { - return getInput(); + public Collection<Object> getData() { + return (Collection<Object>) getInput(); } private class XDragAndDrop extends SkynetDragAndDrop { + public XDragAndDrop() { super(null, getControl(), "viewId"); } @@ -175,6 +195,13 @@ public class XListDropViewer extends XListViewer implements IXWidgetInputAddable @Override public void performArtifactDrop(Artifact[] dropArtifacts) { addToInput(dropArtifacts); + if (XListDropViewer.this.singleItemMode && dropArtifacts.length > 1) { + setMessage(XListDropViewer.class.getSimpleName(), String.format("Only 1 [%s] can be present", getLabel()), + IMessageProvider.ERROR); + } + setSelected(dropArtifacts); + notifyXModifiedListeners(); + refresh(); } } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java index 42f0c53e822..c952069197f 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.widgets; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import org.eclipse.core.runtime.IStatus; @@ -72,6 +73,8 @@ public class XListViewer extends GenericXWidget { private int widthHint; private int heightHint; + private StructuredSelection preselected; + public XListViewer(String displayLabel) { super(displayLabel); } @@ -103,14 +106,16 @@ public class XListViewer extends GenericXWidget { this.sorter = sorter; } - public void setInput(Collection<Object> input) { - this.input = input; - if (listViewer != null) { - listViewer.setInput(input); - } + public void setInputArtifacts(Collection<? extends Artifact> arts) { + setInput(arts); } public void setInput(Object input) { + setInput(Arrays.asList(input)); + } + + public void setInput(Collection<Object> input) { + this.input = input; if (listViewer != null) { listViewer.setInput(input); } @@ -124,12 +129,6 @@ public class XListViewer extends GenericXWidget { return input; } - public void setInputArtifacts(Collection<? extends Artifact> arts) { - ArrayList<Object> objs = new ArrayList<Object>(); - objs.addAll(arts); - setInput(objs); - } - public void addSelectionChangedListener(ISelectionChangedListener listener) { listViewer.addSelectionChangedListener(listener); } @@ -192,6 +191,7 @@ public class XListViewer extends GenericXWidget { handleSelection(); } }); + GridData gd = new GridData(GridData.FILL_BOTH); gd.verticalSpan = 10; if (grabHorizontal) { @@ -210,6 +210,10 @@ public class XListViewer extends GenericXWidget { if (defaultSelectedObject != null) { setSelected(defaultSelectedObject); } + if (preselected != null) { + setSelected(preselected); + } + updateListWidget(); } @@ -258,8 +262,10 @@ public class XListViewer extends GenericXWidget { } protected void updateListWidget() { - listViewer.refresh(); - validate(); + if (listViewer != null) { + listViewer.refresh(); + validate(); + } } public void add(Object object) { @@ -280,16 +286,20 @@ public class XListViewer extends GenericXWidget { } public void setSelected(ArrayList<Object> selected) { - setSelected(new StructuredSelection(selected.toArray(new Object[selected.size()]))); + preselected = new StructuredSelection(selected.toArray(new Object[selected.size()])); + setSelected(preselected); } public void setSelected(Object selected) { - setSelected(new StructuredSelection(selected)); + preselected = new StructuredSelection(selected); + setSelected(preselected); } private void setSelected(StructuredSelection selection) { - listViewer.setSelection(selection); - updateListWidget(); + if (listViewer != null) { + listViewer.setSelection(selection); + updateListWidget(); + } } @Override diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DefaultAttributeXWidgetProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DefaultAttributeXWidgetProvider.java index bdd205e3052..53e08ddb421 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DefaultAttributeXWidgetProvider.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DefaultAttributeXWidgetProvider.java @@ -17,7 +17,9 @@ import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Lib; +import org.eclipse.osee.framework.skynet.core.attribute.ArtifactReferenceAttribute; import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; +import org.eclipse.osee.framework.skynet.core.attribute.BranchReferenceAttribute; import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute; import org.eclipse.osee.framework.skynet.core.utility.AttributeTypeToXWidgetName; import org.eclipse.osee.framework.ui.skynet.widgets.XOption; @@ -57,6 +59,10 @@ public class DefaultAttributeXWidgetProvider implements IAttributeXWidgetProvide if (useMultiLineWidget(attributeType)) { xWidgetName = "XStackedDam"; defaultData.getXOptionHandler().add(XOption.NOT_EDITABLE); + } else if (AttributeTypeManager.isBaseTypeCompatible(BranchReferenceAttribute.class, attributeType)) { + xWidgetName = "XBranchSelectWidgetWithSave"; + } else if (AttributeTypeManager.isBaseTypeCompatible(ArtifactReferenceAttribute.class, attributeType)) { + xWidgetName = "XListDropViewerWithSave"; } } catch (OseeCoreException ex) { xWidgetName = "XTextDam"; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java index 9449b4b3941..b651926cc74 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/FrameworkXWidgetProvider.java @@ -42,6 +42,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.XArtifactTypeMultiChoiceSele import org.eclipse.osee.framework.ui.skynet.widgets.XAttributeTypeComboViewer; import org.eclipse.osee.framework.ui.skynet.widgets.XAttributeTypeMultiChoiceSelect; import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget; +import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidgetWithSave; import org.eclipse.osee.framework.ui.skynet.widgets.XButton; import org.eclipse.osee.framework.ui.skynet.widgets.XButtonPush; import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox; @@ -64,6 +65,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.XLabel; import org.eclipse.osee.framework.ui.skynet.widgets.XLabelDam; import org.eclipse.osee.framework.ui.skynet.widgets.XList; import org.eclipse.osee.framework.ui.skynet.widgets.XListDam; +import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewWithSave; import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer; import org.eclipse.osee.framework.ui.skynet.widgets.XMembersCombo; import org.eclipse.osee.framework.ui.skynet.widgets.XMembersList; @@ -251,11 +253,9 @@ public final class FrameworkXWidgetProvider { xWidget = combo; if (Strings.isValid(xWidgetLayoutData.getDefaultValue())) { String value = xWidgetLayoutData.getDefaultValue(); - if (value == null) { - combo.set(""); - } else if (value.equals("true") || value.equals("yes")) { + if ("true".equals(value) || "yes".equals(value)) { combo.set("yes"); - } else if (value.equals("false") || value.equals("no")) { + } else if ("false".equals(value) || "no".equals(value)) { combo.set("no"); } else { combo.set(""); @@ -307,7 +307,11 @@ public final class FrameworkXWidgetProvider { } else if (xWidgetName.equals("XHyperlabelMemberSelection")) { xWidget = new XHyperlabelMemberSelection(name); } else if (xWidgetName.startsWith("XListDropViewer")) { - xWidget = new XListDropViewer(name); + if ("XListDropViewerWithSave".equals(xWidgetName)) { + xWidget = new XListDropViewWithSave(name); + } else { + xWidget = new XListDropViewer(name); + } } else if (xWidgetName.startsWith("XList")) { String values[] = xWidgetLayoutData.getDynamicXWidgetLayout().getOptionResolver().getWidgetOptions(xWidgetLayoutData); @@ -326,8 +330,15 @@ public final class FrameworkXWidgetProvider { XArtifactList artifactList = new XArtifactList(name); artifactList.setMultiSelect(xWidgetLayoutData.getXOptionHandler().contains(XOption.MULTI_SELECT)); xWidget = artifactList; - } else if (xWidgetName.equals(XBranchSelectWidget.WIDGET_ID)) { - XBranchSelectWidget widget = new XBranchSelectWidget(name); + } else if (xWidgetName.startsWith(XBranchSelectWidget.WIDGET_ID)) { + XBranchSelectWidget widget = null; + + if (xWidgetName.endsWith("WithSave")) { + widget = new XBranchSelectWidgetWithSave(name); + } else { + widget = new XBranchSelectWidget(name); + } + widget.setToolTip(xWidgetLayoutData.getToolTip()); try { String branchGuid = xWidgetLayoutData.getDefaultValue(); |