Package com._1c.g5.v8.dt.ui.util
Class DtHandlerUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.ui.util.DtHandlerUtil
-
public final class DtHandlerUtil extends Object
Extension forHandlerUtil
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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>
getActivePartSite()
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 Detail
-
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
public static Optional<org.eclipse.ui.IWorkbenchPartSite> getActivePartSite()
Finds and returns activeIWorkbenchPartSite
.- Returns:
IWorkbenchPartSite
orOptional.empty()
if not found
-
getActualEditor
public static <T extends org.eclipse.ui.IEditorPart> T getActualEditor(Object editor, Class<T> editorClass_)
-
featureToString
public static String featureToString(org.eclipse.emf.ecore.EStructuralFeature feature)
Convert givenEStructuralFeature
to string representation.- Parameters:
EStructuralFeature
- theEStructuralFeature
instance, cannot benull
- Returns:
- string representation, cannot be
null
-
featureFromString
public static org.eclipse.emf.ecore.EStructuralFeature featureFromString(String featureAsString)
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
-
-