Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-03-05 17:15:31 +0000
committercletavernie2013-03-05 17:15:31 +0000
commit6fba62a50bf139c4584bba1dbca40ba307865d33 (patch)
tree888842f81a76457684d2908c7413ae648cf50c1f /plugins/uml/org.eclipse.papyrus.uml.import
parent2b3f54be65436eb1edd5fe299ce6172ad23bb020 (diff)
downloadorg.eclipse.papyrus-6fba62a50bf139c4584bba1dbca40ba307865d33.tar.gz
org.eclipse.papyrus-6fba62a50bf139c4584bba1dbca40ba307865d33.tar.xz
org.eclipse.papyrus-6fba62a50bf139c4584bba1dbca40ba307865d33.zip
290952: [CDO] Support for CDO model repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290952 Merged the cdo_kepler branch to the trunk (r9967 -> r10355)
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.import')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/META-INF/MANIFEST.MF1
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromUserModelHandler.java100
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromWorkspaceHandler.java165
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java25
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/ui/PackageImportDialog.java76
7 files changed, 167 insertions, 216 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.import/META-INF/MANIFEST.MF
index e1bf8717860..d61ee432453 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/META-INF/MANIFEST.MF
@@ -5,6 +5,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.uml2.uml;bundle-version="3.2.0",
org.eclipse.uml2.common.edit,
org.eclipse.papyrus.uml.extensionpoints;bundle-version="0.10.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.0",
org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.0",
org.eclipse.papyrus.uml.profile;bundle-version="0.10.0",
org.eclipse.emf.transaction;bundle-version="1.4.0",
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
index 236a32ee609..3124266293b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
@@ -46,7 +46,7 @@
<command
commandId="org.eclipse.papyrus.import.package.from.workspace"
icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
- label="Import Package From &amp;Workspace"
+ label="Import Package From &amp;User Model"
style="push">
</command>
</menu>
@@ -99,7 +99,7 @@
</activeWhen>
</handler>
<handler
- class="org.eclipse.papyrus.uml.importt.handlers.ImportPackageFromWorkspaceHandler"
+ class="org.eclipse.papyrus.uml.importt.handlers.ImportPackageFromUserModelHandler"
commandId="org.eclipse.papyrus.import.package.from.workspace">
<activeWhen>
<and>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromUserModelHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromUserModelHandler.java
new file mode 100644
index 00000000000..536b6851c5b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromUserModelHandler.java
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * Copyright (c) 2011, 2013 CEA LIST.
+ *
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - Refactoring package/profile import/apply UI for CDO
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.importt.handlers;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.command.ChangeCommand;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.uml.importt.ui.PackageImportDialog;
+import org.eclipse.papyrus.uml.profile.ui.dialogs.ElementImportTreeSelectionDialog.ImportSpec;
+import org.eclipse.papyrus.uml.tools.importsources.PackageImportSourceDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Package;
+
+
+public class ImportPackageFromUserModelHandler extends AbstractImportHandler {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getCommand() {
+ return new ImportFromFileCommand();
+ }
+
+ /**
+ * Specific {@link ChangeCommand} that imports libraries from repository
+ */
+ public class ImportFromFileCommand extends AbstractImportCommand {
+ /**
+ * Creates a new ImportLibraryFromRepositoryCommand
+ *
+ * @param editingDomain
+ * editing domain that manages the changed objects
+ * @param runnable
+ * process that executes the modifications
+ * @param label
+ * the label of the command
+ * @param description
+ * description of the command
+ */
+ public ImportFromFileCommand() {
+ super(new Runnable() {
+
+ public void run() {
+
+ // Retrieve shell instance
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ Collection<Package> packages = PackageImportSourceDialog
+ .open(shell, "Select the models to import",
+ getSelection());
+
+ if (packages == null) {
+ return; // user cancelled the dialog
+ }
+
+ if (!packages.isEmpty()) {
+ PackageImportDialog dialog = new PackageImportDialog(
+ PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(),
+ packages);
+
+ if (dialog.open() == Window.OK) {
+ Collection<ImportSpec<Package>> result = dialog.getResult();
+
+ for (ImportSpec<Package> resultElement : result) {
+ Package selectedPackage = resultElement
+ .getElement();
+ switch (resultElement.getAction()) {
+ case COPY :
+ handleCopyPackage(selectedPackage);
+ break;
+ default :
+ handleImportPackage(selectedPackage);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }, "Import Libraries", "Import Libraries from Workspace"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromWorkspaceHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromWorkspaceHandler.java
deleted file mode 100644
index fc658583f6c..00000000000
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportPackageFromWorkspaceHandler.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.importt.handlers;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectorDialog;
-import org.eclipse.papyrus.infra.widgets.providers.WorkspaceContentProvider;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.uml.extensionpoints.utils.Util;
-import org.eclipse.papyrus.uml.importt.ui.PackageImportDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.uml2.uml.Package;
-
-
-public class ImportPackageFromWorkspaceHandler extends AbstractImportHandler {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Command getCommand() {
- return new ImportFromFileCommand();
- }
-
- /**
- * Specific {@link ChangeCommand} that imports libraries from repository
- */
- public class ImportFromFileCommand extends AbstractImportCommand {
-
- /**
- * Creates a new ImportLibraryFromRepositoryCommand
- *
- * @param editingDomain
- * editing domain that manages the changed objects
- * @param runnable
- * process that executes the modifications
- * @param label
- * the label of the command
- * @param description
- * description of the command
- */
- public ImportFromFileCommand() {
- super(new Runnable() {
-
- public void run() {
-
- // Retrieve shell instance
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-
- // Start selection dialog
- ReferenceSelector selector = new ReferenceSelector();
- ILabelProvider labelProvider = WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider();
- selector.setLabelProvider(labelProvider);
- selector.setContentProvider(new WorkspaceContentProvider());
-
- MultipleValueSelectorDialog chooseLib = new MultipleValueSelectorDialog(shell, selector);
-
- chooseLib.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
- chooseLib.setUnique(true);
- chooseLib.setTitle("Select the models to import");
-
- //ResourceSelectionDialog chooseLib = new ResourceSelectionDialog(shell, ResourcesPlugin.getWorkspace().getRoot(), Messages.ImportPackageFromFileHandler_SelectRegisteredModelLibrary);
-
- chooseLib.open();
-
- // User selection
- Object[] selection = chooseLib.getResult();
-
- if(selection == null) { // Cancel was selected
- return;
- }
-
- ResourceSet resourceSet = Util.getResourceSet(getSelectedElement());
- // Parse selection and add ModelLibrary files
- for(Object selectedElement : selection) {
-
- //Handle errors:
- //- The selected is not an IFile
- //- The selected file is not a valid EMF Model (Error occurs during the resource loading)
- //- The selected model is empty
- //- The selected model is not a Package
-
- if(!(selectedElement instanceof IFile)) {
- MessageDialog.openWarning(shell, "Selection is not a File", "The selected element is not a File: " + labelProvider.getText(selectedElement));
- continue;
- }
-
- IFile currentFile = (IFile)selectedElement;
-
- URI modelUri = URI.createURI("platform:/resource" + currentFile.getFullPath()); //$NON-NLS-1$
-
-
- Resource modelResource;
- try {
- modelResource = resourceSet.getResource(modelUri, true);
- } catch (Exception ex) {
- MessageDialog.openWarning(shell, "Invalid model", "The selected file is not a valid model: " + labelProvider.getText(selectedElement));
- //At this point, an empty resource may have been loaded in the resource set. We should clean it.
- //Remove the resource from the resource set
- modelResource = resourceSet.getResource(modelUri, false);
- if(modelResource != null) {
- resourceSet.getResources().remove(modelResource);
- }
- continue;
- }
- if(modelResource.getContents().isEmpty()) {
- MessageDialog.openWarning(shell, "Model is empty", "The selected model is empty: " + labelProvider.getText(selectedElement));
- continue;
- }
- if(!(modelResource.getContents().get(0) instanceof Package)) {
- MessageDialog.openWarning(shell, "Model is not a Package", "The selected model is not a valid UML Package: " + labelProvider.getText(selectedElement));
- continue;
- }
-
- PackageImportDialog dialog = new PackageImportDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), ((Package)modelResource.getContents().get(0)));
-
- if(dialog.open() == Window.OK) {
- List<?> result = dialog.getResult();
-
- for(Object resultElement : result) {
- Package selectedPackage = (Package)resultElement;
- if(dialog.isCopy()) {
- handleCopyPackage(selectedPackage);
- } else {
- handleImportPackage(selectedPackage);
- }
- }
- }
-
- /*
- * Element root = (Element) modelResource.getContents().get(0);
- *
- * // Import model library Package libToImport = (Package) root; // create import package PackageImport pi =
- * UMLFactory.eINSTANCE.createPackageImport();
- * pi.setImportedPackage(libToImport); ((Package) selectedElement).getPackageImports().add(pi);
- */
-
- }
- }
-
- }, "Import Libraries", "Import Libraries from Workspace"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
index ec3b6cdc1bb..82684194e42 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
+ * Copyright (c) 2011, 2013 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - Refactoring package/profile import/apply UI for CDO
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.importt.handlers;
@@ -26,6 +28,7 @@ import org.eclipse.papyrus.uml.extensionpoints.library.FilteredRegisteredLibrari
import org.eclipse.papyrus.uml.extensionpoints.library.RegisteredLibrary;
import org.eclipse.papyrus.uml.extensionpoints.utils.Util;
import org.eclipse.papyrus.uml.importt.ui.PackageImportDialog;
+import org.eclipse.papyrus.uml.profile.ui.dialogs.ElementImportTreeSelectionDialog.ImportSpec;
import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -61,14 +64,18 @@ public class ImportRegisteredPackageHandler extends AbstractImportHandler {
PackageImportDialog dialog = new PackageImportDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), ((Package)modelResource.getContents().get(0)));
if(dialog.open() == Window.OK) {
- List<?> result = dialog.getResult();
-
- for(Object resultElement : result) {
- Package selectedPackage = (Package)resultElement;
- if(dialog.isCopy()) {
- handleCopyPackage(selectedPackage);
- } else {
- handleImportPackage(selectedPackage);
+ Collection<ImportSpec<Package>> result = dialog.getResult();
+
+ for (ImportSpec<Package> resultElement : result) {
+ Package selectedPackage = resultElement
+ .getElement();
+ switch (resultElement.getAction()) {
+ case COPY :
+ handleCopyPackage(selectedPackage);
+ break;
+ default :
+ handleImportPackage(selectedPackage);
+ break;
}
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
index 38ad9a6fd7c..22de25f417f 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
+ * Copyright (c) 2011, 2013 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - Refactoring package/profile import/apply UI for CDO
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.importt.handlers;
@@ -27,12 +29,14 @@ import org.eclipse.papyrus.uml.extensionpoints.profile.FilteredRegisteredProfile
import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
import org.eclipse.papyrus.uml.extensionpoints.utils.Util;
import org.eclipse.papyrus.uml.profile.ui.dialogs.ProfileTreeSelectionDialog;
+import org.eclipse.papyrus.uml.profile.ui.dialogs.ElementImportTreeSelectionDialog.ImportSpec;
import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageImport;
+import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.UMLFactory;
@@ -107,10 +111,10 @@ public class ImportRegisteredProfileHandler extends AbstractImportHandler {
int ret = dialog.open();
if(ret == Window.OK) {
- ArrayList<?> result = dialog.getResult();
- Iterator<?> resultIter = result.iterator();
+ Collection<ImportSpec<Profile>> result = dialog.getResult();
+ Iterator<ImportSpec<Profile>> resultIter = result.iterator();
while(resultIter.hasNext()) {
- Element element = (Element)resultIter.next();
+ Package element = resultIter.next().getElement();
PackageImport ei = UMLFactory.eINSTANCE.createPackageImport();
ei.setImportedPackage((Package)element);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/ui/PackageImportDialog.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/ui/PackageImportDialog.java
index 3a6b578270c..5fce773acff 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/ui/PackageImportDialog.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/ui/PackageImportDialog.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2013 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,77 +8,81 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - Refactoring package/profile import/apply UI for CDO
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.importt.ui;
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.util.Collection;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.papyrus.infra.widgets.editors.EnumRadio;
import org.eclipse.papyrus.uml.profile.ui.dialogs.PackageImportTreeSelectionDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Package;
/**
- * An import package dialog, with the option to import a copy of the selected package
+ * An import package dialog, with the option to import a copy of the selected
+ * package
*
* @author Camille Letavernier
*/
-public class PackageImportDialog extends PackageImportTreeSelectionDialog {
-
- protected boolean copy = false;
+public class PackageImportDialog
+ extends PackageImportTreeSelectionDialog {
public PackageImportDialog(Shell parent, Package model) {
super(parent, model);
}
+ public PackageImportDialog(Shell parent,
+ Collection<? extends Package> models) {
+ super(parent, models);
+ }
+
@Override
public Composite createDialogArea(Composite parent) {
- Composite result = (Composite)super.createDialogArea(parent);
+ Composite result = (Composite) super.createDialogArea(parent);
- EnumRadio radio = new EnumRadio(result, SWT.NONE);
+ Composite buttons = new Composite(result, SWT.NONE);
+ buttons.setLayout(new RowLayout());
- Map<Object, String> objectsToLabelsMap = new LinkedHashMap<Object, String>();
- objectsToLabelsMap.put(Boolean.FALSE, "Import package");
- objectsToLabelsMap.put(Boolean.TRUE, "Copy package");
- radio.setEnumValues(objectsToLabelsMap);
+ Button importAll = new Button(buttons, SWT.PUSH);
+ importAll.setText("Import All");
+ importAll.addSelectionListener(new SelectionAdapter() {
- radio.setModelObservable(new AbstractObservableValue() {
-
- public Object getValueType() {
- return Boolean.class;
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectAll(ImportAction.IMPORT);
}
+ });
+
+ Button copyAll = new Button(buttons, SWT.PUSH);
+ copyAll.setText("Copy All");
+ copyAll.addSelectionListener(new SelectionAdapter() {
@Override
- protected Boolean doGetValue() {
- return copy;
+ public void widgetSelected(SelectionEvent e) {
+ selectAll(ImportAction.COPY);
}
+ });
+
+ Button deselectAll = new Button(buttons, SWT.PUSH);
+ deselectAll.setText("Deselect All");
+ deselectAll.addSelectionListener(new SelectionAdapter() {
@Override
- protected void doSetValue(Object value) {
- if(value instanceof Boolean) {
- copy = (Boolean)value;
- }
+ public void widgetSelected(SelectionEvent e) {
+ selectAll(ImportAction.NONE);
}
-
});
return result;
}
- /**
- * Indicates whether we should make a copy of the selected package, or
- * import it
- *
- * @return true if the package should be copied
- */
- public boolean isCopy() {
- return copy;
- }
-
@Override
protected boolean isResizable() {
return true;

Back to the top