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 56431 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+43 lines)
Lines 37-47 Link Here
37
   <extension
37
   <extension
38
         point="org.eclipse.ui.views">
38
         point="org.eclipse.ui.views">
39
      <view
39
      <view
40
      		allowMultiple="true"
40
            name="Browser"
41
            name="Browser"
41
            icon="icons/sample.gif"
42
            icon="icons/sample.gif"
42
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
43
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
43
            id="org.eclipse.ui.examples.rcp.browser.browserView">
44
            id="org.eclipse.ui.examples.rcp.browser.browserView">
44
      </view>
45
      </view>
46
      <view
47
      		allowMultiple="true"
48
            name="Browser Unknown"
49
            icon="icons/sample.gif"
50
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
51
            id="org.eclipse.ui.examples.rcp.browser.browserUnknown">
52
      </view>
53
      <view
54
      		name="Browser Exact"
55
            icon="icons/sample.gif"
56
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
57
            id="org.eclipse.ui.examples.rcp.browser.browserExact">
58
      </view>
59
      <view
60
      		allowMultiple="true"
61
            name="Browser Exact"
62
            icon="icons/sample.gif"
63
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
64
            id="org.eclipse.ui.examples.rcp.browser.browserExact.Match">
65
      </view>
66
      <view
67
      		allowMultiple="true"
68
            name="Browser Partial"
69
            icon="icons/sample.gif"
70
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
71
            id="org.eclipse.ui.examples.rcp.browser.browserPartial">
72
      </view>
73
      <view
74
      		allowMultiple="true"
75
            name="Browser Partial"
76
            icon="icons/sample.gif"
77
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
78
            id="org.eclipse.ui.examples.rcp.browser.browserPartial.Match">
79
      </view>
80
      <view
81
      		allowMultiple="true"
82
            name="Browser Partial"
83
            icon="icons/sample.gif"
84
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
85
            id="org.eclipse.ui.examples.rcp.browser.browserPartial.X">
86
      </view>
87
      
45
   </extension>
88
   </extension>
46
89
47
</plugin>
90
</plugin>
(-)src/org/eclipse/ui/examples/rcp/browser/BrowserActionBuilder.java (-2 / +117 lines)
Lines 25-30 Link Here
25
import org.eclipse.jface.dialogs.MessageDialog;
25
import org.eclipse.jface.dialogs.MessageDialog;
26
26
27
import org.eclipse.ui.ISharedImages;
27
import org.eclipse.ui.ISharedImages;
28
import org.eclipse.ui.IWorkbenchPage;
28
import org.eclipse.ui.IWorkbenchWindow;
29
import org.eclipse.ui.IWorkbenchWindow;
29
import org.eclipse.ui.actions.ActionFactory;
30
import org.eclipse.ui.actions.ActionFactory;
30
import org.eclipse.ui.actions.RetargetAction;
31
import org.eclipse.ui.actions.RetargetAction;
Lines 47-53 Link Here
47
public class BrowserActionBuilder {
48
public class BrowserActionBuilder {
48
49
49
	private IWorkbenchWindow window;
50
	private IWorkbenchWindow window;
50
	private IAction newWindowAction, quitAction, aboutAction;
51
	private IAction newWindowAction, quitAction, aboutAction, showSingleUnknownAction;
52
	private IAction showViewActions[] = new IAction[8];
51
	private RetargetAction backAction, forwardAction, stopAction, refreshAction;
53
	private RetargetAction backAction, forwardAction, stopAction, refreshAction;
52
54
53
	public BrowserActionBuilder(IWorkbenchWindow window) {
55
	public BrowserActionBuilder(IWorkbenchWindow window) {
Lines 102-109 Link Here
102
					"(c) 2003,2004 IBM Corporation and others.");
104
					"(c) 2003,2004 IBM Corporation and others.");
103
			}
105
			}
104
		};
106
		};
107
		
108
		// all mighty wild card (*)
109
		showViewActions[0] = new Action() {
110
			{ setText("no placeholder for xxx - (*)"); }
111
			public void run() {
112
				try {
113
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserUnknown");
114
				}
115
				catch (Exception e) {
116
					e.printStackTrace();
117
				}
118
			}
119
		};
120
		showViewActions[1] = new Action() {
121
			{ setText("no placeholder for xxx:xxx - (*)"); }
122
			public void run() {
123
				try {
124
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserUnknown",
125
							BrowserApp.PLUGIN_ID + ".browserUnknown", IWorkbenchPage.VIEW_ACTIVATE);
126
				}
127
				catch (Exception e) {
128
					e.printStackTrace();
129
				}
130
			}
131
		};
132
		
133
		// exact match (xxx)
134
		showViewActions[2] = new Action() {
135
			{ setText("exact match (xxx)"); }
136
			public void run() {
137
				try {
138
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserExact.Match");
139
				}
140
				catch (Exception e) {
141
					e.printStackTrace();
142
				}
143
			}
144
		};
145
		
146
		// exact match multi (xxx:xxx)
147
		showViewActions[3] = new Action() {
148
			{ setText("exact match multi (xxx:xxx)"); }
149
			public void run() {
150
				try {
151
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserExact.Match",
152
							"Exact.Match", IWorkbenchPage.VIEW_ACTIVATE);
153
				}
154
				catch (Exception e) {
155
					e.printStackTrace();
156
				}
157
			}
158
		};
159
				
160
		// partial match (xxx.*)
161
		showViewActions[4] = new Action() {
162
			{ setText("partial match (xxx.*)"); }
163
			public void run() {
164
				try {
165
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserPartial.X");
166
				}
167
				catch (Exception e) {
168
					e.printStackTrace();
169
				}
170
			}
171
		};
172
		
173
		// partial match multi (xxx.*:xxx)
174
		showViewActions[5] = new Action() {
175
			{ setText("partial match multi (xxx.*:xxx)"); }
176
			public void run() {
177
				try {
178
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserPartial.X",
179
							"Partial.Match", IWorkbenchPage.VIEW_ACTIVATE);
180
				}
181
				catch (Exception e) {
182
					e.printStackTrace();
183
				}
184
			}
185
		};
186
		
187
		// partial match multi (xxx:xxx.*)
188
		showViewActions[6] = new Action() {
189
			{ setText("partial match multi (xxx:xxx.*)"); }
190
			public void run() {
191
				try {
192
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserPartial.Match",
193
							"Partial.X", IWorkbenchPage.VIEW_ACTIVATE);
194
				}
195
				catch (Exception e) {
196
					e.printStackTrace();
197
				}
198
			}
199
		};
200
		
201
		// partial match multi (xxx.*:xxx.*)
202
		showViewActions[7] = new Action() {
203
			{ setText("partial match multi (xxx.*:xxx.*)"); }
204
			public void run() {
205
				try {
206
					window.getActivePage().showView(BrowserApp.PLUGIN_ID + ".browserPartial.X",
207
							"Partial.X", IWorkbenchPage.VIEW_ACTIVATE);
208
				}
209
				catch (Exception e) {
210
					e.printStackTrace();
211
				}
212
			}
213
		};
105
	}
214
	}
106
215
	
107
	public void fillMenuBar(IMenuManager menuBar) {
216
	public void fillMenuBar(IMenuManager menuBar) {
108
		IMenuManager fileMenu = new MenuManager("&File", "file");  //$NON-NLS-2$
217
		IMenuManager fileMenu = new MenuManager("&File", "file");  //$NON-NLS-2$
109
		menuBar.add(fileMenu);
218
		menuBar.add(fileMenu);
Lines 117-122 Link Here
117
		viewMenu.add(forwardAction);
226
		viewMenu.add(forwardAction);
118
		viewMenu.add(stopAction);
227
		viewMenu.add(stopAction);
119
		viewMenu.add(refreshAction);
228
		viewMenu.add(refreshAction);
229
		
230
		IMenuManager showMenu = new MenuManager("&Show", "show");  //$NON-NLS-2$
231
		menuBar.add(showMenu);
232
		for (int i=0; i<showViewActions.length; i++) {
233
			showMenu.add(showViewActions[i]);
234
		}
120
235
121
		IMenuManager helpMenu = new MenuManager("&Help", "help");  //$NON-NLS-2$
236
		IMenuManager helpMenu = new MenuManager("&Help", "help");  //$NON-NLS-2$
122
		menuBar.add(helpMenu);
237
		menuBar.add(helpMenu);
(-)src/org/eclipse/ui/examples/rcp/browser/BrowserPerspectiveFactory.java (-1 / +29 lines)
Lines 23-30 Link Here
23
	 * of the perspective to have a single Browser view and no editor area.
23
	 * of the perspective to have a single Browser view and no editor area.
24
	 */
24
	 */
25
	public void createInitialLayout(IPageLayout layout) {
25
	public void createInitialLayout(IPageLayout layout) {
26
		layout.addView(BrowserApp.PLUGIN_ID + ".browserView", IPageLayout.TOP, 1.0f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
26
		layout.addView(BrowserApp.PLUGIN_ID + ".browserView", IPageLayout.RIGHT, .5f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
27
		layout.setEditorAreaVisible(false);
27
		layout.setEditorAreaVisible(false);
28
		
29
		// all mighty wild card (*)
30
		layout.addPlaceholder("*", 
31
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
32
		
33
		// exact match (xxx)
34
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserExact.Match", 
35
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
36
		
37
		// exact match multi (xxx:xxx)
38
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserExact.Match:Exact.Match", 
39
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
40
		
41
		// partial match (xxx.*)
42
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserPartial.*", 
43
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
44
		
45
		// partial match multi (xxx.*:xxx)
46
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserPartial.*:Partial.Match", 
47
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
48
		
49
		// partial match multi (xxx:xxx.*)
50
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserPartial.Match:Partial.*", 
51
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
52
		
53
		// partial match multi (xxx.*:xxx.*)
54
		layout.addPlaceholder(BrowserApp.PLUGIN_ID + ".browserPartial.*:Partial.*", 
55
				IPageLayout.LEFT, .5f, BrowserApp.PLUGIN_ID + ".browserView");
28
	}
56
	}
29
57
30
}
58
}

Return to bug 56431