Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java')
-rw-r--r--plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java721
1 files changed, 326 insertions, 395 deletions
diff --git a/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java b/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java
index bdc78d15f09..8952f5c628a 100644
--- a/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java
+++ b/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/MultipleReferencePropertyEditor.java
@@ -11,347 +11,270 @@
*****************************************************************************/
package org.eclipse.papyrus.properties.runtime.propertyeditor;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.properties.runtime.Activator;
-import org.eclipse.papyrus.properties.runtime.controller.EMFTStructuralFeatureController;
+import org.eclipse.jface.viewers.EditingSupport;
import org.eclipse.papyrus.properties.runtime.controller.IBoundedValuesController;
-import org.eclipse.papyrus.properties.runtime.controller.IWizardPropertyEditorController;
import org.eclipse.papyrus.properties.runtime.controller.PropertyEditorController;
-import org.eclipse.papyrus.properties.runtime.modelhandler.emf.EMFFeatureModelHandler;
-import org.eclipse.papyrus.properties.runtime.propertyeditor.descriptor.IPropertyEditorDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-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.Display;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
/**
* Property editor for references that have multiplicity [n..*]
*/
-public class MultipleReferencePropertyEditor extends AbstractPropertyEditor {
+public class MultipleReferencePropertyEditor extends AbstractTablePropertyEditor {
/** id of this editor */
public static final String ID = "org.eclipse.papyrus.properties.runtime.multipleReferencePropertyEditor";
- /** main composite created by this property editor */
- protected Composite composite;
-
- /** button to add a reference or modify existing one */
- protected Button addButton;
-
- /** button to remove reference */
- protected Button removeButton;
-
- /** table area that displays the reference name or toString */
- protected Table referenceArea;
-
- /** table area that displays the reference name or toString */
- protected TableViewer referencesViewer;
-
- /** current Value */
- protected List<EObject> currentValue;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Composite createContent(Composite parent) {
- composite = getWidgetFactory().createComposite(parent, SWT.NONE);
- int columnNu = getColumnNumber();
- GridLayout layout = new GridLayout(columnNu, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- composite.setLayoutData(data);
-
- // creates label. No TOP/DOWN/etc. position, always on top
- createLabel(composite);
-
- if(!getIsReadOnly()) {
- // create Button area
- addButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
- addButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Add_12x12.gif")));
- data = new GridData(SWT.FILL, SWT.CENTER, false, false);
- addButton.setLayoutData(data);
- addButton.addMouseListener(new MouseListener() {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public void mouseUp(MouseEvent e) {
- // pops up a window to ask for a new reference
- Display display = Display.getCurrent();
- if(display == null && PlatformUI.isWorkbenchRunning()) {
- display = PlatformUI.getWorkbench().getDisplay();
- }
- display = (display != null) ? display : Display.getDefault();
-
- // FIXME: specific part to use with EMF properties... should be moved inside the controller ?!
- EObject eObject = ((EMFTStructuralFeatureController)getController()).getObjectsToEdit().get(0);
- EMFFeatureModelHandler handler = (EMFFeatureModelHandler)((EMFTStructuralFeatureController)getController()).getModelHandler();
- EStructuralFeature feature = handler.getFeatureByName(eObject);
- EClassifier eclassifier = feature.getEType();
- Object availableValues = ((IBoundedValuesController)getController()).getAvailableValues();
- List<?> values = new ArrayList<Object>();
- if(availableValues instanceof List<?>) {
- values = (List<?>)availableValues;
- } else if(availableValues instanceof Object[]) {
- values = Arrays.asList(availableValues);
- } else {
- values = Arrays.asList(availableValues);
- }
- FeatureEditorDialog dialog = new FeatureEditorDialog(display.getActiveShell(), ((IBoundedValuesController)getController()).getBrowserLabelProvider(), eObject, eclassifier, getValue(), "Select " + getController().getPropertyEditor().getDescriptor().getLabel(), values, false, feature.isOrdered(), feature.isUnique());
- // should select the current value by default
- if(Dialog.OK == dialog.open()) {
- currentValue = (List<EObject>)dialog.getResult();
- // now, apply the new value
- getController().updateModel();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDown(MouseEvent e) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDoubleClick(MouseEvent e) {
- }
- });
-
- removeButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
- removeButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Delete_12x12.gif")));
- data = new GridData(SWT.FILL, SWT.CENTER, false, false);
- removeButton.setLayoutData(data);
- removeButton.addMouseListener(new MouseListener() {
-
- /**
- * {@inheritDoc}
- */
- public void mouseUp(MouseEvent e) {
- if(!(getController() instanceof IWizardPropertyEditorController)) {
- return;
- }
- // use selection to remove element
- // retrieve selected element(s)
- IStructuredSelection selection = (IStructuredSelection)referencesViewer.getSelection();
- if(selection == null || selection.isEmpty()) {
- // nothing selected.
- return;
- }
-
- // copy current value
- List<EObject> values = new ArrayList<EObject>(currentValue);
- // remove selected elements from values
- values.removeAll(selection.toList());
-
- currentValue = values;
- getController().updateModel();
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDown(MouseEvent e) {
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
-
- if(((IBoundedValuesController)getController()).canMoveValues()) {
- Button upButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
- upButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Up_12x12.gif")));
- data = new GridData(SWT.FILL, SWT.CENTER, false, false);
- upButton.setLayoutData(data);
- upButton.addMouseListener(new MouseListener() {
-
- /**
- * {@inheritDoc}
- */
- public void mouseUp(MouseEvent e) {
- // use selection to remove element
- // retrieve selected element(s)
- IStructuredSelection selection = (IStructuredSelection)referencesViewer.getSelection();
- if(selection == null || selection.isEmpty()) {
- // nothing selected.
- return;
- }
- @SuppressWarnings("unchecked")
- List<Object> selectedObjects = selection.toList();
- IUndoableOperation moveOperation = ((IBoundedValuesController)getController()).getMoveCurrentValuesOperation(selectedObjects, -1);
- if(moveOperation != null && moveOperation.canExecute()) {
- try {
- OperationHistoryFactory.getOperationHistory().execute(moveOperation, new NullProgressMonitor(), null);
- } catch (ExecutionException e1) {
- Activator.log.error(e1);
- } finally {
- // try to restore selection in the view
- referencesViewer.setSelection(selection, true);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDown(MouseEvent e) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDoubleClick(MouseEvent e) {
- }
- });
-
- Button downButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
- downButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Down_12x12.gif")));
- data = new GridData(SWT.FILL, SWT.CENTER, false, false);
- downButton.setLayoutData(data);
- downButton.addMouseListener(new MouseListener() {
-
- /**
- * {@inheritDoc}
- */
- public void mouseUp(MouseEvent e) {
- // use selection to remove element
- // retrieve selected element(s)
- IStructuredSelection selection = (IStructuredSelection)referencesViewer.getSelection();
- if(selection == null || selection.isEmpty()) {
- // nothing selected.
- return;
- }
- @SuppressWarnings("unchecked")
- List<Object> selectedObjects = selection.toList();
- IUndoableOperation moveOperation = ((IBoundedValuesController)getController()).getMoveCurrentValuesOperation(selectedObjects, +1);
- if(moveOperation != null && moveOperation.canExecute()) {
- try {
- OperationHistoryFactory.getOperationHistory().execute(moveOperation, new NullProgressMonitor(), null);
- } catch (ExecutionException e1) {
- Activator.log.error(e1);
- } finally {
- // try to restore selection in the view
- referencesViewer.setSelection(selection, true);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDown(MouseEvent e) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void mouseDoubleClick(MouseEvent e) {
- }
- });
- }
- }
-
- // creates table for the display of references
- referenceArea = new Table(composite, SWT.BORDER | SWT.MULTI);
- data = new GridData(SWT.FILL, SWT.FILL, true, true, columnNu, 1);
- data.heightHint = 80;
- referenceArea.setLayoutData(data);
- referencesViewer = new TableViewer(referenceArea);
- referencesViewer.setContentProvider(new IStructuredContentProvider() {
-
- /**
- * {@inheritDoc}
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
-
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
- });
- referencesViewer.setLabelProvider(((IBoundedValuesController)getController()).getEditorLabelProvider());
-
- referencesViewer.getControl().setToolTipText(getTooltipText());
-
- return composite;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Control createLabel(Composite parent) {
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
- return createLabel(parent, data);
- }
-
- /**
- * Returns the number of column for the composite
- *
- * @return the number of column for the composite
- */
- protected int getColumnNumber() {
- if(getIsReadOnly()) {
- return 1;
- }
- if(((IBoundedValuesController)getController()).canMoveValues()) {
- return 5;
- }
- return 3;
- }
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public Composite createContent(Composite parent) {
+ // composite = getWidgetFactory().createComposite(parent, SWT.NONE);
+ // int columnNu = getColumnNumber();
+ // GridLayout layout = new GridLayout(columnNu, false);
+ // layout.marginHeight = 0;
+ // layout.marginWidth = 0;
+ // composite.setLayout(layout);
+ // GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+ // composite.setLayoutData(data);
+ //
+ // // creates label. No TOP/DOWN/etc. position, always on top
+ // createLabel(composite);
+ //
+ // if(!getIsReadOnly()) {
+ // // create Button area
+ // addButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
+ // addButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Add_12x12.gif")));
+ // data = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ // addButton.setLayoutData(data);
+ // addButton.addMouseListener(new MouseListener() {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @SuppressWarnings("unchecked")
+ // public void mouseUp(MouseEvent e) {
+ // PER
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDown(MouseEvent e) {
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDoubleClick(MouseEvent e) {
+ // }
+ // });
+ //
+ // removeButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
+ // removeButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Delete_12x12.gif")));
+ // data = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ // removeButton.setLayoutData(data);
+ // removeButton.addMouseListener(new MouseListener() {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseUp(MouseEvent e) {
+ // if(!(getController() instanceof IWizardPropertyEditorController)) {
+ // return;
+ // }
+ // // use selection to remove element
+ // // retrieve selected element(s)
+ // IStructuredSelection selection = (IStructuredSelection)referencesViewer.getSelection();
+ // if(selection == null || selection.isEmpty()) {
+ // // nothing selected.
+ // return;
+ // }
+ //
+ // // copy current value
+ // List<EObject> values = new ArrayList<EObject>(currentValue);
+ // // remove selected elements from values
+ // values.removeAll(selection.toList());
+ //
+ // currentValue = values;
+ // getController().updateModel();
+ //
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDown(MouseEvent e) {
+ //
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDoubleClick(MouseEvent e) {
+ //
+ // }
+ // });
+ //
+ // if(getController().canMoveValues(new ArrayList<Integer>(), 0)) { // only checks if elements can be moved, not real move, so a 0-delta is fine
+ // Button upButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
+ // upButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Up_12x12.gif")));
+ // data = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ // upButton.setLayoutData(data);
+ // upButton.addMouseListener(new MouseListener() {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseUp(MouseEvent e) {
+ // int[] selectionIndices = referencesViewer.getTable().getSelectionIndices();
+ // final List<Integer> selectionList = new ArrayList<Integer>();
+ // final List<Integer> newSelectionList = new ArrayList<Integer>();
+ // for(int i : selectionIndices) {
+ // selectionList.add(i);
+ // newSelectionList.add(i - 1);
+ // }
+ // IUndoableOperation moveOperation = getController().getMoveCurrentValuesOperation(selectionList, -1);
+ // if(moveOperation != null && moveOperation.canExecute()) {
+ // try {
+ // OperationHistoryFactory.getOperationHistory().execute(moveOperation, new NullProgressMonitor(), null);
+ // // try to restore selection in the view
+ // int[] newSelection = new int[newSelectionList.size()];
+ // for(int i = 0; i < newSelectionList.size(); i++) {
+ // newSelection[i] = newSelectionList.get(i);
+ // }
+ // referencesViewer.getTable().select(newSelection);
+ // } catch (ExecutionException e1) {
+ // Activator.log.error(e1);
+ // }
+ // }
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDown(MouseEvent e) {
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDoubleClick(MouseEvent e) {
+ // }
+ // });
+ //
+ // Button downButton = getWidgetFactory().createButton(composite, "", SWT.NONE);
+ // downButton.setImage(Activator.getImageFromDescriptor(Activator.imageDescriptorFromPlugin(Activator.ID, "icons/Down_12x12.gif")));
+ // data = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ // downButton.setLayoutData(data);
+ // downButton.addMouseListener(new MouseListener() {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseUp(MouseEvent e) {
+ // // use selection to remove element
+ // // retrieve selected element(s)
+ // int[] selectionIndices = referencesViewer.getTable().getSelectionIndices();
+ // final List<Integer> selectionList = new ArrayList<Integer>();
+ // final List<Integer> newSelectionList = new ArrayList<Integer>();
+ // for(int i : selectionIndices) {
+ // selectionList.add(i);
+ // newSelectionList.add(i + 1);
+ // }
+ // IUndoableOperation moveOperation = getController().getMoveCurrentValuesOperation(selectionList, +1);
+ // if(moveOperation != null && moveOperation.canExecute()) {
+ // try {
+ // OperationHistoryFactory.getOperationHistory().execute(moveOperation, new NullProgressMonitor(), null);
+ // // try to restore selection in the view
+ // int[] newSelection = new int[newSelectionList.size()];
+ // for(int i = 0; i < newSelectionList.size(); i++) {
+ // newSelection[i] = newSelectionList.get(i);
+ // }
+ // referencesViewer.getTable().select(newSelection);
+ // } catch (ExecutionException e1) {
+ // Activator.log.error(e1);
+ // }
+ // }
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDown(MouseEvent e) {
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void mouseDoubleClick(MouseEvent e) {
+ // }
+ // });
+ // }
+ // }
+ //
+ // // creates table for the display of references
+ // referenceArea = new Table(composite, SWT.BORDER | SWT.MULTI);
+ // data = new GridData(SWT.FILL, SWT.FILL, true, true, columnNu, 1);
+ // data.heightHint = 80;
+ // referenceArea.setLayoutData(data);
+ // referencesViewer = new TableViewer(referenceArea);
+ // referencesViewer.setContentProvider(new IStructuredContentProvider() {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ //
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void dispose() {
+ //
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public Object[] getElements(Object inputElement) {
+ // if(inputElement instanceof List<?>) {
+ // return ((List<?>)inputElement).toArray();
+ // }
+ // return new Object[0];
+ // }
+ // });
+ // referencesViewer.setLabelProvider(((IBoundedValuesController)getController()).getEditorLabelProvider());
+ //
+ // referencesViewer.getControl().setToolTipText(getTooltipText());
+ //
+ // return composite;
+ // }
+
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected Control createLabel(Composite parent) {
+ // GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+ // return createLabel(parent, data);
+ // }
+ //
+ // /**
+ // * Returns the number of column for the composite
+ // *
+ // * @return the number of column for the composite
+ // */
+ // protected int getColumnNumber() {
+ // if(getIsReadOnly()) {
+ // return 1;
+ // }
+ // if(getController().canMoveValues(new ArrayList<Integer>(), 0)) {
+ // return 5;
+ // }
+ // return 3;
+ // }
/**
* {@inheritDoc}
@@ -366,71 +289,79 @@ public class MultipleReferencePropertyEditor extends AbstractPropertyEditor {
* {@inheritDoc}
*/
@Override
- public void handleContentChanged() {
- // this should tells the controller that the input has to be applied to the model
- getController().updateModel();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IStatus init(IPropertyEditorDescriptor descriptor) {
- setDescriptor(descriptor);
- setTooltipText(descriptor.getTooltipText());
- return Status.OK_STATUS;
+ protected EditingSupport createEditingSupport() {
+ return null;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getValue() {
- if(isValid(referenceArea)) {
- return currentValue;
- } else {
- Activator.log.error("trying to read the value of the reference area whereas the combo is disposed", null);
- }
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- @Override
- public void setValue(Object valueToEdit) {
- if(!isValid(referenceArea)) {
- return;
- }
- if(valueToEdit instanceof EList<?>) {
- currentValue = (EList<EObject>)valueToEdit;
- } else {
- Activator.log.error("Waiting for a list of EObject", null);
- }
- referencesViewer.setInput((valueToEdit != null) ? valueToEdit : Collections.emptyList());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void dispose() {
- if(isValid(composite)) {
- composite.dispose();
- composite = null;
- setController(null);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isDisposed() {
- if(composite == null) {
- return true;
- }
- return composite.isDisposed();
- }
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public void handleContentChanged() {
+ // // this should tells the controller that the input has to be applied to the model
+ // getController().updateModel();
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public IStatus init(IPropertyEditorDescriptor descriptor) {
+ // setDescriptor(descriptor);
+ // setTooltipText(descriptor.getTooltipText());
+ // return Status.OK_STATUS;
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public List<EObject> getValue() {
+ // if(isValid(referenceArea)) {
+ // return currentValue;
+ // } else {
+ // Activator.log.error("trying to read the value of the reference area whereas the combo is disposed", null);
+ // }
+ // return Collections.emptyList();
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @SuppressWarnings("unchecked")
+ // @Override
+ // public void setValue(Object valueToEdit) {
+ // if(!isValid(referenceArea)) {
+ // return;
+ // }
+ // if(valueToEdit instanceof EList<?>) {
+ // currentValue = (EList<EObject>)valueToEdit;
+ // } else {
+ // Activator.log.error("Waiting for a list of EObject", null);
+ // }
+ // referencesViewer.setInput((valueToEdit != null) ? valueToEdit : Collections.emptyList());
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public void dispose() {
+ // if(isValid(composite)) {
+ // composite.dispose();
+ // composite = null;
+ // setController(null);
+ // }
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public boolean isDisposed() {
+ // if(composite == null) {
+ // return true;
+ // }
+ // return composite.isDisposed();
+ // }
}

Back to the top