Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-09-06 00:42:01 -0400
committerslewis2007-09-06 00:42:01 -0400
commitd32a336196a6217b254e61dacbf1924d91999f18 (patch)
tree0b765a1b13288477a8f1b8b0eb4b7cd97144cb08 /examples
parent57026affdc2cee196eb2b2b5716fe343fba7a70c (diff)
downloadorg.eclipse.ecf-d32a336196a6217b254e61dacbf1924d91999f18.tar.gz
org.eclipse.ecf-d32a336196a6217b254e61dacbf1924d91999f18.tar.xz
org.eclipse.ecf-d32a336196a6217b254e61dacbf1924d91999f18.zip
Updated versions for ECF 1.1
Diffstat (limited to 'examples')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF2
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java19
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/CollabDiscoveryView.java46
3 files changed, 26 insertions, 41 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF b/examples/bundles/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF
index e80208704..61986b6b7 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF
+++ b/examples/bundles/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.example.collab;singleton:=true
-Bundle-Version: 1.0.200.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-Activator: org.eclipse.ecf.internal.example.collab.ClientPlugin
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
index 9f35a648b..5476837e5 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
@@ -28,28 +28,23 @@ public class Discovery {
}
private void startDiscovery() throws Exception {
- container = ContainerFactory.getDefault().createContainer(
- "ecf.discovery.jmdns");
+ container = ContainerFactory.getDefault().createContainer("ecf.discovery.jmdns");
container.connect(null, null);
- discoveryContainer = (IDiscoveryContainerAdapter) container
- .getAdapter(IDiscoveryContainerAdapter.class);
- discoveryContainer
- .addServiceTypeListener(new CollabServiceTypeListener());
+ discoveryContainer = (IDiscoveryContainerAdapter) container.getAdapter(IDiscoveryContainerAdapter.class);
+ discoveryContainer.addServiceTypeListener(new CollabServiceTypeListener());
}
class CollabServiceTypeListener implements IServiceTypeListener {
public void serviceTypeAdded(IServiceEvent event) {
- IServiceID svcID = event.getServiceInfo().getServiceID();
- discoveryContainer.addServiceListener(svcID.getServiceType(),
- new CollabServiceListener());
- discoveryContainer.registerServiceType(svcID.getServiceType());
+ final IServiceID svcID = event.getServiceInfo().getServiceID();
+ discoveryContainer.addServiceListener(svcID.getServiceTypeID(), new CollabServiceListener());
+ discoveryContainer.registerServiceType(svcID.getServiceTypeID());
}
}
class CollabServiceListener implements IServiceListener {
public void serviceAdded(IServiceEvent event) {
- discoveryContainer.requestServiceInfo(event.getServiceInfo()
- .getServiceID(), 3000);
+ discoveryContainer.requestServiceInfo(event.getServiceInfo().getServiceID(), 3000);
}
public void serviceRemoved(IServiceEvent event) {
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/CollabDiscoveryView.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/CollabDiscoveryView.java
index 6d761a473..bf7a34a24 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/CollabDiscoveryView.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/CollabDiscoveryView.java
@@ -28,44 +28,34 @@ public class CollabDiscoveryView extends DiscoveryView {
public CollabDiscoveryView() {
super();
setShowTypeDetails(false);
- this.setDiscoveryController(ClientPlugin.getDefault()
- .getDiscoveryController());
+ this.setDiscoveryController(ClientPlugin.getDefault().getDiscoveryController());
}
public void setDiscoveryController(final IDiscoveryController controller) {
super.setDiscoveryController(controller);
if (controller != null) {
- final IDiscoveryContainerAdapter dc = controller
- .getDiscoveryContainer();
+ final IDiscoveryContainerAdapter dc = controller.getDiscoveryContainer();
if (dc != null) {
// setup listeners
dc.addServiceTypeListener(new IServiceTypeListener() {
public void serviceTypeAdded(IServiceEvent event) {
- IServiceID svcID = event.getServiceInfo()
- .getServiceID();
- addServiceTypeInfo(svcID.getServiceType());
- dc.addServiceListener(event.getServiceInfo()
- .getServiceID().getServiceType(),
- new IServiceListener() {
- public void serviceAdded(IServiceEvent evt) {
- addServiceInfo(evt.getServiceInfo()
- .getServiceID());
- dc.requestServiceInfo(evt
- .getServiceInfo()
- .getServiceID(),
- SERVICE_REQUEST_TIMEOUT);
- }
+ final IServiceID svcID = event.getServiceInfo().getServiceID();
+ addServiceTypeInfo(svcID.getServiceTypeID().getName());
+ dc.addServiceListener(event.getServiceInfo().getServiceID().getServiceTypeID(), new IServiceListener() {
+ public void serviceAdded(IServiceEvent evt) {
+ addServiceInfo(evt.getServiceInfo().getServiceID());
+ dc.requestServiceInfo(evt.getServiceInfo().getServiceID(), SERVICE_REQUEST_TIMEOUT);
+ }
- public void serviceRemoved(IServiceEvent evt) {
- removeServiceInfo(evt.getServiceInfo());
- }
+ public void serviceRemoved(IServiceEvent evt) {
+ removeServiceInfo(evt.getServiceInfo());
+ }
- public void serviceResolved(
- IServiceEvent evt) {
- addServiceInfo(evt.getServiceInfo());
- }
- });
- dc.registerServiceType(svcID.getServiceType());
+ public void serviceResolved(IServiceEvent evt) {
+ addServiceInfo(evt.getServiceInfo());
+ }
+ });
+ dc.registerServiceType(svcID.getServiceTypeID());
}
});
}
@@ -73,7 +63,7 @@ public class CollabDiscoveryView extends DiscoveryView {
}
public void dispose() {
- IDiscoveryController c = getController();
+ final IDiscoveryController c = getController();
if (c != null && c.isDiscoveryStarted()) {
c.stopDiscovery();
}

Back to the top