コード例 #1
0
 TagExternalizationWizardPage(final TagExternalizationWizardType descriptor) {
   super(
       descriptor.getPageId(),
       descriptor.equals(TagExternalizationWizardType.IMPORT)
           ? TaggerMessages.TagImportWizardPage_Title
           : TaggerMessages.TagExportWizardPage_Title,
       null);
   this.descriptor = descriptor;
 }
コード例 #2
0
  public void createControl(Composite parent) {
    final Composite panel = new Composite(parent, SWT.NULL);
    panel.setLayout(new GridLayout(3, false));

    // path
    createLabel(
        panel,
        TaggerMessages.TagIoWizardPage_Label_File,
        descriptor.equals(TagExternalizationWizardType.IMPORT)
            ? TaggerMessages.TagImportWizardPage_Tooltip_File
            : TaggerMessages.TagExportWizardPage_Tooltip_File,
        1);

    filePath = new Text(panel, SWT.BORDER | SWT.SINGLE);
    filePath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    filePath.setEditable(false);
    filePath.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            dialogChanged();
          }
        });

    final Button directoryBtn = new Button(panel, SWT.PUSH);
    directoryBtn.setText(TaggerMessages.TagIoWizardPage_Button_Browse);
    directoryBtn.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            final FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
            final String path = dialog.open();
            filePath.setText(path != null ? path : EMPTY_STRING);
          }
        });

    // export format
    createLabel(
        panel,
        TaggerMessages.TagIoWizardPage_Label_Format,
        TaggerMessages.TagIoWizardPage_Tooltip_Format,
        3);

    xmlFormatBtn = new Button(panel, SWT.RADIO);
    xmlFormatBtn.setLayoutData(createGridData(3));
    xmlFormatBtn.setText(TaggerMessages.TagIoWizardPage_Format_Xml);
    xmlFormatBtn.setData(TagIoFormat.XML);
    xmlFormatBtn.setSelection(true);

    csvFormatBtn = new Button(panel, SWT.RADIO);
    csvFormatBtn.setLayoutData(createGridData(3));
    csvFormatBtn.setText(TaggerMessages.TagIoWizardPage_Format_Csv);
    csvFormatBtn.setData(TagIoFormat.CSV);

    dialogChanged();
    setControl(panel);
  }