Class DtHandlerUtil

java.lang.Object
com._1c.g5.v8.dt.ui.util.DtHandlerUtil

public final class DtHandlerUtil extends Object
Extension for HandlerUtil.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.eclipse.emf.ecore.EStructuralFeature
    featureFromString(String featureAsString)
    Try to get EStructuralFeature from given feature string representation.
    static String
    featureToString(org.eclipse.emf.ecore.EStructuralFeature feature)
    Convert given EStructuralFeature to string representation.
    static <T extends org.eclipse.ui.IEditorPart>
    T
    getActiveEditor(Object ctx, Class<T> editorClass_)
    Return the active editor taking into account pages of MultiPageEditorParts.
    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 of MultiPageEditorParts.
    static Optional<org.eclipse.ui.IWorkbenchPartSite>
    Finds and returns active IWorkbenchPartSite.
    static <T extends org.eclipse.ui.IEditorPart>
    T
    Return the active workbench editor taking into account pages of MultiPageEditorParts.
    static <T extends org.eclipse.ui.IEditorPart>
    T
    getActualEditor(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 of MultiPageEditorParts.
      Parameters:
      event - The execution event that contains the application context
      editorClass_ - 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 of MultiPageEditorParts.
      Parameters:
      ctx - The IEvaluationContext or null
      editorClass_ - 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 of MultiPageEditorParts.
      Parameters:
      editorClass_ - target editor class.
      Returns:
      the active editor, or null.
    • getActivePartSite

      public static Optional<org.eclipse.ui.IWorkbenchPartSite> getActivePartSite()
      Finds and returns active IWorkbenchPartSite.
      Returns:
      IWorkbenchPartSite or Optional.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 given EStructuralFeature to string representation.
      Parameters:
      EStructuralFeature - the EStructuralFeature instance, cannot be null
      Returns:
      string representation, cannot be null
    • featureFromString

      public static org.eclipse.emf.ecore.EStructuralFeature featureFromString(String featureAsString)
      Try to get EStructuralFeature from given feature string representation.
      Parameters:
      featureAsString - the string representation of EStructuralFeature, cannot be null
      Returns:
      instance of EStructuralFeature, or null if cannot find feature by given string representation