Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-09-03 04:25:52 -0400
committerTobias Schwarz2014-09-03 04:27:28 -0400
commitc2522746f6c53c8ce9c80d66390828a7b067655a (patch)
tree1e252ad15774d5bea4a85a0450b46864e8625961
parente7cfd38e72d16936ae9b2c00083131fb34f857f0 (diff)
downloadorg.eclipse.tcf-c2522746f6c53c8ce9c80d66390828a7b067655a.tar.gz
org.eclipse.tcf-c2522746f6c53c8ce9c80d66390828a7b067655a.tar.xz
org.eclipse.tcf-c2522746f6c53c8ce9c80d66390828a7b067655a.zip
Target Explorer: fix import issues
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java8
3 files changed, 5 insertions, 10 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
index 77f913217..2a5d88731 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
@@ -235,6 +235,7 @@
id="org.eclipse.tcf.te.tcf.ui.peerLabelProviderDelegate">
<enablement>
<or>
+ <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
<instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorNode"/>
<instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
<instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPendingOperationNode"/>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
index 4963cb926..0471f0092 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java
@@ -41,7 +41,7 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe
*/
@Override
public String getText(final Object element) {
- if (element instanceof IPeerNode) {
+ if (element instanceof IPeerNode || element instanceof IPeer) {
StringBuilder builder = new StringBuilder();
// Copy the peer node and peer attributes
@@ -54,8 +54,8 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe
attrs.putAll(((IPeerNode)element).getProperties());
attrs.putAll(((IPeerNode)element).getPeer().getAttributes());
}
- else if (element instanceof ILocatorNode) {
- attrs.putAll((((ILocatorNode)element).getPeer()).getAttributes());
+ else if (element instanceof IPeer) {
+ attrs.putAll(((IPeer)element).getAttributes());
}
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
index 7db24cd0f..5d866c7f0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
@@ -390,13 +390,7 @@ public class PeerImportWizardPage extends WizardPage {
}
try {
URI uri = service.getURI(config);
- File defaultFile = new File(uri.normalize());
- File file = new Path(new File(uri.normalize()).toString()).addFileExtension("peer").toFile(); //$NON-NLS-1$
- int i = 1;
- while (file.exists()) {
- file = new Path(defaultFile.toString() + "_" + i).addFileExtension("peer").toFile(); //$NON-NLS-1$ //$NON-NLS-2$
- i++;
- }
+ File file = new File(uri.normalize());
service.write(config, file.toURI());
}
catch (IOException e) {

Back to the top