@Override
  public void bind() throws Exception {
    GUI.getView().setTitle("Felddefinition");

    final FelddefinitionControl control = new FelddefinitionControl(this);

    LabelGroup group = new LabelGroup(getParent(), "Felddefinition");
    group.addLabelPair("Name", control.getName(true));
    group.addLabelPair("Label", control.getLabel());
    group.addLabelPair("Datentyp", control.getDatentyp());
    group.addLabelPair("Länge", control.getLaenge());

    ButtonArea buttons = new ButtonArea();
    buttons.addButton(
        "Hilfe",
        new DokumentationAction(),
        DokumentationUtil.FELDDEFINITIONEN,
        false,
        "help-browser.png");
    buttons.addButton("Übersicht", new FelddefinitionenAction());
    buttons.addButton(
        "speichern",
        new Action() {

          @Override
          public void handleAction(Object context) {
            control.handleStore();
          }
        },
        null,
        true,
        "document-save.png");
    buttons.paint(this.getParent());
  }
Пример #2
0
  /** @see de.willuhn.jameica.gui.dialogs.AbstractDialog#paint(org.eclipse.swt.widgets.Composite) */
  protected void paint(Composite parent) throws Exception {
    LabelGroup group = new LabelGroup(parent, i18n.tr("Auswahl des Import-Filters"));
    group.addText(i18n.tr("Bitte wählen Sie das gewünschte Dateiformat für den Import aus"), true);

    Input formats = getImporterList();
    group.addLabelPair(i18n.tr("Verfügbare Formate:"), formats);

    ButtonArea buttons = new ButtonArea(parent, 2);
    Button button =
        new Button(
            i18n.tr("Import starten"),
            new Action() {
              public void handleAction(Object context) throws ApplicationException {
                doImport();
              }
            },
            null,
            true);
    button.setEnabled(!(formats instanceof LabelInput));
    buttons.addButton(button);
    buttons.addButton(
        i18n.tr("Abbrechen"),
        new Action() {
          public void handleAction(Object context) throws ApplicationException {
            throw new OperationCanceledException();
          }
        });
    getShell().setMinimumSize(getShell().computeSize(WINDOW_WIDTH, SWT.DEFAULT));
  }