1 19 package org.netbeans.modules.refactoring.api; 20 21 import org.netbeans.modules.refactoring.spi.RefactoringElementImplementation; 22 import org.openide.filesystems.FileObject; 23 import org.openide.text.PositionBounds; 24 25 32 public final class RefactoringElement { 33 34 public static final int NORMAL = 0; 35 36 public static final int WARNING = 1; 37 39 public static final int GUARDED = 2; 40 41 public static final int READ_ONLY = 3; 42 43 final RefactoringElementImplementation impl; 45 46 RefactoringElement(RefactoringElementImplementation impl) { 47 assert impl != null; 48 this.impl = impl; 49 } 50 51 54 public String getText() { 55 return impl.getText(); 56 } 57 58 61 public String getDisplayText() { 62 return impl.getDisplayText(); 63 } 64 65 68 public boolean isEnabled() { 69 return impl.isEnabled(); 70 } 71 72 75 public void setEnabled(boolean enabled) { 76 impl.setEnabled(enabled); 77 } 78 79 88 public Object getComposite() { 89 Object o = impl.getComposite(); 90 if (o==null) 91 return getParentFile(); 92 return o; 93 } 94 95 98 public FileObject getParentFile() { 99 return impl.getParentFile(); 100 } 101 102 105 public PositionBounds getPosition() { 106 return impl.getPosition(); 107 } 108 109 113 public int getStatus() { 114 return impl.getStatus(); 115 } 116 117 121 public void showPreview() { 122 impl.showPreview(); 123 } 124 125 128 public void openInEditor() { 129 impl.openInEditor(); 130 } 131 } 132 | Popular Tags |