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 111615 Details for
Bug 217759
Any chance of an IWorkbenchAdapter ;-)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for changes
patch.txt (text/plain), 6.68 KB, created by
Doug
on 2008-09-03 15:00:39 EDT
(
hide
)
Description:
Patch for changes
Filename:
MIME Type:
Creator:
Doug
Created:
2008-09-03 15:00:39 EDT
Size:
6.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.sse.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.ui/plugin.xml,v >retrieving revision 1.56 >diff -u -r1.56 plugin.xml >--- plugin.xml 9 Aug 2008 19:17:14 -0000 1.56 >+++ plugin.xml 3 Sep 2008 18:49:27 -0000 >@@ -793,5 +793,13 @@ > </colorDefinition> > </extension> > >+ <extension point="org.eclipse.core.runtime.adapters"> >+ <factory >+ class="org.eclipse.wst.sse.ui.internal.NodeNotifierWorkbenchAdapterFactory" >+ adaptableType="org.eclipse.wst.sse.core.internal.provisional.INodeNotifier"> >+ <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/> >+ </factory> >+ </extension> >+ > </plugin> > >Index: src/org/eclipse/wst/sse/ui/NodeListWorkbenchAdapter.java >=================================================================== >RCS file: src/org/eclipse/wst/sse/ui/NodeListWorkbenchAdapter.java >diff -N src/org/eclipse/wst/sse/ui/NodeListWorkbenchAdapter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/sse/ui/NodeListWorkbenchAdapter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,51 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk >+ * 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: >+ * Doug Satchwell (Chase Technology Ltd) - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.wst.sse.ui; >+ >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.ui.model.IWorkbenchAdapter; >+import org.w3c.dom.Node; >+import org.w3c.dom.NodeList; >+ >+public class NodeListWorkbenchAdapter implements IWorkbenchAdapter >+{ >+ private final NodeList nodeList; >+ >+ public NodeListWorkbenchAdapter(NodeList nodeList) >+ { >+ this.nodeList = nodeList; >+ } >+ >+ public Object[] getChildren(Object o) >+ { >+ Node[] nodes = new Node[nodeList.getLength()]; >+ for (int i=0;i<nodes.length;i++) >+ { >+ nodes[i] = nodeList.item(i); >+ } >+ return nodes; >+ } >+ >+ public ImageDescriptor getImageDescriptor(Object object) >+ { >+ return null; >+ } >+ >+ public String getLabel(Object o) >+ { >+ return null; >+ } >+ >+ public Object getParent(Object o) >+ { >+ return null; >+ } >+} >Index: src/org/eclipse/wst/sse/ui/internal/NodeNotifierWorkbenchAdapterFactory.java >=================================================================== >RCS file: src/org/eclipse/wst/sse/ui/internal/NodeNotifierWorkbenchAdapterFactory.java >diff -N src/org/eclipse/wst/sse/ui/internal/NodeNotifierWorkbenchAdapterFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/sse/ui/internal/NodeNotifierWorkbenchAdapterFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,72 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk >+ * 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: >+ * Doug Satchwell (Chase Technology Ltd) - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.wst.sse.ui.internal; >+ >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.ui.model.IWorkbenchAdapter; >+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter; >+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; >+import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter; >+ >+public class NodeNotifierWorkbenchAdapterFactory implements IAdapterFactory >+{ >+ private static final Class[] LIST = new Class[]{IWorkbenchAdapter.class}; >+ private final IWorkbenchAdapter adapter = new IWorkbenchAdapter(){ >+ >+ protected IJFaceNodeAdapter getJFaceNodeAdapter(Object adaptable) >+ { >+ if (adaptable instanceof INodeNotifier) >+ { >+ INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class); >+ if (adapter instanceof IJFaceNodeAdapter) >+ return (IJFaceNodeAdapter) adapter; >+ } >+ return null; >+ } >+ >+ public Object[] getChildren(Object o) >+ { >+ IJFaceNodeAdapter adapter = getJFaceNodeAdapter(o); >+ if (adapter != null) >+ return adapter.getChildren(o); >+ return new Object[0]; >+ } >+ >+ public ImageDescriptor getImageDescriptor(Object object) >+ { >+ return ImageDescriptor.createFromImage(getJFaceNodeAdapter(object).getLabelImage(object)); >+ } >+ >+ public String getLabel(Object o) >+ { >+ return getJFaceNodeAdapter(o).getLabelText(o); >+ } >+ >+ public Object getParent(Object o) >+ { >+ IJFaceNodeAdapter adapter = getJFaceNodeAdapter(o); >+ if (adapter != null) >+ return adapter.getParent(o); >+ return null; >+ } >+ }; >+ >+ public Object getAdapter(Object adaptableObject, Class adapterType) >+ { >+ return adapter; >+ } >+ >+ public Class[] getAdapterList() >+ { >+ return LIST; >+ } >+} >#P org.eclipse.wst.sse.core >Index: src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractNotifier.java >--- src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java 3 Sep 2007 07:23:54 -0000 1.4 >+++ src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java 3 Sep 2008 18:49:29 -0000 >@@ -17,6 +17,7 @@ > import java.util.Collections; > > import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.PlatformObject; > import org.eclipse.wst.sse.core.internal.Logger; > import org.eclipse.wst.sse.core.internal.model.FactoryRegistry; > >@@ -29,7 +30,7 @@ > * > * Implementers of this INodeNotifier must subclass this class. > */ >-public abstract class AbstractNotifier implements INodeNotifier { >+public abstract class AbstractNotifier extends PlatformObject implements INodeNotifier { > private final static int growthConstant = 3; > private int adapterCount = 0; >
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 217759
: 111615