Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-10-11 09:34:20 +0000
committerTobias Schwarz2012-10-12 04:15:18 +0000
commit450556a99cccb5834c1525b31c713cbee0cd0df2 (patch)
tree8a73b8fed5342ffeeb3da12ed251a90310818cc3 /target_explorer
parentc0caf5d23bb66c5dc0920ea81a6617bc1763ca79 (diff)
downloadorg.eclipse.tcf-450556a99cccb5834c1525b31c713cbee0cd0df2.tar.gz
org.eclipse.tcf-450556a99cccb5834c1525b31c713cbee0cd0df2.tar.xz
org.eclipse.tcf-450556a99cccb5834c1525b31c713cbee0cd0df2.zip
[Target Explorer] add import/export for static peer configurations
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/PeerExportWizard.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java19
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.xml6
4 files changed, 31 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
index d67a08caf..1f83aa32f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
@@ -23,11 +23,11 @@ PeersByCurrentUserFilter.name=Only show targets started by ME
# ***** Import/Export Wizards *****
-ImportWizards.Category.TCF=TCF
+ImportWizards.Category.TCF=System Management
ImportWizards.Peer=Configurations
ImportWizards.PeerDescription=
-ExportWizards.Category.TCF=TCF
+ExportWizards.Category.TCF=System Management
ExportWizards.Peer=Configurations
ExportWizards.PeerDescription=
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/PeerExportWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/PeerExportWizard.java
index 21a27b243..5fa0d0f01 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/PeerExportWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/PeerExportWizard.java
@@ -26,6 +26,9 @@ import org.eclipse.ui.IWorkbench;
public class PeerExportWizard extends Wizard implements IExportWizard {
private String EXPORT_DIALOG_SETTINGS = "PeerExport"; //$NON-NLS-1$
+
+ private IStructuredSelection fSelection = null;
+
/**
* Constructor.
*/
@@ -45,7 +48,7 @@ public class PeerExportWizard extends Wizard implements IExportWizard {
*/
@Override
public void addPages() {
- IWizardPage page = new PeerExportWizardPage();
+ IWizardPage page = new PeerExportWizardPage(fSelection);
addPage(page);
}
@@ -62,6 +65,7 @@ public class PeerExportWizard extends Wizard implements IExportWizard {
*/
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.fSelection = selection;
setWindowTitle(Messages.PeerExportWizard_title);
setNeedsProgressMonitor(true);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
index aea4fba1c..42e0b110d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
@@ -13,6 +13,7 @@ package org.eclipse.tcf.te.tcf.ui.wizards.pages;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IPath;
@@ -20,6 +21,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -27,6 +29,7 @@ import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreePathContentProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
@@ -68,13 +71,16 @@ public class PeerExportWizardPage extends WizardPage {
private Button fDestinationButton;
private Button fOverwrite;
+ private IStructuredSelection fSelection;
+
/**
* Constructor
*/
- public PeerExportWizardPage() {
+ public PeerExportWizardPage(IStructuredSelection selection) {
super(Messages.PeerExportWizard_title);
setTitle(Messages.PeerExportWizard_title);
setMessage(Messages.PeerExportWizard_message);
+ fSelection = selection;
}
@Override
@@ -90,6 +96,17 @@ public class PeerExportWizardPage extends WizardPage {
createPeersGroup(composite);
createDestinationGroup(composite);
+ List<IPeerModel> elements = new ArrayList<IPeerModel>();
+ Iterator<Object> it = fSelection.iterator();
+ while (it.hasNext()) {
+ Object element = it.next();
+ IPeerModel peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(element, IPeerModel.class);
+ if (peerModel != null) {
+ elements.add((IPeerModel)element);
+ }
+ }
+ fViewer.setCheckedElements(elements.toArray());
+
setPageComplete(isComplete());
setErrorMessage(null);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.xml
index c7cfd4113..586d831ab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.xml
@@ -37,6 +37,7 @@
<insertionPoint name="group.edit" separator="true"/>
<insertionPoint name="group.delete"/>
<insertionPoint name="group.build" separator="true"/>
+ <insertionPoint name="group.importexport" separator="true"/>
<insertionPoint name="group.refresh" separator="true"/>
<insertionPoint name="group.syncop"/>
<insertionPoint name="group.categories" separator="true"/>
@@ -314,6 +315,11 @@
</command>
</menuContribution>
+ <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.importexport">
+ <command commandId="org.eclipse.ui.file.import"/>
+ <command commandId="org.eclipse.ui.file.export"/>
+ </menuContribution>
+
<menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.showIn">
<menu
commandId="org.eclipse.tcf.te.ui.views.command.ShowInGroup"

Back to the top