Class PiccoloViewerUI

All Implemented Interfaces:
IDiagramOutlinePage.Provider, ILayoutRecorder, IViewer

public class PiccoloViewerUI extends PiccoloViewer
UI stuff such as the text input mechanism and registry of actions are extracted from the PiccoloViewer to this class to optimize dependencies. PiccoloViewerUi instance will be generated by the PiccoloViewerProvider.
Author:
chsch, ckru
  • Field Details

  • Constructor Details

    • PiccoloViewerUI

      public PiccoloViewerUI(ContextViewer parentViewer, org.eclipse.swt.widgets.Composite parent)
      Creates a Piccolo2D viewer with default style.
      Parameters:
      parentViewer - the parent ContextViewer
      parent - the parent composite
    • PiccoloViewerUI

      public PiccoloViewerUI(ContextViewer parentViewer, org.eclipse.swt.widgets.Composite parent, int style)
      Creates a Piccolo2D viewer with given style.
      Parameters:
      parentViewer - the parent ContextViewer
      parent - the parent composite
      style - the style attributes
  • Method Details

    • getLabelTextWidget

      protected org.eclipse.swt.custom.StyledText getLabelTextWidget()
      Getter providing the employed StyledText SWT widget, e.g. for installing additional event Listeners.
      Returns:
      the employed StyledText widget.
    • addLabelTextWidget

      protected void addLabelTextWidget(ContextViewer parentViewer)
      Adds a text widget to the viewer that can be used to select and edit texts.
      Parameters:
      parentViewer - the viewer to which to add the text widget
    • attachLabelTextWidgetEventListener

      protected void attachLabelTextWidgetEventListener(org.eclipse.swt.custom.StyledText textLabelWidget)
      Extension hook method registering an SWT event Listener on the employed textLabelWidget.
      Parameters:
      textLabelWidget - the employed instance of StyledText
    • updateSelection

      protected void updateSelection(IKlighdSelection selection)
      Asynchronously executes the super method #updateSelection(IKlighdSelection) in order to let the calling method terminate quickly and do not block any display modifications.
      Overrides:
      updateSelection in class AbstractViewer
      Parameters:
      selection - the new IKlighdSelection to be propagated to the selection service.
    • createDiagramOutlinePage

      protected PiccoloOutlinePage createDiagramOutlinePage()
      Overrides:
      createDiagramOutlinePage in class PiccoloViewer