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.EStructuralFeaturefeatureFromString(String featureAsString) Try to getEStructuralFeaturefrom given feature string representation.static StringfeatureToString(org.eclipse.emf.ecore.EStructuralFeature feature) Convert givenEStructuralFeatureto string representation.static <T extends org.eclipse.ui.IEditorPart>
TgetActiveEditor(Object ctx, Class<T> editorClass_) Return the active editor taking into account pages ofMultiPageEditorParts.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 ofMultiPageEditorParts.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 ofMultiPageEditorParts.static <T extends org.eclipse.ui.IEditorPart>
TgetActualEditor(Object editor, Class<T> editorClass_) static booleangetToggleCommandState(org.eclipse.core.commands.Command command) Gets the state of the given toggle command.static voidsetToggleCommandState(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 ofMultiPageEditorParts.- 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 ofMultiPageEditorParts.- 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 ofMultiPageEditorParts.- Parameters:
editorClass_- target editor class.- Returns:
- the active editor, or
null.
-
getActivePartSite
Finds and returns activeIWorkbenchPartSite.- Returns:
IWorkbenchPartSiteorOptional.empty()if not found
-
getActualEditor
-
featureToString
Convert givenEStructuralFeatureto string representation.- Parameters:
EStructuralFeature- theEStructuralFeatureinstance, cannot benull- Returns:
- string representation, cannot be
null
-
featureFromString
Try to getEStructuralFeaturefrom given feature string representation.- Parameters:
featureAsString- the string representation ofEStructuralFeature, cannot benull- Returns:
- instance of
EStructuralFeature, ornullif cannot find feature by given string representation
-