|
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); |