Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118782 Details for
Bug 256603
[Discovery][Remotesvcs] Replace org.eclipse.ecf.discovery.ui with EMF based ui (CQ 2038)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
preliminary patch (snapshot)
clipboard.txt (text/plain), 69.10 KB, created by
Markus Kuppe
on 2008-11-26 08:41:41 EST
(
hide
)
Description:
preliminary patch (snapshot)
Filename:
MIME Type:
Creator:
Markus Kuppe
Created:
2008-11-26 08:41:41 EST
Size:
69.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.discovery.edit >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/incubation/bundles/org.eclipse.ecf.discovery.edit/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 5 Mar 2008 07:29:43 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Nov 2008 13:40:56 -0000 >@@ -2,15 +2,15 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ecf.discovery.edit;singleton:=true >-Bundle-Version: 2.0.0.qualifier >+Bundle-Version: 3.0.0.qualifier > Bundle-ClassPath: . > Bundle-Activator: org.eclipse.ecf.discovery.edit.provider.DiscoveryEditPlugin$Implementation > Bundle-Vendor: %providerName > Bundle-Localization: plugin > Bundle-RequiredExecutionEnvironment: J2SE-1.5 >-Export-Package: org.eclipse.ecf.discovery.edit, >- org.eclipse.ecf.discovery.edit.provider >-Require-Bundle: org.eclipse.core.runtime, >- org.eclipse.ecf.discovery.model;visibility:=reexport, >- org.eclipse.emf.edit;visibility:=reexport >+Export-Package: org.eclipse.ecf.discovery.edit;x-internal:=true, >+ org.eclipse.ecf.discovery.edit.provider;x-internal:=true >+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", >+ org.eclipse.ecf.discovery.model;bundle-version="3.0.0", >+ org.eclipse.emf.edit;bundle-version="[2.4.0,3.0.0)" > Eclipse-LazyStart: true >#P org.eclipse.ecf.discovery.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/incubation/bundles/org.eclipse.ecf.discovery.ui/plugin.xml,v >retrieving revision 1.1 >diff -u -r1.1 plugin.xml >--- plugin.xml 24 Nov 2008 12:13:07 -0000 1.1 >+++ plugin.xml 26 Nov 2008 13:40:58 -0000 >@@ -6,10 +6,34 @@ > <view > allowMultiple="true" > category="org.eclipse.ui" >- class="org.eclipse.ecf.discovery.ui.views.DiscoveryView" >+ class="org.eclipse.ecf.internal.discovery.ui.views.DiscoveryView" > icon="icons/full/obj16/dbbrowser_view.gif" > id="org.eclipse.ecf.discovery.ui.DiscoveryView" > name="%discovery.view"> > </view> > </extension> >+ >+ <extension >+ point="org.eclipse.core.expressions.propertyTesters"> >+ <propertyTester >+ class="org.eclipse.ecf.internal.discovery.ui.property.ServiceTypeTester" >+ id="org.eclipse.ecf.discovery.ServiceTypePropertyTester" >+ namespace="org.eclipse.ecf.discovery" >+ properties="isServiceType" >+ type="org.eclipse.ecf.discovery.model.IServiceInfo"> >+ </propertyTester> >+ </extension> >+ >+ >+ <!-- map from EMF models to platform's property sources --> >+ <extension >+ point="org.eclipse.core.runtime.adapters"> >+ <factory >+ adaptableType="org.eclipse.emf.ecore.EObject" >+ class="org.eclipse.ecf.internal.discovery.ui.EObjectPropertySourceFactory"> >+ <adapter >+ type="org.eclipse.ui.views.properties.IPropertySource"> >+ </adapter> >+ </factory> >+ </extension> > </plugin> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/incubation/bundles/org.eclipse.ecf.discovery.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 24 Nov 2008 12:13:07 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Nov 2008 13:40:58 -0000 >@@ -2,14 +2,18 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ecf.discovery.ui;singleton:=true >-Bundle-Version: 2.0.0.qualifier >+Bundle-Version: 3.0.0.qualifier > Bundle-ClassPath: . >-Bundle-Activator: org.eclipse.ecf.discovery.ui.DiscoveryUIPlugin$Implementation >+Bundle-Activator: org.eclipse.ecf.internal.discovery.ui.DiscoveryUIPlugin$Implementation > Bundle-Vendor: %providerName > Bundle-Localization: plugin > Bundle-RequiredExecutionEnvironment: J2SE-1.5 >-Require-Bundle: org.eclipse.core.runtime, >- org.eclipse.ecf.discovery.edit;visibility:=reexport, >- org.eclipse.emf.edit.ui, >- org.eclipse.ui >-Eclipse-LazyStart: true >+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", >+ org.eclipse.ecf.discovery.edit;bundle-version="3.0.0", >+ org.eclipse.emf.edit.ui;bundle-version="[2.4.0,3.0.0)", >+ org.eclipse.ui;bundle-version="[3.4.0,4.0.0)", >+ org.eclipse.ecf.discovery.model;bundle-version="3.0.0", >+ org.eclipse.core.expressions;bundle-version="3.4.0", >+ org.eclipse.ecf.discovery;bundle-version="2.1.0" >+Bundle-ActivationPolicy: lazy >+Export-Package: org.eclipse.ecf.discovery.ui;version="3.0.0" >Index: src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java >=================================================================== >RCS file: src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java >diff -N src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java >--- src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java 24 Nov 2008 12:13:07 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,150 +0,0 @@ >-/**************************************************************************** >- * Copyright (c) 2008 Versant Corp. and others. >- * 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: >- * Versant Corp. - initial API and implementation >- *****************************************************************************/ >-package org.eclipse.ecf.discovery.ui.views; >- >-import org.eclipse.ecf.discovery.edit.provider.DiscoveryEditingDomainProvider; >-import org.eclipse.ecf.discovery.ui.statusline.AdapterFactoryStatuslineProvider; >-import org.eclipse.emf.common.util.EList; >-import org.eclipse.emf.ecore.resource.Resource; >-import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >-import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; >-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; >-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; >-import org.eclipse.jface.action.IMenuListener; >-import org.eclipse.jface.action.IMenuManager; >-import org.eclipse.jface.action.IToolBarManager; >-import org.eclipse.jface.action.MenuManager; >-import org.eclipse.jface.action.Separator; >-import org.eclipse.jface.viewers.StructuredSelection; >-import org.eclipse.jface.viewers.StructuredViewer; >-import org.eclipse.jface.viewers.TreeViewer; >-import org.eclipse.jface.viewers.ViewerComparator; >-import org.eclipse.jface.viewers.ViewerFilter; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Menu; >-import org.eclipse.ui.IActionBars; >-import org.eclipse.ui.IWorkbenchActionConstants; >-import org.eclipse.ui.part.DrillDownAdapter; >-import org.eclipse.ui.part.ViewPart; >- >- >-public class DiscoveryView extends ViewPart { >- >- public static final String ID = "org.eclipse.ecf.discovery.ui.DiscoveryView"; >- >- private DrillDownAdapter drillDownAdapter; >- >- private TreeViewer selectionViewer; >- >- private void contributeToActionBars() { >- IActionBars bars = getViewSite().getActionBars(); >- fillLocalPullDown(bars.getMenuManager()); >- fillLocalToolBar(bars.getToolBarManager()); >- } >- >- /** >- * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. <!-- >- * begin-user-doc --> <!-- end-user-doc --> >- */ >- protected void createContextMenuFor(StructuredViewer viewer) { >- MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$ >- contextMenu.add(new Separator("additions")); //$NON-NLS-1$ >- contextMenu.setRemoveAllWhenShown(true); >- Menu menu = contextMenu.createContextMenu(viewer.getControl()); >- viewer.getControl().setMenu(menu); >- getSite().registerContextMenu(contextMenu, viewer); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) >- */ >- public void createPartControl(Composite parent) { >- ComposedAdapterFactory adapterFactory = DiscoveryEditingDomainProvider.eINSTANCE.getAdapterFactory(); >- >- // create the viewer >- selectionViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); >- selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); >- selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); >- selectionViewer.setComparator(new ViewerComparator()); >- selectionViewer.setFilters(getViewerFilters()); >- getSite().setSelectionProvider(selectionViewer); >- >- // populate the viewer with the model if available >- EList<Resource> resources = DiscoveryEditingDomainProvider.eINSTANCE.getEditingDomain().getResourceSet() >- .getResources(); >- if (resources != null) { >- selectionViewer.setInput(resources.get(0)); >- selectionViewer.setSelection(new StructuredSelection(resources.get(0)), true); >- } >- >- new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); >- selectionViewer.addPostSelectionChangedListener(new AdapterFactoryStatuslineProvider(adapterFactory, >- getViewSite().getActionBars().getStatusLineManager())); >- >- drillDownAdapter = new DrillDownAdapter(selectionViewer); >- createContextMenuFor(selectionViewer); >- hookContextMenu(); >- contributeToActionBars(); >- } >- >- /** >- * @return >- */ >- private ViewerFilter[] getViewerFilters() { >- //TODO lookup view filters via EP >- return new ViewerFilter[0]; >- } >- >- private void fillContextMenu(IMenuManager manager) { >- manager.add(new Separator()); >- drillDownAdapter.addNavigationActions(manager); >- // Other plug-ins can contribute their actions here >- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); >- } >- >- private void fillLocalPullDown(IMenuManager manager) { >- manager.add(new Separator()); >- } >- >- private void fillLocalToolBar(IToolBarManager manager) { >- drillDownAdapter.addNavigationActions(manager); >- } >- >- private void hookContextMenu() { >- MenuManager menuMgr = new MenuManager("#PopupMenu"); >- menuMgr.setRemoveAllWhenShown(true); >- menuMgr.addMenuListener(new IMenuListener() { >- /* (non-Javadoc) >- * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager) >- */ >- public void menuAboutToShow(IMenuManager manager) { >- //TODO https://bugs.eclipse.org/bugs/show_bug.cgi?id=151604 >- // add a menu listener >- // that will fire a selection changed event, in order >- // to update the selection in contributed actions >- selectionViewer.setSelection(selectionViewer.getSelection()); >- >- DiscoveryView.this.fillContextMenu(manager); >- } >- }); >- Menu menu = menuMgr.createContextMenu(selectionViewer.getControl()); >- selectionViewer.getControl().setMenu(menu); >- getSite().registerContextMenu(menuMgr, selectionViewer); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.part.WorkbenchPart#setFocus() >- */ >- public void setFocus() { >- selectionViewer.getControl().setFocus(); >- } >-} >Index: src/org/eclipse/ecf/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >=================================================================== >RCS file: src/org/eclipse/ecf/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >diff -N src/org/eclipse/ecf/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >--- src/org/eclipse/ecf/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java 24 Nov 2008 12:13:07 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,64 +0,0 @@ >-/**************************************************************************** >- * Copyright (c) 2008 Versant Corp. and others. >- * 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: >- * Versant Corp. - initial API and implementation >- *****************************************************************************/ >-package org.eclipse.ecf.discovery.ui.statusline; >- >-import org.eclipse.ecf.discovery.edit.IItemStatusLineProvider; >-import org.eclipse.emf.ecore.EObject; >-import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >-import org.eclipse.emf.edit.provider.IItemLabelProvider; >-import org.eclipse.jface.action.IStatusLineManager; >-import org.eclipse.jface.viewers.ISelection; >-import org.eclipse.jface.viewers.ISelectionChangedListener; >-import org.eclipse.jface.viewers.IStructuredSelection; >-import org.eclipse.jface.viewers.SelectionChangedEvent; >- >- >-public class AdapterFactoryStatuslineProvider implements ISelectionChangedListener { >- private ComposedAdapterFactory adapterFactory; >- private IStatusLineManager statusline; >- >- /** >- * @param aStatusline >- * @param adapterFactory >- */ >- public AdapterFactoryStatuslineProvider(ComposedAdapterFactory anAdapterFactory, IStatusLineManager aStatusline) { >- adapterFactory = anAdapterFactory; >- statusline = aStatusline; >- } >- >- /* >- * (non-Javadoc) >- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) >- */ >- public void selectionChanged(SelectionChangedEvent event) { >- ISelection selection = event.getSelection(); >- if (selection instanceof IStructuredSelection) { >- IStructuredSelection ss = (IStructuredSelection) selection; >- EObject object = (EObject) ss.getFirstElement(); >- if (object != null) { // do we really have a selection? >- IItemStatusLineProvider itemStatusLineProvider = (IItemStatusLineProvider) adapterFactory >- .adapt(object, IItemStatusLineProvider.class); >- if (itemStatusLineProvider != null) { >- statusline.setMessage(itemStatusLineProvider.getStatusLineText(object)); >- } else { >- // fallback to IItemLabelProvider.getText(..) >- IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(object, IItemLabelProvider.class); >- if (itemLabelProvider != null) { >- statusline.setMessage(itemLabelProvider.getText(object)); >- } >- } >- >- } >- } else { >- statusline.setMessage(""); >- } >- } >-} >Index: src/org/eclipse/ecf/discovery/ui/DiscoveryUIPlugin.java >=================================================================== >RCS file: src/org/eclipse/ecf/discovery/ui/DiscoveryUIPlugin.java >diff -N src/org/eclipse/ecf/discovery/ui/DiscoveryUIPlugin.java >--- src/org/eclipse/ecf/discovery/ui/DiscoveryUIPlugin.java 24 Nov 2008 12:13:07 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,104 +0,0 @@ >-/**************************************************************************** >- * Copyright (c) 2008 Versant Corp. and others. >- * 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: >- * Versant Corp. - initial API and implementation >- *****************************************************************************/ >-package org.eclipse.ecf.discovery.ui; >- >-import org.eclipse.emf.common.EMFPlugin; >-import org.eclipse.emf.common.ui.EclipseUIPlugin; >-import org.eclipse.emf.common.util.ResourceLocator; >- >-/** >- * This is the central singleton for the Discovery plugin. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >-public final class DiscoveryUIPlugin extends EMFPlugin { >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public static final String copyright = ""; >- >- /** >- * Keep track of the singleton. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public static final DiscoveryUIPlugin INSTANCE = new DiscoveryUIPlugin(); >- >- /** >- * Keep track of the singleton. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- private static Implementation plugin; >- >- /** >- * Create the instance. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public DiscoveryUIPlugin() { >- super >- (new ResourceLocator [] { >- }); >- } >- >- /** >- * Returns the singleton instance of the Eclipse plugin. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return the singleton instance. >- * @generated >- */ >- @Override >- public ResourceLocator getPluginResourceLocator() { >- return plugin; >- } >- >- /** >- * Returns the singleton instance of the Eclipse plugin. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return the singleton instance. >- * @generated >- */ >- public static Implementation getPlugin() { >- return plugin; >- } >- >- /** >- * The actual implementation of the Eclipse <b>Plugin</b>. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public static class Implementation extends EclipseUIPlugin { >- /** >- * Creates an instance. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public Implementation() { >- super(); >- >- // Remember the static instance. >- // >- plugin = this; >- } >- } >- >-} >Index: src/org/eclipse/ecf/discovery/ui/DiscoveryHandlerUtil.java >=================================================================== >RCS file: src/org/eclipse/ecf/discovery/ui/DiscoveryHandlerUtil.java >diff -N src/org/eclipse/ecf/discovery/ui/DiscoveryHandlerUtil.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/discovery/ui/DiscoveryHandlerUtil.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,46 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ecf.discovery.ui; >+ >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.ecf.discovery.IServiceInfo; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.ui.handlers.HandlerUtil; >+ >+public class DiscoveryHandlerUtil { >+ public static IServiceInfo getActiveIServiceInfoChecked(ExecutionEvent event) throws ExecutionException { >+ ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); >+ org.eclipse.ecf.discovery.model.IServiceInfo serviceInfo = toIServiceInfo(selection); >+ if(serviceInfo == null) { >+ return null; >+ } else { >+ return serviceInfo.getEcfServiceInfo(); >+ } >+ } >+ public static IServiceInfo getActiveIServiceInfo(ExecutionEvent event) { >+ ISelection selection = HandlerUtil.getCurrentSelection(event); >+ org.eclipse.ecf.discovery.model.IServiceInfo serviceInfo = toIServiceInfo(selection); >+ if(serviceInfo == null) { >+ return null; >+ } else { >+ return serviceInfo.getEcfServiceInfo(); >+ } >+ } >+ private static org.eclipse.ecf.discovery.model.IServiceInfo toIServiceInfo(ISelection selection) { >+ if(selection instanceof IStructuredSelection) { >+ return (org.eclipse.ecf.discovery.model.IServiceInfo) ((IStructuredSelection) selection).getFirstElement(); >+ } >+ return null; >+ } >+} >Index: src/org/eclipse/ecf/internal/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >diff -N src/org/eclipse/ecf/internal/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/discovery/ui/statusline/AdapterFactoryStatuslineProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,64 @@ >+/**************************************************************************** >+ * Copyright (c) 2008 Versant Corp. and others. >+ * 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: >+ * Versant Corp. - initial API and implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.internal.discovery.ui.statusline; >+ >+import org.eclipse.ecf.discovery.edit.IItemStatusLineProvider; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >+import org.eclipse.emf.edit.provider.IItemLabelProvider; >+import org.eclipse.jface.action.IStatusLineManager; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.ISelectionChangedListener; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.viewers.SelectionChangedEvent; >+ >+ >+public class AdapterFactoryStatuslineProvider implements ISelectionChangedListener { >+ private ComposedAdapterFactory adapterFactory; >+ private IStatusLineManager statusline; >+ >+ /** >+ * @param aStatusline >+ * @param adapterFactory >+ */ >+ public AdapterFactoryStatuslineProvider(ComposedAdapterFactory anAdapterFactory, IStatusLineManager aStatusline) { >+ adapterFactory = anAdapterFactory; >+ statusline = aStatusline; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) >+ */ >+ public void selectionChanged(SelectionChangedEvent event) { >+ ISelection selection = event.getSelection(); >+ if (selection instanceof IStructuredSelection) { >+ IStructuredSelection ss = (IStructuredSelection) selection; >+ EObject object = (EObject) ss.getFirstElement(); >+ if (object != null) { // do we really have a selection? >+ IItemStatusLineProvider itemStatusLineProvider = (IItemStatusLineProvider) adapterFactory >+ .adapt(object, IItemStatusLineProvider.class); >+ if (itemStatusLineProvider != null) { >+ statusline.setMessage(itemStatusLineProvider.getStatusLineText(object)); >+ } else { >+ // fallback to IItemLabelProvider.getText(..) >+ IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(object, IItemLabelProvider.class); >+ if (itemLabelProvider != null) { >+ statusline.setMessage(itemLabelProvider.getText(object)); >+ } >+ } >+ >+ } >+ } else { >+ statusline.setMessage(""); >+ } >+ } >+} >Index: src/org/eclipse/ecf/internal/discovery/ui/EObjectPropertySourceFactory.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/discovery/ui/EObjectPropertySourceFactory.java >diff -N src/org/eclipse/ecf/internal/discovery/ui/EObjectPropertySourceFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/discovery/ui/EObjectPropertySourceFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,46 @@ >+/**************************************************************************** >+ * Copyright (c) 2008 Versant Corp. and others. >+ * 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: >+ * Versant Corp. - initial API and implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.internal.discovery.ui; >+ >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.emf.common.notify.Adapter; >+import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.edit.provider.IItemPropertySource; >+import org.eclipse.emf.edit.ui.provider.PropertySource; >+import org.eclipse.ui.views.properties.IPropertySource; >+ >+public class EObjectPropertySourceFactory implements IAdapterFactory { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) >+ */ >+ public Object getAdapter(Object adaptableObject, Class adapterType) { >+ if (adapterType.equals(IPropertySource.class) && adaptableObject instanceof EObject) { >+ EObject eObj = (EObject) adaptableObject; >+ EList<Adapter> adapters = eObj.eAdapters(); >+ for (Adapter adapter : adapters) { >+ if (adapter instanceof IItemPropertySource) { >+ //TODO handle the case with multiple IItemPropertySource adapters for this EObject >+ return new PropertySource(adaptableObject, (IItemPropertySource) adapter); >+ } >+ } >+ } >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() >+ */ >+ public Class[] getAdapterList() { >+ return new Class[] { IPropertySource.class }; >+ } >+} >Index: src/org/eclipse/ecf/internal/discovery/ui/DiscoveryUIPlugin.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/discovery/ui/DiscoveryUIPlugin.java >diff -N src/org/eclipse/ecf/internal/discovery/ui/DiscoveryUIPlugin.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/discovery/ui/DiscoveryUIPlugin.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,104 @@ >+/**************************************************************************** >+ * Copyright (c) 2008 Versant Corp. and others. >+ * 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: >+ * Versant Corp. - initial API and implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.internal.discovery.ui; >+ >+import org.eclipse.emf.common.EMFPlugin; >+import org.eclipse.emf.common.ui.EclipseUIPlugin; >+import org.eclipse.emf.common.util.ResourceLocator; >+ >+/** >+ * This is the central singleton for the Discovery plugin. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+public final class DiscoveryUIPlugin extends EMFPlugin { >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static final String copyright = ""; >+ >+ /** >+ * Keep track of the singleton. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static final DiscoveryUIPlugin INSTANCE = new DiscoveryUIPlugin(); >+ >+ /** >+ * Keep track of the singleton. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private static Implementation plugin; >+ >+ /** >+ * Create the instance. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DiscoveryUIPlugin() { >+ super >+ (new ResourceLocator [] { >+ }); >+ } >+ >+ /** >+ * Returns the singleton instance of the Eclipse plugin. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the singleton instance. >+ * @generated >+ */ >+ @Override >+ public ResourceLocator getPluginResourceLocator() { >+ return plugin; >+ } >+ >+ /** >+ * Returns the singleton instance of the Eclipse plugin. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the singleton instance. >+ * @generated >+ */ >+ public static Implementation getPlugin() { >+ return plugin; >+ } >+ >+ /** >+ * The actual implementation of the Eclipse <b>Plugin</b>. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static class Implementation extends EclipseUIPlugin { >+ /** >+ * Creates an instance. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Implementation() { >+ super(); >+ >+ // Remember the static instance. >+ // >+ plugin = this; >+ } >+ } >+ >+} >Index: src/org/eclipse/ecf/internal/discovery/ui/property/ServiceTypeTester.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/discovery/ui/property/ServiceTypeTester.java >diff -N src/org/eclipse/ecf/internal/discovery/ui/property/ServiceTypeTester.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/discovery/ui/property/ServiceTypeTester.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,48 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ecf.internal.discovery.ui.property; >+ >+import java.util.Arrays; >+import java.util.List; >+ >+import org.eclipse.core.expressions.PropertyTester; >+import org.eclipse.ecf.discovery.model.IServiceInfo; >+import org.eclipse.ecf.discovery.model.IServiceTypeID; >+ >+public class ServiceTypeTester extends PropertyTester { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) >+ */ >+ public boolean test(Object receiver, String property, Object[] args, >+ Object expectedValue) { >+ if(args == null || !(expectedValue instanceof Boolean)) { >+ return false; >+ } >+ boolean expected = ((Boolean)expectedValue).booleanValue(); >+ >+ // convert the args to a list we can use for comparison >+ List<Object> asList = Arrays.asList(args); >+ >+ // extract the sublist from the service types >+ IServiceInfo serviceInfo = (IServiceInfo) receiver; >+ IServiceTypeID serviceTypeId = serviceInfo.getServiceID().getServiceTypeID(); >+ List<String> services = serviceTypeId.getEcfServices(); >+ if(services.size() < args.length) { >+ return false; >+ } else { >+ List<String> ecfServices = services.subList(0, args.length); >+ boolean equals = asList.equals(ecfServices); >+ return equals == expected ? true : false; >+ } >+ } >+} >Index: src/org/eclipse/ecf/internal/discovery/ui/views/DiscoveryView.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/discovery/ui/views/DiscoveryView.java >diff -N src/org/eclipse/ecf/internal/discovery/ui/views/DiscoveryView.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/discovery/ui/views/DiscoveryView.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,186 @@ >+/**************************************************************************** >+ * Copyright (c) 2008 Versant Corp. and others. >+ * 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: >+ * Versant Corp. - initial API and implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.internal.discovery.ui.views; >+ >+import org.eclipse.ecf.discovery.edit.provider.DiscoveryEditingDomainProvider; >+import org.eclipse.ecf.internal.discovery.ui.statusline.AdapterFactoryStatuslineProvider; >+import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.ecore.resource.Resource; >+import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; >+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; >+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; >+import org.eclipse.jface.action.IMenuListener; >+import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.action.MenuManager; >+import org.eclipse.jface.action.Separator; >+import org.eclipse.jface.util.LocalSelectionTransfer; >+import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.jface.viewers.StructuredViewer; >+import org.eclipse.jface.viewers.TreeViewer; >+import org.eclipse.jface.viewers.ViewerComparator; >+import org.eclipse.jface.viewers.ViewerFilter; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.dnd.DND; >+import org.eclipse.swt.dnd.DragSourceAdapter; >+import org.eclipse.swt.dnd.DragSourceEvent; >+import org.eclipse.swt.dnd.Transfer; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Menu; >+import org.eclipse.ui.IActionBars; >+import org.eclipse.ui.IWorkbenchActionConstants; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.handlers.CollapseAllHandler; >+import org.eclipse.ui.handlers.IHandlerService; >+import org.eclipse.ui.part.DrillDownAdapter; >+import org.eclipse.ui.part.ViewPart; >+ >+ >+public class DiscoveryView extends ViewPart { >+ >+ public static final String ID = "org.eclipse.ecf.discovery.ui.DiscoveryView"; >+ >+ private DrillDownAdapter drillDownAdapter; >+ >+ private TreeViewer selectionViewer; >+ >+ private CollapseAllHandler collapseHandler; >+ >+ >+ private void contributeToActionBars() { >+ IActionBars bars = getViewSite().getActionBars(); >+ fillLocalPullDown(bars.getMenuManager()); >+ fillLocalToolBar(bars.getToolBarManager()); >+ } >+ >+ /** >+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. <!-- >+ * begin-user-doc --> <!-- end-user-doc --> >+ */ >+ protected void createContextMenuFor(StructuredViewer viewer) { >+ MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$ >+ contextMenu.add(new Separator("additions")); //$NON-NLS-1$ >+ contextMenu.setRemoveAllWhenShown(true); >+ Menu menu = contextMenu.createContextMenu(viewer.getControl()); >+ viewer.getControl().setMenu(menu); >+ getSite().registerContextMenu(contextMenu, viewer); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public void createPartControl(Composite parent) { >+ ComposedAdapterFactory adapterFactory = DiscoveryEditingDomainProvider.eINSTANCE.getAdapterFactory(); >+ >+ // create the viewer >+ selectionViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); >+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); >+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); >+ selectionViewer.setComparator(new ViewerComparator()); >+ selectionViewer.setFilters(getViewerFilters()); >+ getSite().setSelectionProvider(selectionViewer); >+ >+ // populate the viewer with the model if available >+ EList<Resource> resources = DiscoveryEditingDomainProvider.eINSTANCE.getEditingDomain().getResourceSet() >+ .getResources(); >+ if (resources != null) { >+ selectionViewer.setInput(resources.get(0)); >+ selectionViewer.setSelection(new StructuredSelection(resources.get(0)), true); >+ } >+ >+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); >+ selectionViewer.addPostSelectionChangedListener(new AdapterFactoryStatuslineProvider(adapterFactory, >+ getViewSite().getActionBars().getStatusLineManager())); >+ >+ drillDownAdapter = new DrillDownAdapter(selectionViewer); >+ createContextMenuFor(selectionViewer); >+ hookContextMenu(); >+ contributeToActionBars(); >+ >+ // add collapse handler >+ IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class); >+ collapseHandler = new CollapseAllHandler(selectionViewer); >+ handlerService.activateHandler(CollapseAllHandler.COMMAND_ID, collapseHandler); >+ >+ // add DND support >+ Transfer[] supportedTransfers = { LocalSelectionTransfer.getTransfer() }; >+ selectionViewer.addDragSupport(DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_MOVE, supportedTransfers, new DragSourceAdapter() { >+ @Override >+ public void dragSetData(DragSourceEvent event) { >+ LocalSelectionTransfer.getTransfer().setSelection(selectionViewer.getSelection()); >+ } >+ }); >+ >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.ecf.discovery.ui.ServiceView"); >+ } >+ >+ /** >+ * @return >+ */ >+ private ViewerFilter[] getViewerFilters() { >+ //TODO lookup view filters via EP >+ return new ViewerFilter[0]; >+ } >+ >+ private void fillContextMenu(IMenuManager manager) { >+ manager.add(new Separator()); >+ drillDownAdapter.addNavigationActions(manager); >+ >+ // Other plug-ins can contribute their actions here >+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); >+ } >+ >+ private void fillLocalPullDown(IMenuManager manager) { >+ manager.add(new Separator()); >+ } >+ >+ private void fillLocalToolBar(IToolBarManager manager) { >+ drillDownAdapter.addNavigationActions(manager); >+ } >+ >+ private void hookContextMenu() { >+ MenuManager menuMgr = new MenuManager("#PopupMenu"); >+ menuMgr.setRemoveAllWhenShown(true); >+ menuMgr.addMenuListener(new IMenuListener() { >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager) >+ */ >+ public void menuAboutToShow(IMenuManager manager) { >+ //TODO https://bugs.eclipse.org/bugs/show_bug.cgi?id=151604 >+ // add a menu listener >+ // that will fire a selection changed event, in order >+ // to update the selection in contributed actions >+ selectionViewer.setSelection(selectionViewer.getSelection()); >+ >+ DiscoveryView.this.fillContextMenu(manager); >+ } >+ }); >+ Menu menu = menuMgr.createContextMenu(selectionViewer.getControl()); >+ selectionViewer.getControl().setMenu(menu); >+ getSite().registerContextMenu(menuMgr, selectionViewer); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus() >+ */ >+ public void setFocus() { >+ selectionViewer.getControl().setFocus(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.part.WorkbenchPart#dispose() >+ */ >+ public void dispose() { >+ super.dispose(); >+ collapseHandler.dispose(); >+ } >+} >Index: src/org/eclipse/ecf/discovery/ui/DiscoveryPropertyTesterUtil.java >=================================================================== >RCS file: src/org/eclipse/ecf/discovery/ui/DiscoveryPropertyTesterUtil.java >diff -N src/org/eclipse/ecf/discovery/ui/DiscoveryPropertyTesterUtil.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/discovery/ui/DiscoveryPropertyTesterUtil.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ecf.discovery.ui; >+ >+import org.eclipse.ecf.discovery.IServiceInfo; >+ >+public class DiscoveryPropertyTesterUtil { >+ >+ public static IServiceInfo getIServiceInfoReceiver(Object receiver) { >+ if(receiver instanceof org.eclipse.ecf.discovery.model.IServiceInfo) { >+ org.eclipse.ecf.discovery.model.IServiceInfo isi = (org.eclipse.ecf.discovery.model.IServiceInfo) receiver; >+ return isi.getEcfServiceInfo(); >+ } >+ return null; >+ } >+ >+} >#P org.eclipse.ecf.remoteservice.ui >Index: .classpath >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/framework/bundles/org.eclipse.ecf.remoteservice.ui/.classpath,v >retrieving revision 1.1 >diff -u -r1.1 .classpath >--- .classpath 2 Mar 2008 01:43:46 -0000 1.1 >+++ .classpath 26 Nov 2008 13:41:00 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> >- <classpathentry kind="src" path="src"/> > <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="src" path="src"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: build.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/framework/bundles/org.eclipse.ecf.remoteservice.ui/build.properties,v >retrieving revision 1.2 >diff -u -r1.2 build.properties >--- build.properties 2 Mar 2008 16:47:21 -0000 1.2 >+++ build.properties 26 Nov 2008 13:41:00 -0000 >@@ -3,7 +3,8 @@ > bin.includes = META-INF/,\ > .,\ > about.html,\ >- plugin.properties >+ plugin.properties,\ >+ plugin.xml > src.includes = about.html,\ > META-INF/,\ > plugin.properties >Index: src/org/eclipse/ecf/internal/remoteservices/ui/Messages.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/framework/bundles/org.eclipse.ecf.remoteservice.ui/src/org/eclipse/ecf/internal/remoteservices/ui/Messages.java,v >retrieving revision 1.2 >diff -u -r1.2 Messages.java >--- src/org/eclipse/ecf/internal/remoteservices/ui/Messages.java 2 Mar 2008 20:51:00 -0000 1.2 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/Messages.java 26 Nov 2008 13:41:00 -0000 >@@ -32,6 +32,13 @@ > public static String MethodInvocationDialog_InvocationTypeRemoteServiceProxy; > public static String MethodInvocationDialog_InvocationTypeSynchronous; > >+ public static String AbstractRemoteServiceAccessHandler_DISCONNECT_MENU_TEXT; >+ public static String AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_EXCEPTION_TEXT; >+ public static String AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_EXCEPTION_TITLE; >+ public static String AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_RESP_TEXT; >+ public static String AbstractRemoteServiceAccessHandler_MSG_BOX_RECEIVED_RESP_TITLE; >+ public static String AbstractRemoteServiceAccessHandler_NOT_AVAILABLE_MENU_TEXT; >+ > static { > NLS.initializeMessages(BUNDLE_NAME, Messages.class); > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/framework/bundles/org.eclipse.ecf.remoteservice.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.4 >diff -u -r1.4 MANIFEST.MF >--- META-INF/MANIFEST.MF 6 Apr 2008 22:58:34 -0000 1.4 >+++ META-INF/MANIFEST.MF 26 Nov 2008 13:41:00 -0000 >@@ -2,12 +2,17 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %plugin.name > Bundle-SymbolicName: org.eclipse.ecf.remoteservice.ui;singleton:=true >-Bundle-Version: 2.0.0.qualifier >+Bundle-Version: 3.0.0.qualifier > Bundle-RequiredExecutionEnvironment: J2SE-1.4 > Require-Bundle: org.eclipse.core.runtime, >- org.eclipse.ui >-Export-Package: org.eclipse.ecf.internal.remoteservices.ui;x-internal:=true, >- org.eclipse.ecf.remoteservices.ui >+ org.eclipse.ui, >+ org.eclipse.core.expressions;bundle-version="3.4.0", >+ org.eclipse.ecf;bundle-version="2.0.1", >+ 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" >+Export-Package: org.eclipse.ecf.remoteservices.ui;version="3.0.0" > Bundle-ActivationPolicy: lazy > Bundle-Vendor: %plugin.provider > Bundle-Localization: plugin >+Bundle-Activator: org.eclipse.ecf.internal.remoteservices.ui.Activator >Index: src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ConnectRemoteServicehandler.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ConnectRemoteServicehandler.java >diff -N src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ConnectRemoteServicehandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ConnectRemoteServicehandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,64 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.remoteservices.ui.handlers; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.ecf.core.ContainerConnectException; >+import org.eclipse.ecf.core.IContainer; >+import org.eclipse.ecf.core.identity.ID; >+import org.eclipse.ecf.internal.remoteservices.ui.RemoteServiceHandlerUtil; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.swt.widgets.Display; >+ >+public class ConnectRemoteServicehandler extends AbstractHandler { >+ >+ public Object execute(final ExecutionEvent event) throws ExecutionException { >+ final ID createConnectId = RemoteServiceHandlerUtil.getActiveConnectIDChecked(event); >+ // decouple the long running connect call from the ui thread >+ Job job = new Job(NLS.bind("Connecting {0}", createConnectId.getName())) { >+ protected IStatus run(IProgressMonitor monitor) { >+ try { >+ final IContainer container = RemoteServiceHandlerUtil.getActiveIRemoteServiceContainerChecked(event); >+ container.connect(createConnectId, null); >+ } catch (ContainerConnectException e) { >+ showException(e); >+ return Status.CANCEL_STATUS; >+ } catch (ExecutionException e) { >+ showException(e); >+ return Status.CANCEL_STATUS; >+ } >+ return Status.OK_STATUS; >+ } >+ }; >+ job.setUser(true); >+ job.schedule(); >+ return null; >+ } >+ >+ private void showException(final Throwable t) { >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ String msg = t.toString(); >+ if (t.getCause() != null) { >+ msg += t.getCause().toString(); >+ } >+ MessageDialog.openError(null, t.getLocalizedMessage(), NLS.bind("Exception: {0}", msg)); >+ } >+ }); >+ } >+} >Index: src/org/eclipse/ecf/internal/remoteservices/ui/property/ConnectedTester.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/remoteservices/ui/property/ConnectedTester.java >diff -N src/org/eclipse/ecf/internal/remoteservices/ui/property/ConnectedTester.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/property/ConnectedTester.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,70 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.remoteservices.ui.property; >+ >+ >+import org.eclipse.core.expressions.PropertyTester; >+import org.eclipse.ecf.core.IContainer; >+import org.eclipse.ecf.core.IContainerManager; >+import org.eclipse.ecf.core.identity.ID; >+import org.eclipse.ecf.core.identity.IDCreateException; >+import org.eclipse.ecf.core.identity.IDFactory; >+import org.eclipse.ecf.discovery.IServiceInfo; >+import org.eclipse.ecf.discovery.ui.DiscoveryPropertyTesterUtil; >+import org.eclipse.ecf.internal.remoteservices.ui.Activator; >+import org.eclipse.ecf.remoteservice.Constants; >+ >+public class ConnectedTester extends PropertyTester { >+ >+ private IContainerManager containerManager; >+ >+ public ConnectedTester() { >+ containerManager = Activator.getDefault().getContainerManager(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) >+ */ >+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { >+ // consumers expect connected or disconnected >+ if(!(expectedValue instanceof Boolean)) { >+ return false; >+ } >+ boolean expected = ((Boolean) expectedValue).booleanValue(); >+ >+ // get the container instance >+ IServiceInfo serviceInfo = DiscoveryPropertyTesterUtil.getIServiceInfoReceiver(receiver); >+ final String connectNamespace = getConnectNamespace(serviceInfo); >+ final String connectId = getConnectID(serviceInfo); >+ try { >+ ID createConnectId = IDFactory.getDefault().createID(connectNamespace, connectId); >+ IContainer container = containerManager.getContainer(createConnectId); >+ if(container == null) { >+ //Trace.trace(...); >+ return expected == false; >+ } >+ ID connectedId = container.getConnectedID(); >+ boolean isConnected = connectedId == null ? false : true; >+ return expected == isConnected; >+ } catch (IDCreateException e) { >+ //Trace.trace(...); >+ return expected == false; >+ } >+ } >+ >+ private String getConnectNamespace(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_CONNECT_ID_NAMESPACE_PROPERTY); >+ } >+ >+ private String getConnectID(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_CONNECT_ID_PROPERTY); >+ } >+} >Index: src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ReflectiveRemoteServiceHandler.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ReflectiveRemoteServiceHandler.java >diff -N src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ReflectiveRemoteServiceHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/handlers/ReflectiveRemoteServiceHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,189 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.remoteservices.ui.handlers; >+ >+import java.lang.reflect.InvocationTargetException; >+import java.util.Arrays; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.commands.IHandler; >+import org.eclipse.ecf.core.IContainer; >+import org.eclipse.ecf.core.identity.ID; >+import org.eclipse.ecf.core.util.IAsyncResult; >+import org.eclipse.ecf.internal.remoteservices.ui.RemoteServiceHandlerUtil; >+import org.eclipse.ecf.remoteservice.IRemoteCall; >+import org.eclipse.ecf.remoteservice.IRemoteCallListener; >+import org.eclipse.ecf.remoteservice.IRemoteService; >+import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter; >+import org.eclipse.ecf.remoteservice.IRemoteServiceReference; >+import org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent; >+import org.eclipse.ecf.remoteservice.events.IRemoteCallEvent; >+import org.eclipse.ecf.remoteservices.ui.MethodInvocationDialog; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.window.Window; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; >+ >+public class ReflectiveRemoteServiceHandler extends AbstractHandler implements >+ IHandler { >+ >+ /* >+ * (non-Javadoc) >+ * @see >+ * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands >+ * .ExecutionEvent) >+ */ >+ public Object execute(ExecutionEvent event) throws ExecutionException { >+ final String clazz = event.getParameter("org.eclipse.ecf.remoteservices.ui.commands.reflectiveMethodDialogParameter"); >+ final IRemoteServiceContainerAdapter adapter = RemoteServiceHandlerUtil.getActiveIRemoteServiceContainerAdapterChecked(event); >+ final IRemoteServiceReference[] references = RemoteServiceHandlerUtil.getActiveIRemoteServiceReferencesChecked(event); >+ final IRemoteService remoteService = adapter.getRemoteService(references[0]); >+ try { >+ executeMethodInvocationDialog(Class.forName(clazz), remoteService); >+ } catch (ClassNotFoundException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } >+ return null; >+ } >+ >+ private void executeMethodInvocationDialog(final Class cls, final IRemoteService remoteService) { >+ final MethodInvocationDialog mid = new MethodInvocationDialog( >+ (Shell) null, cls); >+ if (mid.open() == Window.OK) { >+ final int timeout = (mid.getTimeout() > 0) ? mid.getTimeout() >+ : 30000; >+ final String methodName = mid.getMethod().getName(); >+ final Object[] methodArgs = mid.getMethodArguments(); >+ final IRemoteCall remoteCall = new IRemoteCall() { >+ public String getMethod() { >+ return methodName; >+ } >+ >+ public Object[] getParameters() { >+ return methodArgs; >+ } >+ >+ public long getTimeout() { >+ return timeout; >+ } >+ }; >+ final int invokeType = mid.getInvocationType(); >+ try { >+ switch (invokeType) { >+ case MethodInvocationDialog.ASYNC_FIRE_AND_GO: >+ remoteService.callAsynch(remoteCall); >+ break; >+ case MethodInvocationDialog.ASYNC_FUTURE_RESULT: >+ invokeFuture(cls, remoteService, remoteCall); >+ break; >+ case MethodInvocationDialog.ASYNC_LISTENER: >+ invokeAsyncListener(cls, remoteService, remoteCall); >+ break; >+ case MethodInvocationDialog.OSGI_SERVICE_PROXY: >+ throw new UnsupportedOperationException(); >+ // invokeOSGiProxy(interfaceClass, remoteCall); >+ // break; >+ case MethodInvocationDialog.REMOTE_SERVICE_PROXY: >+ throw new UnsupportedOperationException(); >+ // invokeProxy(interfaceClass, remoteService, remoteCall); >+ // break; >+ case MethodInvocationDialog.SYNCHRONOUS: >+ throw new UnsupportedOperationException(); >+ // invokeSync(cls, remoteService, remoteCall); >+ // break; >+ default: >+ break; >+ } >+ } catch (final Exception e) { >+ showException(e); >+ } >+ } >+ } >+ >+ protected void showException(final Throwable t, final IContainer container, >+ ID targetID) { >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ String msg = t.toString(); >+ if (t.getCause() != null) { >+ msg += t.getCause().toString(); >+ } >+ MessageDialog.openInformation(null, "Received Exception", NLS >+ .bind("Exception: {0}", msg)); >+ container.disconnect(); >+ } >+ }); >+ } >+ >+ protected void invokeFuture(Class cls, IRemoteService remoteService, >+ IRemoteCall remoteCall) throws InterruptedException, >+ InvocationTargetException { >+ // Make async call with future result >+ final IAsyncResult asyncResult = remoteService.callAsynch(remoteCall); >+ // Call blocking get and show result >+ showResult(cls.getName(), remoteCall, asyncResult.get()); >+ } >+ >+ private void invokeAsyncListener(final Class interfaceClass, >+ final IRemoteService remoteService, final IRemoteCall remoteCall) { >+ // Make async call >+ remoteService.callAsynch(remoteCall, new IRemoteCallListener() { >+ public void handleEvent(IRemoteCallEvent event) { >+ if (event instanceof IRemoteCallCompleteEvent) { >+ final IRemoteCallCompleteEvent complete = (IRemoteCallCompleteEvent) event; >+ if (complete.hadException()) { >+ showException(complete.getException()); >+ } else >+ showResult(interfaceClass.getName(), remoteCall, >+ complete.getResponse()); >+ } >+ } >+ }); >+ } >+ >+ protected void showException(final Throwable t) { >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ String msg = t.toString(); >+ if (t.getCause() != null) { >+ msg += t.getCause().toString(); >+ } >+ MessageDialog.openInformation(null, "Received Exception", NLS >+ .bind("Exception: {0}", msg)); >+ } >+ }); >+ } >+ >+ protected void showResult(final String serviceInterface, >+ final IRemoteCall remoteCall, final Object result) { >+ final Object display = (result != null && result.getClass().isArray()) ? Arrays >+ .asList((Object[]) result) >+ : result; >+ final Object[] bindings = new Object[] { serviceInterface, >+ remoteCall.getMethod(), >+ Arrays.asList(remoteCall.getParameters()), display }; >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ MessageDialog >+ .openInformation( >+ null, >+ "Received Response", >+ NLS >+ .bind( >+ "Service Interface:\n{0}\n\nMethod: {1}\nParameters: {2}\n\nResult: {3}", >+ bindings)); >+ } >+ }); >+ } >+} >Index: src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java >diff -N src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/Activator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ecf.internal.remoteservices.ui; >+ >+import org.eclipse.ecf.core.IContainerManager; >+import org.eclipse.ui.plugin.AbstractUIPlugin; >+import org.osgi.framework.BundleContext; >+import org.osgi.util.tracker.ServiceTracker; >+ >+public class Activator extends AbstractUIPlugin { >+ >+ private volatile ServiceTracker containerManagerTracker; >+ // The shared instance >+ private volatile static Activator plugin; >+ >+ /** >+ * The constructor >+ */ >+ public Activator() { >+ plugin = this; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) >+ */ >+ public void stop(BundleContext context) throws Exception { >+ plugin = null; >+ if(containerManagerTracker != null) { >+ containerManagerTracker.close(); >+ containerManagerTracker = null; >+ } >+ super.stop(context); >+ } >+ >+ /** >+ * Returns the shared instance >+ * >+ * @return the shared instance >+ */ >+ public static Activator getDefault() { >+ return plugin; >+ } >+ >+ public IContainerManager getContainerManager() { >+ BundleContext context = getBundle().getBundleContext(); >+ if (containerManagerTracker == null) { >+ containerManagerTracker = new ServiceTracker(context, IContainerManager.class.getName(), null); >+ containerManagerTracker.open(); >+ } >+ return (IContainerManager) containerManagerTracker.getService(); >+ } >+} >Index: src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServiceHandlerUtil.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServiceHandlerUtil.java >diff -N src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServiceHandlerUtil.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/remoteservices/ui/RemoteServiceHandlerUtil.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,107 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Versant Corp. >+ * 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: >+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ecf.internal.remoteservices.ui; >+ >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.ecf.core.ContainerCreateException; >+import org.eclipse.ecf.core.ContainerFactory; >+import org.eclipse.ecf.core.IContainer; >+import org.eclipse.ecf.core.IContainerManager; >+import org.eclipse.ecf.core.identity.ID; >+import org.eclipse.ecf.core.identity.IDCreateException; >+import org.eclipse.ecf.core.identity.IDFactory; >+import org.eclipse.ecf.discovery.IServiceInfo; >+import org.eclipse.ecf.discovery.ui.DiscoveryHandlerUtil; >+import org.eclipse.ecf.remoteservice.Constants; >+import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter; >+import org.eclipse.ecf.remoteservice.IRemoteServiceReference; >+import org.osgi.framework.InvalidSyntaxException; >+ >+public class RemoteServiceHandlerUtil { >+ >+ public static IRemoteServiceContainerAdapter getActiveIRemoteServiceContainerAdapterChecked(ExecutionEvent event) throws ExecutionException { >+ final ID activeConnectId = getActiveConnectIDChecked(event); >+ final IContainerManager containerManager = Activator.getDefault().getContainerManager(); >+ final IContainer container = containerManager.getContainer(activeConnectId); >+ final IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container.getAdapter(IRemoteServiceContainerAdapter.class); >+ return adapter; >+ } >+ >+ public static IRemoteServiceReference[] getActiveIRemoteServiceReferencesChecked(ExecutionEvent event) throws ExecutionException { >+ IServiceInfo serviceInfo = DiscoveryHandlerUtil.getActiveIServiceInfoChecked(event); >+ IRemoteServiceContainerAdapter adapter = getActiveIRemoteServiceContainerAdapterChecked(event); >+ try { >+ return getRemoteServiceReferencesForRemoteServiceAdapter(adapter, serviceInfo); >+ } catch (IDCreateException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } catch (InvalidSyntaxException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } >+ } >+ >+ public static ID getActiveConnectIDChecked(ExecutionEvent event) throws ExecutionException { >+ IServiceInfo serviceInfo = DiscoveryHandlerUtil.getActiveIServiceInfoChecked(event); >+ final String connectNamespace = getConnectNamespace(serviceInfo); >+ final String connectId = getConnectID(serviceInfo); >+ try { >+ return IDFactory.getDefault().createID(connectNamespace, connectId); >+ } catch (IDCreateException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } >+ } >+ >+ public static IContainer getActiveIRemoteServiceContainerChecked(ExecutionEvent event) throws ExecutionException { >+ final IServiceInfo serviceInfo = DiscoveryHandlerUtil.getActiveIServiceInfoChecked(event); >+ final ID createConnectId = getActiveConnectIDChecked(event); >+ //TODO remove parameters once https://bugs.eclipse.org/bugs/show_bug.cgi?id=256586 is fixed >+ final Object[] parameters = new Object[]{createConnectId}; >+ try { >+ return ContainerFactory.getDefault().createContainer(getContainerFactory(serviceInfo), parameters); >+ } catch (ContainerCreateException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } >+ } >+ >+ private static IRemoteServiceReference[] getRemoteServiceReferencesForRemoteServiceAdapter(IRemoteServiceContainerAdapter adapter, IServiceInfo serviceInfo) throws InvalidSyntaxException, IDCreateException { >+ ID serviceID = null; >+ String serviceNamespace = getServiceNamespace(serviceInfo); >+ String serviceid = getServiceID(serviceInfo); >+ if (serviceNamespace != null && serviceid != null) { >+ serviceID = IDFactory.getDefault().createID(serviceNamespace, serviceid); >+ } >+ ID[] targets = (serviceID == null) ? null : new ID[] {serviceID}; >+ return adapter.getRemoteServiceReferences(targets, getRemoteServiceClass(serviceInfo), getFilter(serviceInfo)); >+ } >+ >+ private static String getServiceNamespace(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_SERVICE_ID_NAMESPACE_PROPERTY); >+ } >+ private static String getServiceID(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_SERVICE_ID_PROPERTY); >+ } >+ private static String getRemoteServiceClass(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_OBJECTCLASS_PROPERTY); >+ } >+ private static String getFilter(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_FILTER_PROPERTY); >+ } >+ private static String getConnectNamespace(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_CONNECT_ID_NAMESPACE_PROPERTY); >+ } >+ private static String getConnectID(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_CONNECT_ID_PROPERTY); >+ } >+ private static String getContainerFactory(IServiceInfo serviceInfo) { >+ return serviceInfo.getServiceProperties().getPropertyString(Constants.DISCOVERY_CONTAINER_FACTORY_PROPERTY); >+ } >+} >Index: plugin.xml >=================================================================== >RCS file: plugin.xml >diff -N plugin.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?> >+<plugin> >+ <extension >+ point="org.eclipse.ui.commands"> >+ <command >+ defaultHandler="org.eclipse.ecf.internal.remoteservices.ui.handlers.ConnectRemoteServicehandler" >+ id="org.eclipse.ecf.remoteservices.ui.commands.connectCommand" >+ name="Connect Command"> >+ </command> >+ <command >+ defaultHandler="org.eclipse.ecf.internal.remoteservices.ui.handlers.ReflectiveRemoteServiceHandler" >+ id="org.eclipse.ecf.remoteservices.ui.commands.reflectiveMethodDialogHandler" >+ name="Reflective Method Invocation Command"> >+ <commandParameter >+ id="org.eclipse.ecf.remoteservices.ui.commands.reflectiveMethodDialogParameter" >+ name="name" >+ optional="true"> >+ </commandParameter> >+ </command> >+ </extension> >+ <extension >+ point="org.eclipse.ui.menus"> >+ <menuContribution >+ locationURI="popup:org.eclipse.ecf.discovery.ui.DiscoveryView?after=additions"> >+ <command >+ commandId="org.eclipse.ecf.remoteservices.ui.commands.connectCommand" >+ id="org.eclipse.ecf.remoteservices.ui.menus.connectCommand" >+ mnemonic="S"> >+ <visibleWhen> >+ <with >+ variable="activeMenuSelection"> >+ <iterate >+ ifEmpty="false" >+ operator="and"> >+ <test >+ args="remotesvcs" >+ property="org.eclipse.ecf.discovery.isServiceType" >+ value="true"> >+ </test> >+ <test >+ property="org.eclipse.ecf.remoteservices.isConnected" >+ value="false"> >+ </test> >+ </iterate> >+ </with> >+ </visibleWhen> >+ </command> >+ </menuContribution> >+ </extension> >+ >+ <extension >+ point="org.eclipse.core.expressions.propertyTesters"> >+ <propertyTester >+ class="org.eclipse.ecf.internal.remoteservices.ui.property.ConnectedTester" >+ id="org.eclipse.ecf.remoteservices.ui.property.ConnectedPropertyTester" >+ namespace="org.eclipse.ecf.remoteservices" >+ properties="isConnected" >+ type="org.eclipse.ecf.discovery.model.IServiceInfo"> >+ </propertyTester> >+ </extension> >+ >+</plugin> >#P org.eclipse.ecf.discovery.model >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.ecf/incubation/bundles/org.eclipse.ecf.discovery.model/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 5 Mar 2008 07:27:49 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Nov 2008 13:41:00 -0000 >@@ -2,15 +2,15 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ecf.discovery.model;singleton:=true >-Bundle-Version: 2.0.0.qualifier >+Bundle-Version: 3.0.0.qualifier > Bundle-ClassPath: . > Bundle-Vendor: %providerName > Bundle-Localization: plugin > Bundle-RequiredExecutionEnvironment: J2SE-1.5 >-Require-Bundle: org.eclipse.core.runtime, >- org.eclipse.emf.ecore;visibility:=reexport, >- org.eclipse.ecf.discovery, >- org.eclipse.ecf >+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", >+ org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)", >+ org.eclipse.ecf.discovery;bundle-version="2.0.0", >+ org.eclipse.ecf;bundle-version="2.0.0" > Eclipse-LazyStart: true > Export-Package: org.eclipse.ecf.discovery.model, > org.eclipse.ecf.discovery.model.impl,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 256603
:
118782
|
119599
|
119600