Revision 56fbcef9
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java | ||
---|---|---|
60 | 60 |
import org.eclipse.ui.IViewPart; |
61 | 61 |
import org.eclipse.ui.IViewReference; |
62 | 62 |
import org.eclipse.ui.IWorkbench; |
63 |
import org.eclipse.ui.IWorkbenchPage; |
|
64 | 63 |
import org.eclipse.ui.IWorkbenchWindow; |
65 | 64 |
import org.eclipse.ui.PlatformUI; |
66 | 65 |
import org.eclipse.ui.handlers.IHandlerService; |
... | ... | |
116 | 115 |
return null; |
117 | 116 |
} |
118 | 117 |
|
119 |
public static boolean closeAll() { |
|
120 |
if(getActivePage()!=null){ |
|
121 |
return getActivePage().closeAllEditors(true); |
|
122 |
} |
|
123 |
return false; |
|
124 |
} |
|
125 |
|
|
126 | 118 |
public static Shell getShell() { |
127 | 119 |
|
128 | 120 |
return TaxeditorStorePlugin.getDefault().getWorkbench() |
129 | 121 |
.getActiveWorkbenchWindow().getShell(); |
130 | 122 |
} |
131 | 123 |
|
132 |
public static IWorkbenchPage getActivePage() { |
|
133 |
try{ |
|
134 |
return TaxeditorStorePlugin.getDefault().getWorkbench() |
|
135 |
.getActiveWorkbenchWindow().getActivePage(); |
|
136 |
} catch(NullPointerException npe){ |
|
137 |
return null; |
|
138 |
} |
|
139 |
} |
|
140 |
|
|
141 | 124 |
public static IWorkbench getWorkbench() { |
142 | 125 |
return TaxeditorStorePlugin.getDefault().getWorkbench(); |
143 | 126 |
} |
Also available in: Unified diff
ref #6913 Remove getActivePage() method