Package com._1c.g5.v8.dt.ui.util
Class DtHandlerUtil
java.lang.Object
com._1c.g5.v8.dt.ui.util.DtHandlerUtil
Extension for
HandlerUtil
.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.emf.ecore.EStructuralFeature
featureFromString
(String featureAsString) Try to getEStructuralFeature
from given feature string representation.static String
featureToString
(org.eclipse.emf.ecore.EStructuralFeature feature) Convert givenEStructuralFeature
to string representation.static <T extends org.eclipse.ui.IEditorPart>
TgetActiveEditor
(Object ctx, Class<T> editorClass_) Return the active editor taking into account pages ofMultiPageEditorPart
s.static <T extends org.eclipse.ui.IEditorPart>
TgetActiveEditor
(org.eclipse.core.commands.ExecutionEvent event, Class<T> editorClass_) Return the active editor taking into account pages ofMultiPageEditorPart
s.static Optional<org.eclipse.ui.IWorkbenchPartSite>
Finds and returns activeIWorkbenchPartSite
.static <T extends org.eclipse.ui.IEditorPart>
TgetActiveWorkbenchEditor
(Class<T> editorClass_) Return the active workbench editor taking into account pages ofMultiPageEditorPart
s.static <T extends org.eclipse.ui.IEditorPart>
TgetActualEditor
(Object editor, Class<T> editorClass_) static boolean
getToggleCommandState
(org.eclipse.core.commands.Command command) Gets the state of the given toggle command.static void
setToggleCommandState
(org.eclipse.core.commands.Command command, boolean value) Sets the state of the toggle command.
-
Method Details
-
getToggleCommandState
public static boolean getToggleCommandState(org.eclipse.core.commands.Command command) Gets the state of the given toggle command.- Parameters:
command
- command to check.- Returns:
- the state of the command.
-
setToggleCommandState
public static void setToggleCommandState(org.eclipse.core.commands.Command command, boolean value) Sets the state of the toggle command.- Parameters:
command
- command to set the state of.value
- new state.
-
getActiveEditor
public static <T extends org.eclipse.ui.IEditorPart> T getActiveEditor(org.eclipse.core.commands.ExecutionEvent event, Class<T> editorClass_) Return the active editor taking into account pages ofMultiPageEditorPart
s.- Parameters:
event
- The execution event that contains the application contexteditorClass_
- target editor class.- Returns:
- the active editor, or
null
.
-
getActiveEditor
public static <T extends org.eclipse.ui.IEditorPart> T getActiveEditor(Object ctx, Class<T> editorClass_) Return the active editor taking into account pages ofMultiPageEditorPart
s.- Parameters:
ctx
- The IEvaluationContext or nulleditorClass_
- target editor class.- Returns:
- the active editor, or
null
.
-
getActiveWorkbenchEditor
public static <T extends org.eclipse.ui.IEditorPart> T getActiveWorkbenchEditor(Class<T> editorClass_) Return the active workbench editor taking into account pages ofMultiPageEditorPart
s.- Parameters:
editorClass_
- target editor class.- Returns:
- the active editor, or
null
.
-
getActivePartSite
Finds and returns activeIWorkbenchPartSite
.- Returns:
IWorkbenchPartSite
orOptional.empty()
if not found
-
getActualEditor
-
featureToString
Convert givenEStructuralFeature
to string representation.- Parameters:
EStructuralFeature
- theEStructuralFeature
instance, cannot benull
- Returns:
- string representation, cannot be
null
-
featureFromString
Try to getEStructuralFeature
from given feature string representation.- Parameters:
featureAsString
- the string representation ofEStructuralFeature
, cannot benull
- Returns:
- instance of
EStructuralFeature
, ornull
if cannot find feature by given string representation
-