eclipse plugin: Add the ErrorLog view

and also log any exceptions encountered in the product running time
rather than silently ignore them
This commit is contained in:
Timotei Dolean 2011-04-28 17:01:43 +00:00
parent 621446bd93
commit 7809db1e7a
2 changed files with 11 additions and 2 deletions

View file

@ -13,20 +13,27 @@ import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.wesnoth.Logger;
public class Application implements IApplication
{
@Override
public Object start(IApplicationContext context) throws Exception
public Object start(IApplicationContext context)
{
Display display = PlatformUI.createDisplay();
Logger.getInstance().startLogger();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
}
catch(Exception e){
Logger.getInstance().logException(e);
return IApplication.EXIT_OK;
}
finally {
display.dispose();
}
}
@ -36,6 +43,7 @@ public class Application implements IApplication
{
if (!PlatformUI.isWorkbenchRunning())
return;
final IWorkbench workbench = PlatformUI.getWorkbench();
final Display display = workbench.getDisplay();
display.syncExec(new Runnable() {

View file

@ -41,6 +41,7 @@ public class WMLPerspective implements IPerspectiveFactory
bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
bottom.addView(IPageLayout.ID_PROGRESS_VIEW);
bottom.addView(IConsoleConstants.ID_CONSOLE_VIEW);
bottom.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, 0.68f, editorArea); //$NON-NLS-1$
right.addView(IPageLayout.ID_OUTLINE);