Class ErrorComponent

java.lang.Object
com.e1c.langtool.internal.ui.common.tools.ErrorComponent
All Implemented Interfaces:
IErrorComponent

public class ErrorComponent extends Object implements IErrorComponent
The realization of error components that allows getting of detailed information about errors and opening a preference page with setting.

The instances of this class allows getting as short description of an errors as detailed information about errors in ErrorDialog. The detail information about error also can include a stack trace of an exception. Also it provides ability to open related preference page with settings.

See Also:
  • ErrorDialog
  • Constructor Summary

    Constructors
    Constructor
    Description
    ErrorComponent(String pluginId, String preferencePageId)
    Creates a new component to show information about errors.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createComponent(org.eclipse.swt.widgets.Composite parent)
    Creates this control on the parent composite.
    protected void
    createDetailButton(org.eclipse.swt.widgets.Composite top)
     
    protected void
    createErrorIcon(org.eclipse.swt.widgets.Composite top)
     
    protected void
    createErrorMessage(org.eclipse.swt.widgets.Composite top)
     
    void
    Hides a representation of the error if it's shown.
    boolean
    Checks if the error visible.
    static void
    setExclusion(org.eclipse.swt.widgets.Composite composite, boolean state)
    Sets exclude attribute of grid data for the given composite.
    void
    showError(String msg, String detail, Throwable exc)
    Shows a representation of the error on this component.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ErrorComponent

      public ErrorComponent(String pluginId, String preferencePageId)
      Creates a new component to show information about errors.
      Parameters:
      pluginId - the unique identifier of the relevant plug-in for Status.
      an - id of preference page that will be opened by click on settings button
  • Method Details

    • setExclusion

      public static void setExclusion(org.eclipse.swt.widgets.Composite composite, boolean state)
      Sets exclude attribute of grid data for the given composite.
      Parameters:
      composite - a composite with GridData layoutData
      state - the exclusion mode
      Throws:
      ClassCastException - if the given composite's layoutData is not GridData
    • createComponent

      public void createComponent(org.eclipse.swt.widgets.Composite parent)
      Description copied from interface: IErrorComponent
      Creates this control on the parent composite.
      Specified by:
      createComponent in interface IErrorComponent
      Parameters:
      parent - parent control
    • showError

      public void showError(String msg, String detail, Throwable exc)
      Description copied from interface: IErrorComponent
      Shows a representation of the error on this component.
      Specified by:
      showError in interface IErrorComponent
      Parameters:
      msg - a basic localizated error message
      detail - a detailed error information about error
      exc - a low-level exception, or null if not applicable
    • hide

      public void hide()
      Description copied from interface: IErrorComponent
      Hides a representation of the error if it's shown.
      Specified by:
      hide in interface IErrorComponent
    • isErrorVisible

      public boolean isErrorVisible()
      Description copied from interface: IErrorComponent
      Checks if the error visible.
      Specified by:
      isErrorVisible in interface IErrorComponent
      Returns:
      true, if the error visible
    • createErrorIcon

      protected void createErrorIcon(org.eclipse.swt.widgets.Composite top)
    • createErrorMessage

      protected void createErrorMessage(org.eclipse.swt.widgets.Composite top)
    • createDetailButton

      protected void createDetailButton(org.eclipse.swt.widgets.Composite top)