コード例 #1
0
  /**
   * TODO summary sentence for createControl ...
   *
   * @param parent
   * @param klisten
   * @return Generated composite
   */
  public Composite createControl(Composite parent, KeyListener klisten) {
    this.part =
        AbstractSimpleConfigurator.subpart(parent, Messages.SimpleStyleConfigurator_label_label);
    this.klisten = klisten;

    this.on = new Button(part, SWT.CHECK);

    this.field = new Combo(part, SWT.DROP_DOWN | SWT.READ_ONLY);
    this.field.addKeyListener(klisten);
    if (this.schema != null) {
      List<AttributeDescriptor> types = this.schema.getAttributeDescriptors();
      List<String> typeStrings = new ArrayList<String>();
      for (AttributeDescriptor attributeDescriptor : types) {
        typeStrings.add(attributeDescriptor.getLocalName());
      }
      this.field.setItems(typeStrings.toArray(new String[0]));
    }
    this.field.setToolTipText(Messages.LabelViewer_field_tooltip);

    this.fonter = new FontEditor(part);

    // determine which placement to use
    if (schema != null) {
      if (SLD.isLine(schema)) {
        pointPlacement = false;
      } else {
        pointPlacement = true;
      }
      if (pointPlacement) {
        // point placement (3 combos: AnchorPoint (Horiz, Vert) + Rotation)
        initPlacementContentsPoint();
      } else {
        // line placement (1 combo: Perpendicular Offset)
        initPlacementContentsLine();
      }
    }

    listen(true);

    return part;
  }
コード例 #2
0
 public void modifyText(final ModifyEvent e) {
   sync(AbstractSimpleConfigurator.selectionEvent(e));
 };