1 11 12 package org.eclipse.ui; 13 14 19 public abstract class NavigationLocation implements INavigationLocation { 20 21 private IWorkbenchPage page; 22 23 private IEditorInput input; 24 25 30 protected NavigationLocation(IEditorPart editorPart) { 31 this.page = editorPart.getSite().getPage(); 32 this.input = editorPart.getEditorInput(); 33 } 34 35 40 protected IEditorPart getEditorPart() { 41 if (input == null) { 42 return null; 43 } 44 return page.findEditor(input); 45 } 46 47 51 public Object getInput() { 52 return input; 53 } 54 55 59 public String getText() { 60 IEditorPart part = getEditorPart(); 61 if (part == null) { 62 return new String (); 63 } 64 return part.getTitle(); 65 } 66 67 71 public void setInput(Object input) { 72 this.input = (IEditorInput) input; 73 } 74 75 80 public void dispose() { 81 releaseState(); 82 } 83 84 89 public void releaseState() { 90 input = null; 91 } 92 } 93 | Popular Tags |