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

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.
      Returns:
      The editor width in px.
    • setEditorWidth

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

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

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

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

      public com.google.gwt.user.client.ui.IsWidget 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.
      Parameters:
      transformedSize - The point to be used.
      Returns:
      The computed width.
    • computeEditorHeight

      protected int computeEditorHeight(Point2D transformedSize)
      Computes the editor height with the size of the selected annotation.
      Parameters:
      transformedSize - The point to be used.
      Returns:
      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.
      Parameters:
      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 com.google.gwt.user.client.ui.TextArea 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
      Parameters:
      height - the new height for the annotation