protected void buttonPressed(int buttonId) { if (buttonId == ADD_ID) { addSelectedInterfaces(); } else { super.buttonPressed(buttonId); } }
@Override protected void cancelPressed() { fTypeWizardPage.setSuperInterfaces(fOldContent, true); super.cancelPressed(); }
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, ADD_ID, Messages.AbstractSuperTypeSelectionDialog_1, true); super.createButtonsForButtonBar(parent); }
@Override public void run() { Shell parent= JavaPlugin.getActiveWorkbenchShell(); OpenTypeSelectionDialog dialog= new OpenTypeSelectionDialog(parent, false, PlatformUI.getWorkbench().getProgressService(), SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE); dialog.setTitle(ActionMessages.OpenTypeInHierarchyAction_dialogTitle); dialog.setMessage(ActionMessages.OpenTypeInHierarchyAction_dialogMessage); int result= dialog.open(); if (result != IDialogConstants.OK_ID) return; Object[] types= dialog.getResult(); if (types != null && types.length > 0) { IType type= (IType)types[0]; OpenTypeHierarchyUtil.open(new IType[] { type }, fWindow); } }
@Override protected void okPressed() { addSelectedInterfaces(); super.okPressed(); }
@Override protected void updateButtonsEnableState(IStatus status) { super.updateButtonsEnableState(status); final Button addButton = getButton(ADD_ID); if (addButton != null && !addButton.isDisposed()) { addButton.setEnabled(!status.matches(IStatus.ERROR)); } }
@Override protected void handleShellCloseEvent() { super.handleShellCloseEvent(); // Handle the closing of the shell by selecting the close icon fTypeWizardPage.setSuperInterfaces(fOldContent, true); }
@Override protected void handleSelected(StructuredSelection selection) { super.handleSelected(selection); if (selection.size() == 0 && fTypeWizardPage.getSuperInterfaces().size() > fOldContent.size()) { // overrides updateStatus() from handleSelected() if // list of super interfaces was modified // the <code>super.handleSelected(selection)</code> has to be // called, because superclass implementation of this class updates // state of the table. updateStatus(Status.OK_STATUS); getButton(ADD_ID).setEnabled(false); } else { // if selection isn't empty, the add button should be enabled in // exactly the same scenarios as the OK button getButton(ADD_ID).setEnabled(getButton(OK).isEnabled()); } }
@Override protected void configureShell(Shell newShell) { super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.SUPER_INTERFACE_SELECTION_DIALOG); }
public void runWithEvent(Event e) { Shell parent= JavaPlugin.getActiveWorkbenchShell(); SelectionDialog dialog; if (e != null && e.stateMask == SWT.MOD1) { // use old open type dialog when MOD1 (but no other modifier) is down: dialog= createOpenTypeSelectionDialog2(parent); } else { dialog= new OpenTypeSelectionDialog(parent, true, PlatformUI.getWorkbench().getProgressService(), null, IJavaSearchConstants.TYPE); } dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle); dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage); int result= dialog.open(); if (result != IDialogConstants.OK_ID) return; Object[] types= dialog.getResult(); if (types != null && types.length > 0) { IType type= null; for (int i= 0; i < types.length; i++) { type= (IType) types[i]; try { JavaUI.openInEditor(type, true, true); } catch (CoreException x) { ExceptionHandler.handle(x, JavaUIMessages.OpenTypeAction_errorTitle, JavaUIMessages.OpenTypeAction_errorMessage); } } } }
@Override public void run() { Shell parent= JavaPlugin.getActiveWorkbenchShell(); OpenTypeSelectionDialog dialog= new OpenTypeSelectionDialog(parent, false, PlatformUI.getWorkbench().getProgressService(), SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE); dialog.setTitle(ActionMessages.OpenTypeInHierarchyAction_dialogTitle); dialog.setMessage(ActionMessages.OpenTypeInHierarchyAction_dialogMessage); int result= dialog.open(); if (result != IDialogConstants.OK_ID) return; Object[] types= dialog.getResult(); if (types != null && types.length > 0) { IType type= (IType)types[0]; OpenTypeHierarchyUtil.open(new IType[] { type }, fWindow); } }
@Override protected void okPressed() { fillWizardPageWithSelectedTypes(); super.okPressed(); }
@Override protected void updateButtonsEnableState(IStatus status) { super.updateButtonsEnableState(status); Button addButton= getButton(ADD_ID); if (addButton != null && !addButton.isDisposed()) addButton.setEnabled(!status.matches(IStatus.ERROR)); }
@Override protected void handleShellCloseEvent() { super.handleShellCloseEvent(); // Handle the closing of the shell by selecting the close icon restoreWizardPage(this.typeWizardPage, this.oldContent); }
protected void handleSelected(StructuredSelection selection) { super.handleSelected(selection); if (selection.size() == 0 && fTypeWizardPage.getSuperInterfaces().size() > fOldContent.size()) { // overrides updateStatus() from handleSelected() if // list of super interfaces was modified // the <code>super.handleSelected(selection)</code> has to be // called, because superclass implementation of this class updates // state of the table. updateStatus(new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "", null)); //$NON-NLS-1$ getButton(ADD_ID).setEnabled(false); } else { // if selection isn't empty, the add button should be enabled in // exactly the same scenarios as the OK button getButton(ADD_ID).setEnabled(getButton(OK).isEnabled()); } }
protected void configureShell(Shell newShell) { super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.SUPER_INTERFACE_SELECTION_DIALOG); } }
SelectionDialog dialog= new OpenTypeSelectionDialog(parent, true, PlatformUI.getWorkbench().getProgressService(), null, IJavaSearchConstants.TYPE); dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle); dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage);
public void run() { Shell parent= JavaPlugin.getActiveWorkbenchShell(); OpenTypeSelectionDialog dialog= new OpenTypeSelectionDialog(parent, false, PlatformUI.getWorkbench().getProgressService(), SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE); dialog.setTitle(ActionMessages.OpenTypeInHierarchyAction_dialogTitle); dialog.setMessage(ActionMessages.OpenTypeInHierarchyAction_dialogMessage); int result= dialog.open(); if (result != IDialogConstants.OK_ID) return; Object[] types= dialog.getResult(); if (types != null && types.length > 0) { IType type= (IType)types[0]; OpenTypeHierarchyUtil.open(new IType[] { type }, fWindow); } }
@Override protected void buttonPressed(int buttonId) { if (buttonId == ADD_ID) { addSelectedInterfaces(); } else { super.buttonPressed(buttonId); } }
@Override protected void okPressed() { addSelectedInterfaces(); super.okPressed(); }