private void createButtonComposite(Composite parent) { Composite buttonComposite= new Composite(parent, SWT.NONE); buttonComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); GridLayout gl= new GridLayout(); gl.marginHeight= 0; gl.marginWidth= 0; buttonComposite.setLayout(gl); createAddButton(buttonComposite); fRemoveButton= createRemoveButton(buttonComposite); updateButtonsEnabledState(); }
public ChangeExceptionsControl(Composite parent, int style, IExceptionListChangeListener listener, IJavaProject project) { super(parent, style); Assert.isNotNull(listener); fListener= listener; Assert.isNotNull(project); fProject= project; GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginWidth= 0; layout.marginHeight= 0; setLayout(layout); createExceptionList(this); createButtonComposite(this); }
private int getTableSelectionCount() { return getTable().getSelectionCount(); }
private void doAddException() { IType newException= chooseException(); if (newException == null) return; ExceptionInfo info= findExceptionInfo(newException); if (info != null) { if (info.isDeleted()) { info.markAsOld(); fTableViewer.refresh(); } fListener.exceptionListChanged(); fTableViewer.getControl().setFocus(); fTableViewer.setSelection(new StructuredSelection(info), true); return; } info= ExceptionInfo.createInfoForAddedException(newException); fExceptionInfos.add(info); fListener.exceptionListChanged(); fTableViewer.refresh(); fTableViewer.getControl().setFocus(); int row= getTableItemCount() - 1; getTable().setSelection(row); updateButtonsEnabledState(); }
private Control createExceptionsTableControl(Composite parent) { Composite border= new Composite(parent, SWT.NONE); border.setLayout(new GridLayout()); ChangeExceptionsControl cp= new ChangeExceptionsControl(border, SWT.NONE, new IExceptionListChangeListener() { public void exceptionListChanged() { update(true); } }, getChangeMethodSignatureRefactoring().getMethod().getJavaProject()); cp.setLayoutData(new GridData(GridData.FILL_BOTH)); cp.setInput(getChangeMethodSignatureRefactoring().getExceptionInfos()); return border; }
private IType chooseException() { IJavaElement[] elements= new IJavaElement[] { fProject.getJavaProject() }; final IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false, PlatformUI.getWorkbench().getProgressService(), scope, IJavaSearchConstants.CLASS); dialog.setTitle(RefactoringMessages.ChangeExceptionsControl_choose_title); dialog.setMessage(RefactoringMessages.ChangeExceptionsControl_choose_message); dialog.setInitialPattern("*Exception*"); //$NON-NLS-1$ dialog.setValidator(new ISelectionStatusValidator() { @Override public IStatus validate(Object[] selection) { if (selection.length == 0) return new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$ try { return checkException((IType)selection[0]); } catch (JavaModelException e) { JavaPlugin.log(e); return StatusInfo.OK_STATUS; } } }); if (dialog.open() == Window.OK) { return (IType) dialog.getFirstResult(); } return null; }
private void doAddException() { IType newException= chooseException(); if (newException == null) return; ExceptionInfo info= findExceptionInfo(newException); if (info != null) { if (info.isDeleted()) { info.markAsOld(); fTableViewer.refresh(); } fListener.exceptionListChanged(); fTableViewer.getControl().setFocus(); fTableViewer.setSelection(new StructuredSelection(info), true); return; } info= ExceptionInfo.createInfoForAddedException(newException); fExceptionInfos.add(info); fListener.exceptionListChanged(); fTableViewer.refresh(); fTableViewer.getControl().setFocus(); int row= getTableItemCount() - 1; getTable().setSelection(row); updateButtonsEnabledState(); }
private Control createExceptionsTableControl(Composite parent) { Composite border= new Composite(parent, SWT.NONE); border.setLayout(new GridLayout()); ChangeExceptionsControl cp= new ChangeExceptionsControl(border, SWT.NONE, new IExceptionListChangeListener() { @Override public void exceptionListChanged() { update(true); } }, getChangeMethodSignatureProcessor().getMethod().getJavaProject()); cp.setLayoutData(new GridData(GridData.FILL_BOTH)); cp.setInput(getChangeMethodSignatureProcessor().getExceptionInfos()); return border; }
private IType chooseException() { IJavaElement[] elements= new IJavaElement[] { fProject.getJavaProject() }; final IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false, PlatformUI.getWorkbench().getProgressService(), scope, IJavaSearchConstants.CLASS); dialog.setTitle(RefactoringMessages.ChangeExceptionsControl_choose_title); dialog.setMessage(RefactoringMessages.ChangeExceptionsControl_choose_message); dialog.setInitialPattern("*Exception*"); //$NON-NLS-1$ dialog.setValidator(new ISelectionStatusValidator() { public IStatus validate(Object[] selection) { if (selection.length == 0) return new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$ try { return checkException((IType)selection[0]); } catch (JavaModelException e) { JavaPlugin.log(e); return StatusInfo.OK_STATUS; } } }); if (dialog.open() == Window.OK) { return (IType) dialog.getFirstResult(); } return null; }
private void doAddException() { IType newException= chooseException(); if (newException == null) return; ExceptionInfo info= findExceptionInfo(newException); if (info != null) { if (info.isDeleted()) { info.markAsOld(); fTableViewer.refresh(); } fListener.exceptionListChanged(); fTableViewer.getControl().setFocus(); fTableViewer.setSelection(new StructuredSelection(info), true); return; } info= ExceptionInfo.createInfoForAddedException(newException); fExceptionInfos.add(info); fListener.exceptionListChanged(); fTableViewer.refresh(); fTableViewer.getControl().setFocus(); int row= getTableItemCount() - 1; getTable().setSelection(row); updateButtonsEnabledState(); }
private void createButtonComposite(Composite parent) { Composite buttonComposite= new Composite(parent, SWT.NONE); buttonComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); GridLayout gl= new GridLayout(); gl.marginHeight= 0; gl.marginWidth= 0; buttonComposite.setLayout(gl); createAddButton(buttonComposite); fRemoveButton= createRemoveButton(buttonComposite); updateButtonsEnabledState(); }
private Control createExceptionsTableControl(Composite parent) { Composite border= new Composite(parent, SWT.NONE); border.setLayout(new GridLayout()); ChangeExceptionsControl cp= new ChangeExceptionsControl(border, SWT.NONE, new IExceptionListChangeListener() { @Override public void exceptionListChanged() { update(true); } }, getChangeMethodSignatureProcessor().getMethod().getJavaProject()); cp.setLayoutData(new GridData(GridData.FILL_BOTH)); cp.setInput(getChangeMethodSignatureProcessor().getExceptionInfos()); return border; }
public ChangeExceptionsControl(Composite parent, int style, IExceptionListChangeListener listener, IJavaProject project) { super(parent, style); Assert.isNotNull(listener); fListener= listener; Assert.isNotNull(project); fProject= project; GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginWidth= 0; layout.marginHeight= 0; setLayout(layout); createExceptionList(this); createButtonComposite(this); }
private int getTableItemCount() { return getTable().getItemCount(); }
private IType chooseException() { IJavaElement[] elements= new IJavaElement[] { fProject.getJavaProject() }; final IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); FilteredTypesSelectionDialog dialog= new FilteredTypesSelectionDialog(getShell(), false, PlatformUI.getWorkbench().getProgressService(), scope, IJavaSearchConstants.CLASS); dialog.setTitle(RefactoringMessages.ChangeExceptionsControl_choose_title); dialog.setMessage(RefactoringMessages.ChangeExceptionsControl_choose_message); dialog.setInitialPattern("*Exception*"); //$NON-NLS-1$ dialog.setValidator(new ISelectionStatusValidator() { @Override public IStatus validate(Object[] selection) { if (selection.length == 0) return new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$ try { return checkException((IType)selection[0]); } catch (JavaModelException e) { JavaPlugin.log(e); return StatusInfo.OK_STATUS; } } }); if (dialog.open() == Window.OK) { return (IType) dialog.getFirstResult(); } return null; }
private void createButtonComposite(Composite parent) { Composite buttonComposite= new Composite(parent, SWT.NONE); buttonComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); GridLayout gl= new GridLayout(); gl.marginHeight= 0; gl.marginWidth= 0; buttonComposite.setLayout(gl); createAddButton(buttonComposite); fRemoveButton= createRemoveButton(buttonComposite); updateButtonsEnabledState(); }
public ChangeExceptionsControl(Composite parent, int style, IExceptionListChangeListener listener, IJavaProject project) { super(parent, style); Assert.isNotNull(listener); fListener= listener; Assert.isNotNull(project); fProject= project; GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginWidth= 0; layout.marginHeight= 0; setLayout(layout); createExceptionList(this); createButtonComposite(this); }
private int getTableItemCount() { return getTable().getItemCount(); }
private int getTableItemCount() { return getTable().getItemCount(); }
private int getTableSelectionCount() { return getTable().getSelectionCount(); }