Commit f44b76eb authored by Romain Bioteau's avatar Romain Bioteau

remove stack in welcomwe page

parent 93ca3a59
......@@ -4,11 +4,6 @@ import java.util.Properties;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.common.NotDefinedException;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
......@@ -18,31 +13,19 @@ import org.eclipse.ui.intro.config.IIntroAction;
public class OpenProcess implements IIntroAction {
public void run(IIntroSite site, Properties param) {
try {
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
IHandlerService handlerService = (IHandlerService) part.getSite().getService(IHandlerService.class);
ICommandService cmdService = (ICommandService)part.getSite().getService( ICommandService.class);
// Do not replace by static link since this command does not resolve to the same between BOS and SP
Command open = cmdService.getCommand("org.bonitasoft.studio.diagram.command.openDiagram");//$NON-NLS-1$
ExecutionEvent executionEvent = handlerService.createExecutionEvent(open, null);
try {
open.executeWithChecks(executionEvent);
} catch (ExecutionException e) {
BonitaStudioLog.error(e);
} catch (NotDefinedException e) {
BonitaStudioLog.error(e);
} catch (NotEnabledException e) {
BonitaStudioLog.error(e);
} catch (NotHandledException e) {
BonitaStudioLog.error(e);
}
} catch (Exception e) {
BonitaStudioLog.error(e);
}
}
public void run(IIntroSite site, Properties param) {
try {
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
IHandlerService handlerService = (IHandlerService) part.getSite().getService(IHandlerService.class);
ICommandService cmdService = (ICommandService) part.getSite().getService(ICommandService.class);
// Do not replace by static link since this command does not resolve to the same between BOS and SP
Command open = cmdService.getCommand("org.bonitasoft.studio.diagram.command.openDiagram");//$NON-NLS-1$
if (open.isEnabled()) {
open.executeWithChecks(handlerService.createExecutionEvent(open, null));
}
} catch (Exception e) {
BonitaStudioLog.error(e);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment