List of usage examples for org.eclipse.jface.dialogs MessageDialog create
@Override public void create()
From source file:org.libreoffice.ide.eclipse.core.internal.model.SDK.java
License:LGPL
/** * {@inheritDoc}//from www . j av a2 s . c o m */ @Override public Process runToolWithEnv(IProject pProject, IOOo pOOo, String pShellCommand, String[] pEnv, IProgressMonitor pMonitor) { Process process = null; try { if (null != pOOo) { // Get the environment variables and copy them. Needs Java 1.5 String[] sysEnv = SystemHelper.getSystemEnvironement(); String[] vars = mergeVariables(sysEnv, pEnv); vars = updateEnvironment(vars, pOOo); // Run only if the OS and ARCH are valid for the SDK if (null != vars) { File projectFile = pProject.getLocation().toFile(); process = SystemHelper.runTool(pShellCommand, vars, projectFile); } } } catch (IOException e) { // Error while launching the process MessageDialog dialog = new MessageDialog( OOEclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("SDK.PluginError"), //$NON-NLS-1$ null, Messages.getString("SDK.ProcessError"), //$NON-NLS-1$ MessageDialog.ERROR, new String[] { Messages.getString("SDK.Ok") }, 0); //$NON-NLS-1$ dialog.setBlockOnOpen(true); dialog.create(); dialog.open(); } catch (SecurityException e) { // SubProcess creation unauthorized MessageDialog dialog = new MessageDialog( OOEclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("SDK.PluginError"), //$NON-NLS-1$ null, Messages.getString("SDK.ProcessError"), //$NON-NLS-1$ MessageDialog.ERROR, new String[] { Messages.getString("SDK.Ok") }, 0); //$NON-NLS-1$ dialog.setBlockOnOpen(true); dialog.create(); dialog.open(); } catch (Exception e) { PluginLogger.error(e.getMessage(), null); } return process; }
From source file:org.openoffice.ide.eclipse.core.internal.model.SDK.java
License:LGPL
/** * {@inheritDoc}//from w w w . jav a 2 s. c om */ public Process runToolWithEnv(IProject pProject, IOOo pOOo, String pShellCommand, String[] pEnv, IProgressMonitor pMonitor) { Process process = null; try { if (null != pOOo) { // Get the environment variables and copy them. Needs Java 1.5 String[] sysEnv = SystemHelper.getSystemEnvironement(); String[] vars = mergeVariables(sysEnv, pEnv); vars = updateEnvironment(vars, pOOo); // Run only if the OS and ARCH are valid for the SDK if (null != vars) { File projectFile = pProject.getLocation().toFile(); process = SystemHelper.runTool(pShellCommand, vars, projectFile); } } } catch (IOException e) { // Error while launching the process MessageDialog dialog = new MessageDialog( OOEclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("SDK.PluginError"), //$NON-NLS-1$ null, Messages.getString("SDK.ProcessError"), //$NON-NLS-1$ MessageDialog.ERROR, new String[] { Messages.getString("SDK.Ok") }, 0); //$NON-NLS-1$ dialog.setBlockOnOpen(true); dialog.create(); dialog.open(); } catch (SecurityException e) { // SubProcess creation unauthorized MessageDialog dialog = new MessageDialog( OOEclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("SDK.PluginError"), //$NON-NLS-1$ null, Messages.getString("SDK.ProcessError"), //$NON-NLS-1$ MessageDialog.ERROR, new String[] { Messages.getString("SDK.Ok") }, 0); //$NON-NLS-1$ dialog.setBlockOnOpen(true); dialog.create(); dialog.open(); } catch (Exception e) { PluginLogger.error(e.getMessage(), null); } return process; }