Lines 16-22
Link Here
|
16 |
import java.util.Iterator; |
16 |
import java.util.Iterator; |
17 |
import java.util.Map; |
17 |
import java.util.Map; |
18 |
import java.util.TreeMap; |
18 |
import java.util.TreeMap; |
19 |
|
19 |
import org.eclipse.core.filesystem.EFS; |
20 |
import org.eclipse.core.net.proxy.IProxyService; |
20 |
import org.eclipse.core.net.proxy.IProxyService; |
21 |
import org.eclipse.core.resources.IContainer; |
21 |
import org.eclipse.core.resources.IContainer; |
22 |
import org.eclipse.core.resources.IResource; |
22 |
import org.eclipse.core.resources.IResource; |
Lines 27-32
Link Here
|
27 |
import org.eclipse.core.runtime.IAdaptable; |
27 |
import org.eclipse.core.runtime.IAdaptable; |
28 |
import org.eclipse.core.runtime.IBundleGroup; |
28 |
import org.eclipse.core.runtime.IBundleGroup; |
29 |
import org.eclipse.core.runtime.IBundleGroupProvider; |
29 |
import org.eclipse.core.runtime.IBundleGroupProvider; |
|
|
30 |
import org.eclipse.core.runtime.IPath; |
30 |
import org.eclipse.core.runtime.IProgressMonitor; |
31 |
import org.eclipse.core.runtime.IProgressMonitor; |
31 |
import org.eclipse.core.runtime.IStatus; |
32 |
import org.eclipse.core.runtime.IStatus; |
32 |
import org.eclipse.core.runtime.MultiStatus; |
33 |
import org.eclipse.core.runtime.MultiStatus; |
Lines 46-51
Link Here
|
46 |
import org.eclipse.swt.SWT; |
47 |
import org.eclipse.swt.SWT; |
47 |
import org.eclipse.swt.widgets.Display; |
48 |
import org.eclipse.swt.widgets.Display; |
48 |
import org.eclipse.swt.widgets.Listener; |
49 |
import org.eclipse.swt.widgets.Listener; |
|
|
50 |
import org.eclipse.ui.IWorkbenchPage; |
51 |
import org.eclipse.ui.IWorkbenchWindow; |
52 |
import org.eclipse.ui.PartInitException; |
49 |
import org.eclipse.ui.PlatformUI; |
53 |
import org.eclipse.ui.PlatformUI; |
50 |
import org.eclipse.ui.application.IWorkbenchConfigurer; |
54 |
import org.eclipse.ui.application.IWorkbenchConfigurer; |
51 |
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; |
55 |
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; |
Lines 128-134
Link Here
|
128 |
private IDEIdleHelper idleHelper; |
132 |
private IDEIdleHelper idleHelper; |
129 |
|
133 |
|
130 |
private Listener settingsChangeListener; |
134 |
private Listener settingsChangeListener; |
131 |
|
135 |
|
132 |
/** |
136 |
/** |
133 |
* Support class for monitoring workspace changes and periodically |
137 |
* Support class for monitoring workspace changes and periodically |
134 |
* validating the undo history |
138 |
* validating the undo history |
Lines 140-145
Link Here
|
140 |
*/ |
144 |
*/ |
141 |
private AbstractStatusHandler ideWorkbenchErrorHandler; |
145 |
private AbstractStatusHandler ideWorkbenchErrorHandler; |
142 |
|
146 |
|
|
|
147 |
static IDEWorkbenchAdvisor getInstance() { |
148 |
return workbenchAdvisor; |
149 |
} |
150 |
|
143 |
/** |
151 |
/** |
144 |
* Creates a new workbench advisor instance. |
152 |
* Creates a new workbench advisor instance. |
145 |
*/ |
153 |
*/ |
Lines 159-165
Link Here
|
159 |
public void initialize(IWorkbenchConfigurer configurer) { |
167 |
public void initialize(IWorkbenchConfigurer configurer) { |
160 |
|
168 |
|
161 |
PluginActionBuilder.setAllowIdeLogging(true); |
169 |
PluginActionBuilder.setAllowIdeLogging(true); |
162 |
|
170 |
|
163 |
// make sure we always save and restore workspace state |
171 |
// make sure we always save and restore workspace state |
164 |
configurer.setSaveAndRestore(true); |
172 |
configurer.setSaveAndRestore(true); |
165 |
|
173 |
|
Lines 194-200
Link Here
|
194 |
|
202 |
|
195 |
// initialize idle handler |
203 |
// initialize idle handler |
196 |
idleHelper = new IDEIdleHelper(configurer); |
204 |
idleHelper = new IDEIdleHelper(configurer); |
197 |
|
205 |
|
198 |
// initialize the workspace undo monitor |
206 |
// initialize the workspace undo monitor |
199 |
workspaceUndoMonitor = WorkspaceUndoMonitor.getInstance(); |
207 |
workspaceUndoMonitor = WorkspaceUndoMonitor.getInstance(); |
200 |
|
208 |
|
Lines 242-253
Link Here
|
242 |
initializeSettingsChangeListener(); |
250 |
initializeSettingsChangeListener(); |
243 |
Display.getCurrent().addListener(SWT.Settings, |
251 |
Display.getCurrent().addListener(SWT.Settings, |
244 |
settingsChangeListener); |
252 |
settingsChangeListener); |
|
|
253 |
runStartupCommand(Platform.getCommandLineArgs()); |
245 |
} finally {// Resume background jobs after we startup |
254 |
} finally {// Resume background jobs after we startup |
246 |
Job.getJobManager().resume(); |
255 |
Job.getJobManager().resume(); |
247 |
} |
256 |
} |
248 |
} |
257 |
} |
249 |
|
258 |
|
250 |
/** |
259 |
/** |
|
|
260 |
* Runs a command specified on the command line, if any |
261 |
*/ |
262 |
boolean runStartupCommand(String[] arguments) { |
263 |
if (arguments.length == 0) |
264 |
return false; |
265 |
// if the last command line argument is a file, open that file in an |
266 |
// editor |
267 |
final IPath path = new Path(arguments[arguments.length - 1]); |
268 |
if (!path.toFile().exists()) |
269 |
return false; |
270 |
IWorkbenchWindow window = PlatformUI.getWorkbench() |
271 |
.getActiveWorkbenchWindow(); |
272 |
if (window == null) { |
273 |
IWorkbenchWindow[] windows = PlatformUI.getWorkbench() |
274 |
.getWorkbenchWindows(); |
275 |
if (windows.length > 0) |
276 |
window = windows[0]; |
277 |
} |
278 |
if (window == null) |
279 |
return false; |
280 |
final IWorkbenchPage page = window.getActivePage(); |
281 |
if (page == null) |
282 |
return false; |
283 |
window.getShell().getDisplay().syncExec(new Runnable() { |
284 |
public void run() { |
285 |
try { |
286 |
IDE.openEditorOnFileStore(page, EFS.getLocalFileSystem() |
287 |
.getStore(path)); |
288 |
} catch (PartInitException e) { |
289 |
IDEWorkbenchPlugin.log( |
290 |
"Error opening editor on path: " + path, e); //$NON-NLS-1$ |
291 |
} |
292 |
} |
293 |
}); |
294 |
return true; |
295 |
} |
296 |
|
297 |
/** |
251 |
* Activate the proxy service by obtaining it. |
298 |
* Activate the proxy service by obtaining it. |
252 |
*/ |
299 |
*/ |
253 |
private void activateProxyService() { |
300 |
private void activateProxyService() { |
Lines 260-266
Link Here
|
260 |
} |
307 |
} |
261 |
if (proxyService == null) { |
308 |
if (proxyService == null) { |
262 |
IDEWorkbenchPlugin.log("Proxy service could not be found."); //$NON-NLS-1$ |
309 |
IDEWorkbenchPlugin.log("Proxy service could not be found."); //$NON-NLS-1$ |
263 |
} |
310 |
} |
264 |
} |
311 |
} |
265 |
|
312 |
|
266 |
/** |
313 |
/** |
Lines 697-703
Link Here
|
697 |
declareWorkbenchImage(ideBundle, |
744 |
declareWorkbenchImage(ideBundle, |
698 |
IDEInternalWorkbenchImages.IMG_ETOOL_PROBLEM_CATEGORY, |
745 |
IDEInternalWorkbenchImages.IMG_ETOOL_PROBLEM_CATEGORY, |
699 |
PATH_ETOOL + "problem_category.gif", true); //$NON-NLS-1$ |
746 |
PATH_ETOOL + "problem_category.gif", true); //$NON-NLS-1$ |
700 |
|
747 |
|
701 |
// synchronization indicator objects |
748 |
// synchronization indicator objects |
702 |
// declareRegistryImage(IDEInternalWorkbenchImages.IMG_OBJS_WBET_STAT, |
749 |
// declareRegistryImage(IDEInternalWorkbenchImages.IMG_OBJS_WBET_STAT, |
703 |
// PATH_OVERLAY+"wbet_stat.gif"); |
750 |
// PATH_OVERLAY+"wbet_stat.gif"); |