[]
        
(Showing Draft Content)

IControlT

Interface IControlT>

All Superinterfaces:
IControl
All Known Subinterfaces:
IButton, ICheckBox, IDropDown, IGroupBox, ILabel, IListBox, IOptionButton, IScrollBar, ISpinner

public interface IControlT<T extends IControlT<T>> extends IControl
Provides generic operations that return the concrete form control type.

This interface extends IControl with typed members for duplicating a form control or relocating it by copy or cut operations. The generic type parameter preserves the specific control interface in the returned value.


 IButton button = worksheet.getControls().addButton(20, 20, 100, 24);
 IControlT<IButton> control = button;
 IButton copiedButton = control.copy(140, 20);
 IButton movedButton = control.cut(20, 60);
 IButton duplicatedButton = control.duplicate();
 
  • Method Details

    • copy

      T copy(double left, double top)
      Copy this control to the destination position.

      Creates a new control at the specified left and top position and returns the copied control as the same concrete control type.

      
       IButton button = worksheet.getControls().addButton(20, 20, 100, 24);
       button.setText("Submit");
       IButton copiedButton = button.copy(140, 20);
       copiedButton.setText("Submit Copy");
       
      Parameters:
      left - The left margin of the copied control.
      top - The top margin of the copied control.
      Returns:
      The copied control.
    • cut

      T cut(double left, double top)
      Cut this control and paste to the destination position.

      Moves the current control to the specified left and top position and returns the same control as the concrete control type.

      
       IButton button = worksheet.getControls().addButton(20, 20, 100, 24);
       button.setText("Submit");
       IButton movedButton = button.cut(140, 60);
       movedButton.setText("Moved Submit");
       
      Parameters:
      left - The left position of the destination control.
      top - The top position of the destination control.
      Returns:
      The moved control.
    • duplicate

      T duplicate()
      Copies this control to the default destination position.

      Creates a new control of the same type as this control and returns a reference to the copied control.

      
       IButton button = worksheet.getControls().addButton(20, 20, 100, 24);
       button.setText("Submit");
       IButton duplicatedButton = button.duplicate();
       duplicatedButton.setText("Submit Copy");
       
      Returns:
      The copied control.