Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 228022 | Differences between
and this patch

Collapse All | Expand All

(-)schema/navigatorContent.exsd (+10 lines)
Lines 134-139 Link Here
134
               </restriction>
134
               </restriction>
135
            </simpleType>
135
            </simpleType>
136
         </attribute>
136
         </attribute>
137
         <attribute name="appearsBefore" type="string">
138
            <annotation>
139
               <documentation>
140
                  Specifies the ID of the navigator content that this navigator content appears before.  This navigator content will be processed before the specified navigator content is processed.
141
               </documentation>
142
               <appInfo>
143
                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.navigator.navigatorContent/@id"/>
144
               </appInfo>
145
            </annotation>
146
         </attribute>
137
         <attribute name="contentProvider" type="string">
147
         <attribute name="contentProvider" type="string">
138
            <annotation>
148
            <annotation>
139
               <documentation>
149
               <documentation>
(-)src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentDescriptor.java (+13 lines)
Lines 63-68 Link Here
63
63
64
	private int priority = Priority.NORMAL_PRIORITY_VALUE;
64
	private int priority = Priority.NORMAL_PRIORITY_VALUE;
65
65
66
	private String appearsBeforeId;
67
66
	private Expression enablement;
68
	private Expression enablement;
67
69
68
	private Expression possibleChildren;
70
	private Expression possibleChildren;
Lines 135-140 Link Here
135
	}
137
	}
136
138
137
	/**
139
	/**
140
     * FIXME this should be exposed through the API, but it went in after the API freeze.
141
	 * 
142
	 * @return The value specified by the <i>appearsBefore</i> attribute of the
143
	 *         &lt;navigatorContent/&gt; element.
144
	 */
145
	public String getAppearsBeforeId() {
146
		return appearsBeforeId;
147
	}
148
	
149
	/**
138
	 * Parses the configuration element.
150
	 * Parses the configuration element.
139
	 * 
151
	 * 
140
	 * @throws WorkbenchException
152
	 * @throws WorkbenchException
Lines 163-168 Link Here
163
		providesSaveables = (providesSaveablesString != null && providesSaveablesString
175
		providesSaveables = (providesSaveablesString != null && providesSaveablesString
164
				.length() > 0) ? Boolean.valueOf(providesSaveablesString)
176
				.length() > 0) ? Boolean.valueOf(providesSaveablesString)
165
						.booleanValue() : false;
177
						.booleanValue() : false;
178
		appearsBeforeId = configElement.getAttribute(ATT_APPEARS_BEFORE);
166
179
167
		if (priorityString != null) {
180
		if (priorityString != null) {
168
			try {
181
			try {
(-)src/org/eclipse/ui/tests/navigator/extension/TestSimpleChildrenContentProvider.java (+77 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Oakland Software Incorporated and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Francis Upton IV, Oakland Software - initial API and implementation
10
 ******************************************************************************/
11
package org.eclipse.ui.tests.navigator.extension;
12
13
import java.util.ArrayList;
14
import java.util.List;
15
16
import org.eclipse.core.resources.IResource;
17
import org.eclipse.jface.viewers.ITreeContentProvider;
18
import org.eclipse.jface.viewers.Viewer;
19
20
/**
21
 * Provides some children for a given resource.
22
 */
23
public class TestSimpleChildrenContentProvider implements ITreeContentProvider {
24
25
	public String _name;
26
27
	private Object[] _children;
28
29
	public class SimpleChild {
30
		public String _name;
31
		public IResource _parent;
32
33
		public String toString() {
34
			return _name;
35
		}
36
	}
37
38
	public TestSimpleChildrenContentProvider() {
39
	}
40
41
	public Object[] getElements(Object inputElement) {
42
		return getChildren(inputElement);
43
	}
44
45
	public Object[] getChildren(Object parentElement) {
46
		if (parentElement instanceof IResource) {
47
			if (_children == null) {
48
				List l = new ArrayList();
49
				for (int i = 0; i < 4; i++) {
50
					SimpleChild child = new SimpleChild();
51
					child._parent = (IResource) parentElement;
52
					child._name = _name + i;
53
					l.add(child);
54
				}
55
				_children = l.toArray();
56
			}
57
			return _children;
58
		}
59
		throw new RuntimeException("Can only be called as a child of a resource");
60
	}
61
62
	public Object getParent(Object element) {
63
		SimpleChild child = (SimpleChild) element;
64
		return child._parent;
65
	}
66
67
	public boolean hasChildren(Object element) {
68
		return true;
69
	}
70
71
	public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
72
		_children = null;
73
	}
74
75
	public void dispose() {
76
	}
77
}
(-)src/org/eclipse/ui/tests/navigator/extension/TestSimpleChildrenContentProvider1.java (+9 lines)
Added Link Here
1
package org.eclipse.ui.tests.navigator.extension;
2
3
public class TestSimpleChildrenContentProvider1 extends TestSimpleChildrenContentProvider {
4
5
	public TestSimpleChildrenContentProvider1() {
6
		_name = "1";
7
	}
8
9
}
(-)src/org/eclipse/ui/tests/navigator/extension/TestSimpleChildrenContentProvider2.java (+9 lines)
Added Link Here
1
package org.eclipse.ui.tests.navigator.extension;
2
3
public class TestSimpleChildrenContentProvider2 extends TestSimpleChildrenContentProvider {
4
5
	public TestSimpleChildrenContentProvider2() {
6
		_name = "2";
7
	}
8
9
}
(-)src/org/eclipse/ui/tests/navigator/extension/TestSimpleChildrenContentProvider3.java (+9 lines)
Added Link Here
1
package org.eclipse.ui.tests.navigator.extension;
2
3
public class TestSimpleChildrenContentProvider3 extends TestSimpleChildrenContentProvider {
4
5
	public TestSimpleChildrenContentProvider3() {
6
		_name = "3";
7
	}
8
9
}

Return to bug 228022