blob: 8af3de04f2b2d4d8fb22d37e0004e227e4e98488 [file] [log] [blame]
package org.eclipse.equinox.demo.file.association;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
/**
* This workbench advisor creates the window advisor, and specifies
* the perspective id for the initial window.
*/
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
private OpenDocumentEventProcessor openDocProcessor;
public ApplicationWorkbenchAdvisor(OpenDocumentEventProcessor openDocProcessor) {
this.openDocProcessor = openDocProcessor;
}
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
public String getInitialWindowPerspectiveId() {
return Perspective.ID;
}
/**
* Added to process SWT.OpenDocument events.
* Here we actually process the OpenDocument events.
*/
public void eventLoopIdle(Display display) {
openDocProcessor.openFiles();
super.eventLoopIdle(display);
}
}