Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2015-11-26 20:06:12 +0000
committerslewis2015-11-26 20:06:12 +0000
commit544e6bb1a413175687e539b821b549332d5c3b0b (patch)
tree05465f905d362adb690bad126f6b636a7f1038f9 /framework
parent0eabec6747f475988f56784aadd7b957ab68cffd (diff)
downloadorg.eclipse.ecf-544e6bb1a413175687e539b821b549332d5c3b0b.tar.gz
org.eclipse.ecf-544e6bb1a413175687e539b821b549332d5c3b0b.tar.xz
org.eclipse.ecf-544e6bb1a413175687e539b821b549332d5c3b0b.zip
Added documentation for new services view extension point. Also
externalized remaining strings, and made PDE runtime dependency optional. Change-Id: If1e681afdb9f774eaea03f507b7a89aa2a02ae58
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF4
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/schema/org.eclipse.ecf.remoteservice.ui.servicesview.exsd47
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java12
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/DiscoveryComponent.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServicePerspective.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/ServicesViewExtension.java19
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteservice/ui/services/IServicesView.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/endpoint/EndpointDiscoveryView.java9
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/rsa/AbstractRemoteServiceAdminView.java13
9 files changed, 73 insertions, 39 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF
index 13994acd8..9fbb30e75 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF
@@ -11,8 +11,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ecf.remoteservice;bundle-version="2.0.0",
org.eclipse.ecf.discovery;bundle-version="2.1.0",
org.eclipse.ecf.discovery.ui;bundle-version="3.0.0",
- org.eclipse.ecf.discovery.ui.model;bundle-version="3.0.0",
- org.eclipse.pde.runtime
+ org.eclipse.ecf.discovery.ui.model;bundle-version="3.0.0"
Export-Package: org.eclipse.ecf.remoteservice.ui.services,
org.eclipse.ecf.remoteserviceadmin.ui.endpoint,
org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model;version="1.0.0",
@@ -27,6 +26,7 @@ Bundle-Activator: org.eclipse.ecf.internal.remoteservices.ui.Activator
Import-Package: org.eclipse.ecf.osgi.services.remoteserviceadmin;version="1.2.0",
org.eclipse.ecf.remoteservice.asyncproxy;version="1.0.0",
org.eclipse.equinox.concurrent.future;version="1.0.0",
+ org.eclipse.pde.internal.runtime.registry;resolution:=optional,
org.eclipse.ui.views.properties,
org.osgi.framework,
org.osgi.service.remoteserviceadmin;version="1.1.0"
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/schema/org.eclipse.ecf.remoteservice.ui.servicesview.exsd b/framework/bundles/org.eclipse.ecf.remoteservice.ui/schema/org.eclipse.ecf.remoteservice.ui.servicesview.exsd
index db258501a..fc3c9c06f 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/schema/org.eclipse.ecf.remoteservice.ui.servicesview.exsd
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/schema/org.eclipse.ecf.remoteservice.ui.servicesview.exsd
@@ -6,7 +6,7 @@
<meta.schema plugin="org.eclipse.ecf.remoteservice.ui" id="org.eclipse.ecf.remoteservice.ui.servicesview" name="Services View Extension Point"/>
</appInfo>
<documentation>
- [Enter description of this extension point.]
+ This extension point allows new Services views to be created by other plugins and then used by the Remote Services Perspective to display the OSGi services on the local OSGi service registry.
</documentation>
</annotation>
@@ -48,25 +48,30 @@
</element>
<element name="servicesview">
+ <annotation>
+ <documentation>
+ Defines a services view.
+ </documentation>
+ </annotation>
<complexType>
<attribute name="viewid" type="string" use="required">
<annotation>
<documentation>
-
+ A required viewid for the extension services view. The given viewid must correspond to a view that implements IViewPart, and should also implement IServicesView. This viewid must also have been registered as an Eclipse view extension.
</documentation>
</annotation>
</attribute>
<attribute name="local" type="boolean">
<annotation>
<documentation>
-
+ Boolean indication of whether the given view is for displaying the services from the local OSGi services registry (true) or not (false).
</documentation>
</annotation>
</attribute>
<attribute name="priority" type="string">
<annotation>
<documentation>
-
+ Priority (positive integer) of this services view. This allows multiple services views to determine their relative priority to each other. The Remote Services perspective picks the services view with the highest priority value to display the contents of the local OSGi services registry. Only service views with local=&quot;true&quot; will be considered.
</documentation>
</annotation>
</attribute>
@@ -78,7 +83,7 @@
<meta.section type="since"/>
</appInfo>
<documentation>
- [Enter the first release in which this extension point appears.]
+ 3.3.0 of this plugin.
</documentation>
</annotation>
@@ -87,7 +92,19 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- [Enter extension point usage example here.]
+ The following example shows the use of the extension point to make a ServicesView (assumed to implement IServicesView interface with viewid=org.eclipse.ecf.remoteservice.ui.serviceview.ServiceView, local=true (for local OSGi service registry), and priority=1000. The priority=1000 means that any local services view with a priority &gt; 1000 will be used rather than this one as the local OSGi services view in the Remote Service perspective.
+
+&lt;pre&gt;
+ &lt;extension
+ point=&quot;org.eclipse.ecf.remoteservice.ui.servicesview&quot;&gt;
+ &lt;servicesview
+ local=&quot;true&quot;
+ priority=&quot;1000&quot;
+ viewid=&quot;org.eclipse.ecf.remoteservice.ui.serviceview.ServiceView&quot;&gt;
+ &lt;/servicesview&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+
</documentation>
</annotation>
@@ -96,18 +113,28 @@
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
- [Enter API information here.]
+ See the IServicesView interface. This interface allows other views to set the selected service in the associated view. If the view given does not implement IServicesView then it will not be used in this manner, but this interface should be implemented by Service View extensions.
+
</documentation>
</annotation>
+
<annotation>
<appInfo>
- <meta.section type="implementation"/>
+ <meta.section type="copyright"/>
</appInfo>
<documentation>
- [Enter information about supplied implementation of this extension point.]
+ /*******************************************************************************
+ * Copyright (c) 2015 Composent, Inc. 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: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+
+
</documentation>
</annotation>
-
</schema>
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java
index c212eaf87..84bb60611 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java
@@ -37,7 +37,7 @@ public class Activator extends AbstractUIPlugin {
private IExtensionRegistry extensionRegistry;
private String servicesViewId;
-
+
public String getLocalServicesViewId() {
return servicesViewId;
}
@@ -45,7 +45,7 @@ public class Activator extends AbstractUIPlugin {
public void setLocalServicesViewId(String viewId) {
this.servicesViewId = viewId;
}
-
+
/**
* The constructor
*/
@@ -67,20 +67,20 @@ public class Activator extends AbstractUIPlugin {
public List<ServicesViewExtension> getLocalServicesViewExtensions() {
return getServicesViewExtensions(Boolean.TRUE);
}
-
+
public List<ServicesViewExtension> getRemoteServicesViewExtensions() {
return getServicesViewExtensions(Boolean.FALSE);
}
-
+
public List<ServicesViewExtension> getServicesViewExtensions() {
return getServicesViewExtensions(null);
}
-
+
public List<ServicesViewExtension> getServicesViewExtensions(Boolean localOnly) {
List<ServicesViewExtension> results = new ArrayList<ServicesViewExtension>();
if (this.extensionRegistry != null) {
IExtensionPoint epoint = this.extensionRegistry
- .getExtensionPoint("org.eclipse.ecf.remoteservice.ui.servicesview");
+ .getExtensionPoint("org.eclipse.ecf.remoteservice.ui.servicesview"); //$NON-NLS-1$
if (epoint != null) {
IConfigurationElement[] elements = epoint.getConfigurationElements();
for (IConfigurationElement element : elements) {
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/DiscoveryComponent.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/DiscoveryComponent.java
index bc693393f..c62fc1cf8 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/DiscoveryComponent.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/DiscoveryComponent.java
@@ -37,7 +37,7 @@ public class DiscoveryComponent implements EndpointEventListener, RemoteServiceA
}
void unbindRemoteServiceAdmin(RemoteServiceAdmin rsa) {
- rsa = null;
+ this.rsa = null;
}
public BundleContext getContext() {
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServicePerspective.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServicePerspective.java
index e7735d479..0ab6eade7 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServicePerspective.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServicePerspective.java
@@ -57,9 +57,9 @@ public class RemoteServicePerspective implements IPerspectiveFactory {
// Create folder for right bottom
IFolderLayout rightBottom = layout.createFolder("rightBottom", //$NON-NLS-1$
IPageLayout.RIGHT, 0.5f, "bottom"); //$NON-NLS-1$
-
+
List<ServicesViewExtension> sves = Activator.getDefault().getLocalServicesViewExtensions();
-
+
String viewId = "org.eclipse.pde.runtime.RegistryBrowser"; //$NON-NLS-1$
if (sves.size() > 0) {
viewId = sves.get(0).getViewId();
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/ServicesViewExtension.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/ServicesViewExtension.java
index df876fa7c..82f50d021 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/ServicesViewExtension.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/ServicesViewExtension.java
@@ -9,33 +9,34 @@ public class ServicesViewExtension {
private final String viewId;
private final boolean local;
private int priority = 0;
-
+
public ServicesViewExtension(IConfigurationElement ce) throws InvalidObjectException {
- this.viewId = ce.getAttribute("viewid");
- if (this.viewId == null) throw new InvalidObjectException("viewId must be set for services view extension");
- this.local = Boolean.parseBoolean(ce.getAttribute("local"));
- String priorityStr = ce.getAttribute("priority");
+ this.viewId = ce.getAttribute("viewid"); //$NON-NLS-1$
+ if (this.viewId == null)
+ throw new InvalidObjectException("viewId must be set for services view extension"); //$NON-NLS-1$
+ this.local = Boolean.parseBoolean(ce.getAttribute("local")); //$NON-NLS-1$
+ String priorityStr = ce.getAttribute("priority"); //$NON-NLS-1$
try {
this.priority = Integer.parseInt(priorityStr);
} catch (NumberFormatException e) {
// ignore
}
}
-
+
public String getViewId() {
return this.viewId;
}
-
+
public boolean isLocal() {
return this.local;
}
-
+
public int getPriority() {
return this.priority;
}
@Override
public String toString() {
- return "ServicesViewExtension [viewId=" + viewId + ", local=" + local + ", priority=" + priority + "]";
+ return "ServicesViewExtension [viewId=" + viewId + ", local=" + local + ", priority=" + priority + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteservice/ui/services/IServicesView.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteservice/ui/services/IServicesView.java
index fc760e298..f196e4c02 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteservice/ui/services/IServicesView.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteservice/ui/services/IServicesView.java
@@ -14,6 +14,6 @@ package org.eclipse.ecf.remoteservice.ui.services;
public interface IServicesView {
public String getRemoteId();
-
+
public void selectService(String remoteId, long serviceId);
}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/endpoint/EndpointDiscoveryView.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/endpoint/EndpointDiscoveryView.java
index cc7e64dc9..79bb13eef 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/endpoint/EndpointDiscoveryView.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/endpoint/EndpointDiscoveryView.java
@@ -150,6 +150,7 @@ public class EndpointDiscoveryView extends ViewPart {
return null;
}
+ @Deprecated
protected int showInRegistryBrowser(int groupBy) {
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=270684#c33
try {
@@ -167,7 +168,13 @@ public class EndpointDiscoveryView extends ViewPart {
@Deprecated
protected void showServicesInRegistryBrowser() {
- this.previousRegistryBrowserGroupBy = showInRegistryBrowser(RegistryBrowser.SERVICES);
+ try {
+ this.previousRegistryBrowserGroupBy = showInRegistryBrowser(RegistryBrowser.SERVICES);
+ } catch (Exception e) {
+ logWarning("Could not find pde registry view", e); //$NON-NLS-1$
+ } catch (NoClassDefFoundError e) {
+ logWarning("Could not find pde registry view", e); //$NON-NLS-1$
+ }
}
@Override
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/rsa/AbstractRemoteServiceAdminView.java b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/rsa/AbstractRemoteServiceAdminView.java
index f3f0bc316..1da9b3e13 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/rsa/AbstractRemoteServiceAdminView.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/remoteserviceadmin/ui/rsa/AbstractRemoteServiceAdminView.java
@@ -95,7 +95,7 @@ public abstract class AbstractRemoteServiceAdminView extends ViewPart {
}
protected void setupListeners() {
-
+
}
protected void setupSelectionListeners() {
@@ -114,13 +114,13 @@ public abstract class AbstractRemoteServiceAdminView extends ViewPart {
} else if (selection instanceof ImportRegistrationNode) {
sr = ((ImportRegistrationNode) selection).getServiceReference();
}
- if (sr != null)
+ if (sr != null)
selectServiceInServicesView(servicesViewId, (Long) sr.getProperty(Constants.SERVICE_ID));
}
});
}
}
-
+
protected void selectServiceInServicesView(String servicesViewId, final long serviceId) {
try {
IViewPart view = findView(servicesViewId);
@@ -129,7 +129,7 @@ public abstract class AbstractRemoteServiceAdminView extends ViewPart {
IServicesView sv = (IServicesView) view;
sv.selectService(null, serviceId);
} else {
- logWarning("Could not select services on viewId="+servicesViewId, null);
+ logWarning("Could not select services on viewId=" + servicesViewId, null); //$NON-NLS-1$
}
}
} catch (Exception e) {
@@ -166,11 +166,11 @@ public abstract class AbstractRemoteServiceAdminView extends ViewPart {
hookContextMenu();
viewSite.setSelectionProvider(viewer);
-
+
setupListeners();
setupSelectionListeners();
-
+
RemoteServiceAdmin rsa = getLocalRSA();
if (rsa != null)
updateModel();
@@ -186,7 +186,6 @@ public abstract class AbstractRemoteServiceAdminView extends ViewPart {
return null;
}
-
@Override
public void setFocus() {
}

Back to the top