Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java | ||
---|---|---|
43 | 43 |
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator; |
44 | 44 |
|
45 | 45 |
/** |
46 |
* <p>NavigationUtil class.</p> |
|
47 |
* |
|
46 | 48 |
* @author n.hoffmann |
47 | 49 |
* @created 24.03.2009 |
48 | 50 |
* @version 1.0 |
... | ... | |
50 | 52 |
public class NavigationUtil extends AbstractUtility{ |
51 | 53 |
private static IUndoContext defaultUndoContext; |
52 | 54 |
|
55 |
/** |
|
56 |
* <p>executeEditHandler</p> |
|
57 |
*/ |
|
53 | 58 |
public static void executeEditHandler(){ |
54 | 59 |
|
55 | 60 |
String commandId = "eu.etaxonomy.taxeditor.navigation.command.editSelection"; |
... | ... | |
68 | 73 |
} |
69 | 74 |
} |
70 | 75 |
|
76 |
/** |
|
77 |
* <p>openEditor</p> |
|
78 |
* |
|
79 |
* @param selectedObject a {@link eu.etaxonomy.cdm.model.common.CdmBase} object. |
|
80 |
*/ |
|
71 | 81 |
public static void openEditor(CdmBase selectedObject){ |
72 | 82 |
UUID entityUuid = selectedObject.getUuid(); |
73 | 83 |
try { |
... | ... | |
88 | 98 |
} |
89 | 99 |
} |
90 | 100 |
|
101 |
/** |
|
102 |
* <p>openEmpty</p> |
|
103 |
* |
|
104 |
* @param parentNodeUuid a {@link java.util.UUID} object. |
|
105 |
*/ |
|
91 | 106 |
public static void openEmpty(UUID parentNodeUuid) { |
92 | 107 |
try { |
93 | 108 |
EditorUtil.openEmpty(parentNodeUuid); |
... | ... | |
97 | 112 |
} |
98 | 113 |
|
99 | 114 |
/** |
100 |
* @param configuration |
|
115 |
* <p>openEditor</p> |
|
116 |
* |
|
117 |
* @param configuration a eu.etaxonomy.taxeditor.editor.OpenEditorConfiguration object. |
|
101 | 118 |
*/ |
102 | 119 |
public static void openEditor(OpenEditorConfiguration configuration) { |
103 | 120 |
// TODO Auto-generated method stub |
104 | 121 |
|
105 | 122 |
} |
106 | 123 |
|
124 |
/** |
|
125 |
* <p>getShell</p> |
|
126 |
* |
|
127 |
* @return a {@link org.eclipse.swt.widgets.Shell} object. |
|
128 |
*/ |
|
107 | 129 |
public static Shell getShell() { |
108 | 130 |
return getActiveWindow().getShell(); |
109 | 131 |
} |
110 | 132 |
|
133 |
/** |
|
134 |
* <p>getActiveWindow</p> |
|
135 |
* |
|
136 |
* @return a {@link org.eclipse.ui.IWorkbenchWindow} object. |
|
137 |
*/ |
|
111 | 138 |
public static IWorkbenchWindow getActiveWindow() { |
112 | 139 |
return TaxeditorNavigationPlugin.getDefault().getWorkbench(). |
113 | 140 |
getActiveWorkbenchWindow(); |
114 | 141 |
} |
115 | 142 |
|
143 |
/** |
|
144 |
* <p>getWorkbenchUndoContext</p> |
|
145 |
* |
|
146 |
* @return a {@link org.eclipse.core.commands.operations.IUndoContext} object. |
|
147 |
*/ |
|
116 | 148 |
public static IUndoContext getWorkbenchUndoContext() { |
117 | 149 |
return TaxeditorEditorPlugin.getDefault().getWorkbench(). |
118 | 150 |
getOperationSupport().getUndoContext(); |
119 | 151 |
} |
120 | 152 |
|
153 |
/** |
|
154 |
* <p>getUndoContext</p> |
|
155 |
* |
|
156 |
* @return a {@link org.eclipse.core.commands.operations.IUndoContext} object. |
|
157 |
*/ |
|
121 | 158 |
public static IUndoContext getUndoContext() { |
122 | 159 |
// FIXME this has to be more specific. Every widget has to have its own undo context |
123 | 160 |
// return IOperationHistory.GLOBAL_UNDO_CONTEXT; |
... | ... | |
133 | 170 |
|
134 | 171 |
/** |
135 | 172 |
* Whether a taxonNode has unsaved changes. |
136 |
*
|
|
137 |
* @param taxonNode |
|
138 |
* @return |
|
173 |
* |
|
174 |
* @param taxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
|
|
175 |
* @return a boolean.
|
|
139 | 176 |
*/ |
140 | 177 |
public static boolean isDirty(TaxonNode taxonNode){ |
141 | 178 |
|
... | ... | |
158 | 195 |
} |
159 | 196 |
|
160 | 197 |
/** |
161 |
* |
|
162 |
* @param element |
|
163 |
* @param parentElement |
|
198 |
* <p>selectInNavigator</p> |
|
199 |
* |
|
200 |
* @param element a {@link java.lang.Object} object. |
|
201 |
* @param parentElement a {@link java.lang.Object} object. |
|
164 | 202 |
*/ |
165 | 203 |
public static void selectInNavigator(final Object element, final Object parentElement) { |
166 | 204 |
Display.getDefault().asyncExec(new Runnable(){ |
... | ... | |
183 | 221 |
} |
184 | 222 |
|
185 | 223 |
/** |
186 |
* @param selection |
|
224 |
* <p>openSearch</p> |
|
225 |
* |
|
226 |
* @param selection a {@link java.lang.Object} object. |
|
187 | 227 |
*/ |
188 | 228 |
public static void openSearch(Object selection) { |
189 | 229 |
if(selection instanceof Taxon){ |
... | ... | |
234 | 274 |
} |
235 | 275 |
|
236 | 276 |
/** |
277 |
* <p>showNavigator</p> |
|
278 |
* |
|
237 | 279 |
* @return the TaxonNavigator instance if present |
238 | 280 |
*/ |
239 | 281 |
public static TaxonNavigator showNavigator() { |
240 | 282 |
return (TaxonNavigator) showView(TaxonNavigator.ID); |
241 | 283 |
} |
242 | 284 |
|
285 |
/** |
|
286 |
* <p>getNavigator</p> |
|
287 |
* |
|
288 |
* @param restore a boolean. |
|
289 |
* @return a {@link eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator} object. |
|
290 |
*/ |
|
243 | 291 |
public static TaxonNavigator getNavigator(boolean restore) { |
244 | 292 |
return (TaxonNavigator) getView(TaxonNavigator.ID, restore); |
245 | 293 |
} |
246 | 294 |
|
295 |
/** |
|
296 |
* <p>getOpenEditors</p> |
|
297 |
* |
|
298 |
* @return a {@link java.util.Set} object. |
|
299 |
*/ |
|
247 | 300 |
public static Set<IEditorPart> getOpenEditors() { |
248 | 301 |
return EditorUtil.getOpenEditors(); |
249 | 302 |
} |
250 | 303 |
|
304 |
/** |
|
305 |
* <p>getPluginId</p> |
|
306 |
* |
|
307 |
* @return a {@link java.lang.String} object. |
|
308 |
*/ |
|
251 | 309 |
protected static String getPluginId(){ |
252 | 310 |
return TaxeditorNavigationPlugin.PLUGIN_ID; |
253 | 311 |
} |
254 | 312 |
|
255 |
} |
|
313 |
} |
Also available in: Unified diff
performed javacscript:fix and worked on documentation