/** * Note: This method is for internal use only. Clients should not call this method. * * @param selection the selection * * @noreference This method is not intended to be referenced by clients. */ public void run(JavaTextSelection selection) { run((ITextSelection)selection); }
private void dispatchRun(ISelection selection) { if (selection instanceof IStructuredSelection) { run((IStructuredSelection)selection); } else if (selection instanceof JavaTextSelection) { run((JavaTextSelection)selection); } else if (selection instanceof ITextSelection) { run((ITextSelection)selection); } else { run(selection); } } }
/** * Executes this actions with the given structured selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(IStructuredSelection selection) { run((ISelection)selection); }
/** * Note: This method is for internal use only. Clients should not call this method. * * @param selection the selection */ public void run(JavaTextSelection selection) { run((ITextSelection)selection); }
/** * Executes this actions with the given text selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(ITextSelection selection) { run((ISelection)selection); }
/** * Note: This method is for internal use only. Clients should not call this method. * * @param selection the selection * * @noreference This method is not intended to be referenced by clients. */ public void run(JavaTextSelection selection) { run((ITextSelection)selection); }
/** * Executes this actions with the given text selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(ITextSelection selection) { run((ISelection)selection); }
private void dispatchRun(ISelection selection) { if (selection instanceof IStructuredSelection) { run((IStructuredSelection)selection); } else if (selection instanceof JavaTextSelection) { run((JavaTextSelection)selection); } else if (selection instanceof ITextSelection) { run((ITextSelection)selection); } else { run(selection); } } }
/** * Executes this actions with the given structured selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(IStructuredSelection selection) { run((ISelection)selection); }
/** * Executes this actions with the given structured selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(IStructuredSelection selection) { run((ISelection)selection); }
/** * Executes this actions with the given text selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(ITextSelection selection) { run((ISelection)selection); }
private void dispatchRun(ISelection selection) { if (selection instanceof IStructuredSelection) { run((IStructuredSelection)selection); } else if (selection instanceof JavaTextSelection) { run((JavaTextSelection)selection); } else if (selection instanceof ITextSelection) { run((ITextSelection)selection); } else { run(selection); } } }
@Override public void open() { try { IMethod method= findSuperImplementation(fMethod); if (method != null) fOpenAction.run(new StructuredSelection(method)); } catch (JavaModelException e) { JavaPlugin.log(e); return; } }
@Override public void open() { try { IMethod method= findSuperImplementation(fMethod); if (method != null) fOpenAction.run(new StructuredSelection(method)); } catch (JavaModelException e) { JavaPlugin.log(e); return; } }
@Override public void open() { try { IMethod method= (IMethod) realMethod.getJavaElement(); if (method != null) { action.run(new StructuredSelection(method)); } } catch(Exception e) { Activator.log(e); } }
public final boolean activate(final Refactoring ref, final Shell parent, final int saveMode) throws CoreException { final RefactoringStatus status= ref.checkInitialConditions(new NullProgressMonitor()); if (status.hasFatalError()) { final RefactoringStatusEntry entry= status.getEntryMatchingSeverity(RefactoringStatus.FATAL); if (entry.getCode() == RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD || entry.getCode() == RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE) { String message= entry.getMessage(); final Object element= entry.getData(); message= message + RefactoringMessages.RefactoringErrorDialogUtil_okToPerformQuestion; if (element != null && MessageDialog.openQuestion(shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, message)) { final IStructuredSelection selection= new StructuredSelection(element); // TODO: should not hijack this // ModifiyParametersAction. // The action is set up on an editor, but we use it // as if it were set up on a ViewPart. boolean wasEnabled= action.isEnabled(); action.selectionChanged(selection); if (action.isEnabled()) { action.run(selection); } else { MessageDialog.openInformation(shell, ActionMessages.ModifyParameterAction_problem_title, ActionMessages.ModifyParameterAction_problem_message); } action.setEnabled(wasEnabled); } return false; } } return super.activate(ref, parent, saveMode); } };
@Override public void open() { try { String returnTypeSignature= fMethod.getReturnType(); int kind= Signature.getTypeSignatureKind(returnTypeSignature); if (kind == Signature.ARRAY_TYPE_SIGNATURE) { returnTypeSignature= Signature.getElementType(returnTypeSignature); } else if (kind == Signature.CLASS_TYPE_SIGNATURE) { returnTypeSignature= Signature.getTypeErasure(returnTypeSignature); } String returnType= Signature.toString(returnTypeSignature); String[][] resolvedType= fMethod.getDeclaringType().resolveType(returnType); if (resolvedType == null || resolvedType.length == 0) { openMethodAndShowErrorInStatusLine(); return; } String typeName= JavaModelUtil.concatenateName(resolvedType[0][0], resolvedType[0][1]); IType type= fMethod.getJavaProject().findType(typeName, (IProgressMonitor)null); if (type != null) { fOpenAction.run(new StructuredSelection(type)); return; } openMethodAndShowErrorInStatusLine(); } catch (JavaModelException e) { JavaPlugin.log(e); return; } }
@Override public void open() { try { String returnTypeSignature= fMethod.getReturnType(); int kind= Signature.getTypeSignatureKind(returnTypeSignature); if (kind == Signature.ARRAY_TYPE_SIGNATURE) { returnTypeSignature= Signature.getElementType(returnTypeSignature); } else if (kind == Signature.CLASS_TYPE_SIGNATURE) { returnTypeSignature= Signature.getTypeErasure(returnTypeSignature); } String returnType= Signature.toString(returnTypeSignature); String[][] resolvedType= fMethod.getDeclaringType().resolveType(returnType); if (resolvedType == null || resolvedType.length == 0) { openMethodAndShowErrorInStatusLine(); return; } String typeName= JavaModelUtil.concatenateName(resolvedType[0][0], resolvedType[0][1]); IType type= fMethod.getJavaProject().findType(typeName, (IProgressMonitor)null); if (type != null) { fOpenAction.run(new StructuredSelection(type)); return; } openMethodAndShowErrorInStatusLine(); } catch (JavaModelException e) { JavaPlugin.log(e); return; } }