Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-03-14 22:36:55 -0400
committerslewis2008-03-14 22:36:55 -0400
commitf7ca8d78e6a51ec29a7577004d44a62136ed8be6 (patch)
tree2823f96ea5e11a2a73427265c17a29ba9caec226
parent28e2d530c9f0cde71c9328deb049f3df8591cffa (diff)
downloadorg.eclipse.ecf-f7ca8d78e6a51ec29a7577004d44a62136ed8be6.tar.gz
org.eclipse.ecf-f7ca8d78e6a51ec29a7577004d44a62136ed8be6.tar.xz
org.eclipse.ecf-f7ca8d78e6a51ec29a7577004d44a62136ed8be6.zip
Remote services examples fixes
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/AbstractRemoteServiceAccessHandler.java36
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/messages.properties2
2 files changed, 6 insertions, 32 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/AbstractRemoteServiceAccessHandler.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/AbstractRemoteServiceAccessHandler.java
index b1cac3d89..e16333fed 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/AbstractRemoteServiceAccessHandler.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/AbstractRemoteServiceAccessHandler.java
@@ -113,28 +113,7 @@ public abstract class AbstractRemoteServiceAccessHandler implements IServiceAcce
return createID(getConnectNamespace(), getConnectID());
}
- protected IContributionItem[] getContributionsForMatchingService() {
- return getPrimaryContributionsForMatchingService();
- }
-
- private IContributionItem[] getPrimaryContributionsForMatchingService() {
- // First get container manager...if we don't have one, then we're outta here
- final List remoteServicesContainerAdapters = getRemoteServiceContainerAdapters();
- // If we've got none, then we return
- if (remoteServicesContainerAdapters.size() == 0)
- return NOT_AVAILABLE_CONTRIBUTION;
- // If we've got one, then we do our thing
- final List contributions = new ArrayList();
- for (final Iterator i = remoteServicesContainerAdapters.iterator(); i.hasNext();) {
- IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) i.next();
- IContributionItem[] menuContributions = getContributionItemsForService(adapter);
- if (menuContributions == null)
- continue;
- for (int j = 0; j < menuContributions.length; j++)
- contributions.add(menuContributions[j]);
- }
- return (IContributionItem[]) contributions.toArray(new IContributionItem[] {});
- }
+ protected abstract IContributionItem[] getContributionsForMatchingService();
/* (non-Javadoc)
* @see org.eclipse.ecf.discovery.ui.views.IServiceAccessHandler#getContributionsForService(org.eclipse.ecf.discovery.IServiceInfo)
@@ -148,7 +127,7 @@ public abstract class AbstractRemoteServiceAccessHandler implements IServiceAcce
return EMPTY_CONTRIBUTION;
}
- protected IRemoteServiceReference[] getRemoteServiceReferences(IRemoteServiceContainerAdapter adapter) throws InvalidSyntaxException, IDCreateException {
+ protected IRemoteServiceReference[] getRemoteServiceReferencesForRemoteServiceAdapter(IRemoteServiceContainerAdapter adapter) throws InvalidSyntaxException, IDCreateException {
ID serviceID = null;
String serviceNamespace = getServiceNamespace();
String serviceid = getServiceID();
@@ -168,17 +147,12 @@ public abstract class AbstractRemoteServiceAccessHandler implements IServiceAcce
container.connect(connectTargetID, connectContext);
}
- /**
- * @param adapter the IRemoteServiceContainerAdapter to use to lookup the {@link IRemoteServiceReference}. Will not be <code>null</code>.
- * @return IContributionItem the menu contribution items to be added to the menu. May be <code>null</code>. If <code>null</code> then no item is added to the
- * menu.
- */
- protected abstract IContributionItem[] getContributionItemsForService(final IRemoteServiceContainerAdapter adapter);
+ protected abstract IContributionItem[] getContributionItemsForRemoteServiceAdapter(final IRemoteServiceContainerAdapter adapter);
- protected IContributionItem[] getConnectedContributions(final IContainer container) {
+ protected IContributionItem[] getContributionItemsForConnectedContainer(final IContainer container, final IRemoteServiceContainerAdapter adapter) {
// Add disconnect and separator
final List results = new ArrayList();
- final IContributionItem[] serviceItem = getPrimaryContributionsForMatchingService();
+ final IContributionItem[] serviceItem = getContributionItemsForRemoteServiceAdapter(adapter);
if (serviceItem != null) {
for (int i = 0; i < serviceItem.length; i++)
results.add(serviceItem[i]);
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 edd26c89d..3e152202a 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,7 +12,7 @@
AbstractRemoteServiceAccessHandler_DISCONNECT_MENU_TEXT=Disconnect
AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_EXCEPTION_TEXT=Exception: {0}
AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_EXCEPTION_TITLE=Received Exception
-AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_RESP_TEXT=Service: {0}\n\nMethod: {1}\nParameters: {2}\n\nResult: {3}
+AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_RESP_TEXT=Service Interface:\n{0}\n\nMethod: {1}\nParameters: {2}\n\nResult: {3}
AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_RESP_TITLE=Received Response
AbstractRemoteServiceAccessHandler_NOT_AVAILABLE_MENU_TEXT=No connected container of correct type
DiscoveryView_Services = Services

Back to the top