Home
Categories
Dictionary
Download
Project Details
Changes Log
Who We Are
FAQ
License

Developing a Server widget



A Server widget implementation is a Java class which store the values of a widgets properties.

Classpath reference

The reference of the widget class classpath is specified in the Server widgets implementation configuration file. For example the PushButton widget wil be defined with the following element:
      <widget arincID="A661_PUSH_BUTTON">
         <path path="arinc661.server.model.arinc.ARINCPushButton"/>
      </widget>

Widget class specification

All widget classes must implement the ServerWidget interface. Generally "normal" widgets only have to declare fields which will store their associated widget properties.

Fields properties declaration

The widget class should have one public field for each widgets property. The declaration of the field should use the @Attr Java annotation, to sepcify which property is implemented. For example, to declare the implementation of the "A661_STRING" propety of the PushButton widget:
      @Attr(arincID = "A661_STRING")
      public String labelString = "";
The annotation can also declare the property "type" which will be useful for the widget renderer implementation. The available types are:
  • Attr.Type.PROPERTY for general properties
  • Attr.Type.SIZE for properties which represent a size, such as A661_SIZE_X
  • Attr.Type.POSITION for properties which represent a position, such as A661_POS_X
  • Attr.Type.CHILD for properties which represent a child reference attribute, such as A661_VISIBLE_CHILD
  • Attr.Type.COORDINATE for properties which represent a Map widget coordinate attribute, such as A661_RANGE
  • Attr.Type.BUFFEROFITEMS for properties which represent a BufferOfMapItem, such as as A661_BUFFER_OF_MAPITEM
The declaration of the property type is performed through the "type" attribute. For example:
      @Attr(arincID = "A661_SIZE_X", type = Attr.Type.SIZE)
      public long width;
Note that if no type is declared, the assumed type will be PROPERTY by default.

General widgets

General widgets can extend the AbstractBuiltinWidget class.

Containers declaration

A container widget should implement the ServerContainer interface. They also can extend the AbstractContainer class.

See also


Categories: dev | server

Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence