All Implemented Interfaces:
com.levigo.jadice.web.client.ui.internal.DefaultPopupExecutor.Focusable, MenuContributor, Command, WidgetCommand
Direct Known Subclasses:

public class TextEditor extends WidgetBasedAnnotationPropertyEditor implements com.levigo.jadice.web.client.ui.internal.DefaultPopupExecutor.Focusable
  • Constructor Details

  • Method Details

    • getEditorWidth

      public int getEditorWidth()
      Returns the editor width in px.
      The editor width in px.
    • setEditorWidth

      public void setEditorWidth(int width)
      Set the editor width.
      width - The editor width in px.
    • getEditorHeight

      public int getEditorHeight()
      Returns the editor height in px.
      The editor height in px.
    • setEditorHeight

      public void setEditorHeight(int editorHeight)
      Set the editor height.
      editorHeight - height in px.
    • init

      public void init(Collection<? extends ShapeBasedAnnotation> selectedItems, PropertyProfile<?> profile, Page page, RenderControls renderControls, AnnotationTool annoTool, UndoManager undoManager)
      init in class AnnotationPropertyEditor
    • createWidget

      public createWidget(Collection<Object> args)
      Specified by:
      createWidget in interface WidgetCommand
    • computeEditorWidth

      protected int computeEditorWidth(Point2D transformedSize)
      Computes the editor width with the size of the selected annotation.
      transformedSize - The point to be used.
      The computed width.
    • computeEditorHeight

      protected int computeEditorHeight(Point2D transformedSize)
      Computes the editor height with the size of the selected annotation.
      transformedSize - The point to be used.
      The computed height
    • focus

      public void focus()
      set the cursor to the first position and return the textArea so that the DefaultPopupExecutor can focus it.
      Specified by:
      focus in interface com.levigo.jadice.web.client.ui.internal.DefaultPopupExecutor.Focusable
    • setGlobalAnnotationChangeAllowed

      public void setGlobalAnnotationChangeAllowed(boolean isGlobalAnnotationChangeAllowed)
      Set to true, if document permissions allow changing annotations. The enclosed text area will be enabled according to this global permission in combination with the annotation specific change permissions.
      isGlobalAnnotationChangeAllowed - True, if global change is allowed, false else.
    • applyText

      public void applyText()
      Applies the text of the text area to the annotation and change the annotation back to its initial colors.
    • getTextArea

      public getTextArea()
    • discardText

      public void discardText()
      Resets to the initial status of the annotation in case text changes are discarded. Since the annotation colors are set transparent before opening the text editor the colors have to be reset to the initial state. It is also important to set the modified status to the initial state because discarding the changes should not change the modified status of the annotation.
    • updateHeight

      public void updateHeight()
      If the scroll height is bigger than the text area height, it will be adapted.
    • adjustCalloutBounds

      protected void adjustCalloutBounds()
      Adjust the anchor points of the CalloutAnnotation
    • setCalloutHeight

      protected void setCalloutHeight(double height)
      Set new height for CalloutAnnotation
      height - the new height for the annotation