public void run(IAction action) { super.run(); }
/** * Returns the configured selection. If no selection has been configured using {@link #setSelection(IStructuredSelection)}, * the currently selected element of the active workbench is returned. * @return the configured selection */ protected IStructuredSelection getSelection() { if (fSelection == null) { return evaluateCurrentSelection(); } return fSelection; }
@Override public void run() { Shell shell= getShell(); if (!doCreateProjectFirstOnEmptyWorkspace(shell)) { return; } try { INewWizard wizard= createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelection()); WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); dialog.create(); int res= dialog.open(); if (res == Window.OK && wizard instanceof NewElementWizard) { fCreatedElement= ((NewElementWizard)wizard).getCreatedElement(); } notifyResult(res == Window.OK); } catch (CoreException e) { String title= NewWizardMessages.AbstractOpenWizardAction_createerror_title; String message= NewWizardMessages.AbstractOpenWizardAction_createerror_message; ExceptionHandler.handle(e, shell, title, message); } }
protected Object createFolder(final IContainer container) { final Object[] result= new Object[1]; final CPListElement newElement= new CPListElement(fJavaProject, IClasspathEntry.CPE_SOURCE); final AddSourceFolderWizard wizard= newSourceFolderWizard(newElement, fExistingElements, fOutputLocation, container); AbstractOpenWizardAction action= new AbstractOpenWizardAction() { protected INewWizard createWizard() throws CoreException { return wizard; } }; action.addPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(IAction.RESULT)) { if (event.getNewValue().equals(Boolean.TRUE)) { result[0]= addFakeFolder(fJavaProject.getProject(), newElement); } else { wizard.cancel(); } } } }); action.run(); return result[0]; } };
public void run() { Shell shell= getShell(); if (!doCreateProjectFirstOnEmptyWorkspace(shell)) { return; } try { INewWizard wizard= createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelection()); WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); dialog.create(); int res= dialog.open(); if (res == Window.OK && wizard instanceof NewElementWizard) { fCreatedElement= ((NewElementWizard)wizard).getCreatedElement(); } notifyResult(res == Window.OK); } catch (CoreException e) { String title= NewWizardMessages.AbstractOpenWizardAction_createerror_title; String message= NewWizardMessages.AbstractOpenWizardAction_createerror_message; ExceptionHandler.handle(e, shell, title, message); } }
@Override protected Object createFolder(final IContainer container) { final Object[] result= new Object[1]; final CPListElement newElement= new CPListElement(fJavaProject, IClasspathEntry.CPE_SOURCE); final AddSourceFolderWizard wizard= newSourceFolderWizard(newElement, fExistingElements, fOutputLocation, container); AbstractOpenWizardAction action= new AbstractOpenWizardAction() { @Override protected INewWizard createWizard() throws CoreException { return wizard; } }; action.addPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(IAction.RESULT)) { if (event.getNewValue().equals(Boolean.TRUE)) { result[0]= addFakeFolder(fJavaProject.getProject(), newElement); } else { wizard.cancel(); } } } }); action.run(); return result[0]; } };
@Override public void run() { Shell shell= getShell(); if (!doCreateProjectFirstOnEmptyWorkspace(shell)) { return; } try { INewWizard wizard= createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelection()); WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); dialog.create(); int res= dialog.open(); if (res == Window.OK && wizard instanceof NewElementWizard) { fCreatedElement= ((NewElementWizard)wizard).getCreatedElement(); } notifyResult(res == Window.OK); } catch (CoreException e) { String title= NewWizardMessages.AbstractOpenWizardAction_createerror_title; String message= NewWizardMessages.AbstractOpenWizardAction_createerror_message; ExceptionHandler.handle(e, shell, title, message); } }
@Override protected Object createFolder(final IContainer container) { final Object[] result= new Object[1]; final CPListElement newElement= new CPListElement(fJavaProject, IClasspathEntry.CPE_SOURCE); final AddSourceFolderWizard wizard= newSourceFolderWizard(newElement, fExistingElements, fOutputLocation, container); AbstractOpenWizardAction action= new AbstractOpenWizardAction() { @Override protected INewWizard createWizard() throws CoreException { return wizard; } }; action.addPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(IAction.RESULT)) { if (event.getNewValue().equals(Boolean.TRUE)) { result[0]= addFakeFolder(fJavaProject.getProject(), newElement); } else { wizard.cancel(); } } } }); action.run(); return result[0]; } };
/** * Returns the configured selection. If no selection has been configured using {@link #setSelection(IStructuredSelection)}, * the currently selected element of the active workbench is returned. * @return the configured selection */ protected IStructuredSelection getSelection() { if (fSelection == null) { return evaluateCurrentSelection(); } return fSelection; }
/** * Returns the configured selection. If no selection has been configured using {@link #setSelection(IStructuredSelection)}, * the currently selected element of the active workbench is returned. * @return the configured selection */ protected IStructuredSelection getSelection() { if (fSelection == null) { return evaluateCurrentSelection(); } return fSelection; }