use of org.eclipse.ui.intro.IIntroPart in project eclipse.platform.text by eclipse.
the class ZoomTest method setUp.
@Before
public void setUp() throws Exception {
IIntroPart intro = PlatformUI.getWorkbench().getIntroManager().getIntro();
if (intro != null) {
PlatformUI.getWorkbench().getIntroManager().closeIntro(intro);
}
IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName());
editor = (AbstractTextEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new FileEditorInput(file), desc.getId());
editor.setFocus();
text = (StyledText) editor.getAdapter(Control.class);
// make sure we start from a clean state
initialFontSize = text.getFont().getFontData()[0].getHeight();
}
use of org.eclipse.ui.intro.IIntroPart in project knime-core by knime.
the class NewProjectWizardIntroAction method run.
/**
* {@inheritDoc}
*/
@Override
public void run(final IIntroSite site, final Properties params) {
try {
// close the intro page
IIntroManager introManager = PlatformUI.getWorkbench().getIntroManager();
IIntroPart introPart = introManager.getIntro();
if (introPart != null) {
introManager.closeIntro(introPart);
}
if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length == 0) {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
// call static method on NewProjectWizard
AbstractExplorerFileStore workspaceRoot = null;
for (AbstractContentProvider cp : ExplorerMountTable.getMountedContent().values()) {
if (cp.getFileStore("/") instanceof LocalWorkspaceFileStore) {
workspaceRoot = cp.getFileStore("/");
break;
}
}
if (workspaceRoot == null) {
throw new IllegalArgumentException("Could not find workspace");
}
AbstractExplorerFileStore newWorkflow = workspaceRoot.getChild("KNIME_project");
NewWorkflowWizard.createNewWorkflow(newWorkflow, monitor);
} catch (CoreException ce) {
throw new InvocationTargetException(ce);
}
}
});
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations