Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-01-29 06:51:02 +0000
committerslewis2008-01-29 06:51:02 +0000
commit14357a79f7b518738518952f1f1a66d3131f6ab0 (patch)
tree688a4f8e426f81d55c36867dcfb7e518364849d3 /framework/bundles/org.eclipse.ecf.discovery.ui
parent717caab02c3312b00da356c78e7813b77deef636 (diff)
downloadorg.eclipse.ecf-14357a79f7b518738518952f1f1a66d3131f6ab0.tar.gz
org.eclipse.ecf-14357a79f7b518738518952f1f1a66d3131f6ab0.tar.xz
org.eclipse.ecf-14357a79f7b518738518952f1f1a66d3131f6ab0.zip
Fixes for labels and httpserviceaccesshandler
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery.ui')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/HttpServiceAccessHandler.java11
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryViewContentProvider.java10
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Messages.java17
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties17
4 files changed, 9 insertions, 46 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/HttpServiceAccessHandler.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/HttpServiceAccessHandler.java
index b66593d8f..b685683bb 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/HttpServiceAccessHandler.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/HttpServiceAccessHandler.java
@@ -23,6 +23,7 @@ import org.eclipse.ecf.discovery.ui.views.IServiceAccessHandler;
import org.eclipse.ecf.internal.discovery.ui.Activator;
import org.eclipse.ecf.internal.discovery.ui.Messages;
import org.eclipse.jface.action.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
@@ -43,11 +44,11 @@ public class HttpServiceAccessHandler implements IServiceAccessHandler {
public IContributionItem[] getContributionsForService(IServiceInfo serviceInfo) {
IServiceID serviceID = serviceInfo.getServiceID();
- List serviceTypes = Arrays.asList(serviceID.getServiceTypeID().getProtocols());
+ List serviceTypes = Arrays.asList(serviceID.getServiceTypeID().getServices());
String protocol = null;
- if (serviceTypes.contains("http")) //$NON-NLS-1$
+ if (serviceTypes.size() == 1 && serviceTypes.contains("http")) //$NON-NLS-1$
protocol = "http"; //$NON-NLS-1$
- else if (serviceTypes.contains("https")) //$NON-NLS-1$
+ else if (serviceTypes.size() == 1 && serviceTypes.contains("https")) //$NON-NLS-1$
protocol = "https"; //$NON-NLS-1$
if (protocol == null)
return EMPTY_CONTRIBUTION;
@@ -55,7 +56,7 @@ public class HttpServiceAccessHandler implements IServiceAccessHandler {
StringBuffer buf = new StringBuffer(protocol);
buf.append("://").append(location.getHost()); //$NON-NLS-1$
if (location.getPort() != -1)
- buf.append(":").append(location.getPort()).append("/"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(":").append(location.getPort()); //$NON-NLS-1$
IServiceProperties svcProps = serviceInfo.getServiceProperties();
final String path = svcProps.getPropertyString(RFC2782_PATH);
if (path != null)
@@ -68,7 +69,7 @@ public class HttpServiceAccessHandler implements IServiceAccessHandler {
openBrowser(urlString);
}
};
- action.setText(Messages.HttpServiceAccessHandler_MENU_TEXT + urlString);
+ action.setText(NLS.bind(Messages.HttpServiceAccessHandler_MENU_TEXT, urlString));
return new IContributionItem[] {new ActionContributionItem(action)};
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryViewContentProvider.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryViewContentProvider.java
index 718829e5e..64cebf2d2 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryViewContentProvider.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryViewContentProvider.java
@@ -12,15 +12,10 @@
package org.eclipse.ecf.discovery.ui.views;
import java.util.Enumeration;
-
-import org.eclipse.ecf.discovery.IContainerServiceInfoAdapter;
-import org.eclipse.ecf.discovery.IServiceInfo;
-import org.eclipse.ecf.discovery.IServiceProperties;
+import org.eclipse.ecf.discovery.*;
import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.internal.discovery.ui.Messages;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.osgi.util.NLS;
class DiscoveryViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
@@ -152,7 +147,6 @@ class DiscoveryViewContentProvider implements IStructuredContentProvider, ITreeC
newEntry.addChild(new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryViewContentProvider_TYPE_INTERNAL_LABEL, svcID.getServiceTypeID().getInternal())));
newEntry.addChild(new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryViewContentProvider_TYPE_NAMESPACE_LABEL, svcID.getServiceTypeID().getNamespace().getName())));
newEntry.addChild(new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryViewContentProvider_SERVICE_NAME_LABEL, svcID.getServiceName())));
- newEntry.addChild(new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryViewContentProvider_NAME_LABEL, svcID.getServiceTypeID().getNamespace().getName())));
newEntry.addChild(new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryViewContentProvider_SERVICE_NAMESPACE_LABEL, svcID.getNamespace().getName())));
final DiscoveryViewTreeObject prioo = new DiscoveryViewTreeObject(NLS.bind(Messages.DiscoveryView_PriorityLabel, Integer.toString(serviceInfo.getPriority())));
newEntry.addChild(prioo);
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Messages.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Messages.java
index 4eb5e1f01..3cf3bc154 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Messages.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Messages.java
@@ -19,27 +19,12 @@ public class Messages extends NLS {
public static String DiscoveryView_Services;
public static String DiscoveryView_AddressLabel;
public static String DiscoveryView_TypeLabel;
- public static String DiscoveryView_PortLabel;
public static String DiscoveryView_PriorityLabel;
public static String DiscoveryView_WeightLabel;
public static String DiscoveryView_REFRESH_ACTION_LABEL;
public static String DiscoveryView_REFRESH_SERVICES_TOOLTIPTEXT;
- public static String DiscoveryView_RequestInfo;
- public static String DiscoveryView_RequestInfoTooltip;
- public static String DiscoveryView_RegisterType;
- public static String DiscoveryView_RegisterTypeTooltip;
- public static String DiscoveryView_ConnectTo;
- public static String DiscoveryView_ConnectToTooltip;
- public static String DiscoveryView_StopDiscoveryTitle;
- public static String DiscoveryView_StopDiscoveryDescription;
- public static String DiscoveryView_StopDiscovery;
- public static String DiscoveryView_StopDiscoveryTooltip;
- public static String DiscoveryView_StartDiscovery;
- public static String DiscoveryView_StartDiscoveryTooltip;
- public static String DiscoveryView_ConnectToService;
-
public static String DiscoveryView_EXCEPTION_CREATING_SERVICEACCESSHANDLER;
public static String DiscoveryView_NO_SERVICE_HANDLER_LABEL;
@@ -52,8 +37,6 @@ public class Messages extends NLS {
public static String DiscoveryViewContentProvider_CONTAINER_SERVICE_INFO_LABEL;
- public static String DiscoveryViewContentProvider_NAME_LABEL;
-
public static String DiscoveryViewContentProvider_SERVICE_NAME_LABEL;
public static String DiscoveryViewContentProvider_SERVICE_NAMESPACE_LABEL;
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties
index fe308ef6d..73d7ffedd 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties
@@ -12,35 +12,20 @@
DiscoveryView_Services = Services
DiscoveryView_AddressLabel = Location: {0}
DiscoveryView_TypeLabel = Type: {0}
-DiscoveryView_PortLabel = Port: {0}
DiscoveryView_PriorityLabel = Priority: {0}
DiscoveryView_WeightLabel = Weight: {0}
DiscoveryView_REFRESH_ACTION_LABEL=Refresh
DiscoveryView_REFRESH_SERVICES_TOOLTIPTEXT=Refresh services
-DiscoveryView_RequestInfo = Request info...
-DiscoveryView_RequestInfoTooltip = Request info for selected service
-DiscoveryView_RegisterType = Register type...
-DiscoveryView_RegisterTypeTooltip = Register for selected service type...
-DiscoveryView_ConnectTo = Connect to...
-DiscoveryView_ConnectToTooltip = Connect to this service...
-DiscoveryView_StopDiscoveryTitle = Stop Discovery
-DiscoveryView_StopDiscoveryDescription = Would you like to stop discovering network services?
-DiscoveryView_StopDiscovery = Stop Discovery
-DiscoveryView_StopDiscoveryTooltip = Stop network service discovery
-DiscoveryView_StartDiscovery = Start Discovery
-DiscoveryView_StartDiscoveryTooltip = Start network service discovery
-DiscoveryView_ConnectToService = Connect to {0}
DiscoveryView_EXCEPTION_CREATING_SERVICEACCESSHANDLER=Exception creating serviceAccessHandler
DiscoveryView_NO_SERVICE_HANDLER_LABEL=No service handler
DiscoveryViewContentProvider_CONNECT_REQUIRES_PASSWORD_LABEL=Connect Requires Password: {0}
DiscoveryViewContentProvider_CONNECT_TARGET_LABEL=Connect Target: {0}
DiscoveryViewContentProvider_CONTAINER_FACTORY_LABEL=Container Factory: {0}
DiscoveryViewContentProvider_CONTAINER_SERVICE_INFO_LABEL=Container Service Info
-DiscoveryViewContentProvider_NAME_LABEL=Name: {0}
-DiscoveryViewContentProvider_SERVICE_NAME_LABEL=Service Name: {0}
DiscoveryViewContentProvider_SERVICE_NAMESPACE_LABEL=Service Namespace: {0}
DiscoveryViewContentProvider_SERVICE_PROPERTIES_LABEL=Service Properties
DiscoveryViewContentProvider_TYPE_INTERNAL_LABEL=Type (internal): {0}
DiscoveryViewContentProvider_TYPE_NAMESPACE_LABEL=Type Namespace: {0}
+DiscoveryViewContentProvider_SERVICE_NAME_LABEL=Service Name: {0}
HttpServiceAccessHandler_EXCEPTION_CREATEBROWSER=Exception in createBrowser
HttpServiceAccessHandler_MENU_TEXT=Open browser on {0}

Back to the top