@Override public void selectAndReveal(Object element) { selectReveal(new StructuredSelection(element)); }
@Override public void selectAndReveal(Object element) { selectReveal(new StructuredSelection(element)); }
public void selectAndReveal(Object element) { selectReveal(new StructuredSelection(element)); }
private void selectAndReveal(IAdaptable[] elements) { PackageExplorerPart explorer= getActivePackageExplorer(); if (explorer != null) explorer.selectReveal(new StructuredSelection(elements)); }
private void selectAndReveal(IAdaptable[] elements) { PackageExplorerPart explorer= getActivePackageExplorer(); if (explorer != null) explorer.selectReveal(new StructuredSelection(elements)); }
private void selectAndReveal(IAdaptable[] elements) { PackageExplorerPart explorer= getActivePackageExplorer(); if (explorer != null) explorer.selectReveal(new StructuredSelection(elements)); }
private boolean reveal(PackageExplorerPart view, Object element) { if (view == null) { return false; } view.selectReveal(new StructuredSelection(element)); IElementComparer comparer= view.getTreeViewer().getComparer(); Object selected= getSelectedElement(view); if (comparer != null ? comparer.equals(element, selected) : element.equals(selected)) { return true; } return false; }
private boolean revealAndVerify(Object element) { if (element == null) return false; selectReveal(new StructuredSelection(element)); return ! getSite().getSelectionProvider().getSelection().isEmpty(); }
private boolean revealAndVerify(Object element) { if (element == null) return false; selectReveal(new StructuredSelection(element)); return ! getSite().getSelectionProvider().getSelection().isEmpty(); }
private boolean revealAndVerify(Object element) { if (element == null) return false; selectReveal(new StructuredSelection(element)); return ! getSite().getSelectionProvider().getSelection().isEmpty(); }
private void gotoPackage(IPackageFragment p) { fPackageExplorer.selectReveal(new StructuredSelection(p)); if (!p.equals(getSelectedElement())) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(p, JavaElementLabels.ALL_DEFAULT))); } }
private void gotoPackage(IPackageFragment p) { fPackageExplorer.selectReveal(new StructuredSelection(p)); if (!p.equals(getSelectedElement())) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, p.getElementName())); } }
private void gotoPackage(IPackageFragment p) { fPackageExplorer.selectReveal(new StructuredSelection(p)); if (!p.equals(getSelectedElement())) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(p, JavaElementLabels.ALL_DEFAULT))); } }
@Override public boolean performFinish() { fPage.finish(); IWorkingSet ws= fPage.getSelection(); if (ws != null) { PlatformUI.getWorkbench().getWorkingSetManager().addWorkingSet(ws); PackageExplorerPart explorer= getActivePackageExplorer(); if (explorer != null) { if (explorer.getRootMode() == PackageExplorerPart.WORKING_SETS_AS_ROOTS) { explorer.selectReveal(new StructuredSelection(ws)); } } } return true; }
@Override public boolean performFinish() { fPage.finish(); IWorkingSet ws= fPage.getSelection(); if (ws != null) { PlatformUI.getWorkbench().getWorkingSetManager().addWorkingSet(ws); PackageExplorerPart explorer= getActivePackageExplorer(); if (explorer != null) { if (explorer.getRootMode() == PackageExplorerPart.WORKING_SETS_AS_ROOTS) { explorer.selectReveal(new StructuredSelection(ws)); } } } return true; }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT))); } } } }
@Override public boolean show(ShowInContext context) { ISelection selection= context.getSelection(); if (selection instanceof IStructuredSelection) { // fix for 64634 Navigate/Show in/Package Explorer doesn't work IStructuredSelection structuredSelection= ((IStructuredSelection) selection); if (structuredSelection.size() == 1) { int res= tryToReveal(structuredSelection.getFirstElement()); if (res == IStatus.OK) return true; if (res == IStatus.CANCEL) return false; } else if (structuredSelection.size() > 1) { selectReveal(structuredSelection); return true; } } Object input= context.getInput(); if (input instanceof IEditorInput) { Object elementOfInput= getInputFromEditor((IEditorInput) input); return elementOfInput != null && (tryToReveal(elementOfInput) == IStatus.OK); } return false; }
public boolean show(ShowInContext context) { ISelection selection= context.getSelection(); if (selection instanceof IStructuredSelection) { // fix for 64634 Navigate/Show in/Package Explorer doesn't work IStructuredSelection structuredSelection= ((IStructuredSelection) selection); if (structuredSelection.size() == 1) { int res= tryToReveal(structuredSelection.getFirstElement()); if (res == IStatus.OK) return true; if (res == IStatus.CANCEL) return false; } else if (structuredSelection.size() > 1) { selectReveal(structuredSelection); return true; } } Object input= context.getInput(); if (input instanceof IEditorInput) { Object elementOfInput= getInputFromEditor((IEditorInput) input); return elementOfInput != null && (tryToReveal(elementOfInput) == IStatus.OK); } return false; }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, element.getElementName())); } } } }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT))); } } } }