/*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    checkNetworkStatus();
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    Composite composite = new Composite(parent, SWT.BORDER);
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);
    composite.setLayoutData(layoutData);
    tableViewerCreator = new TableViewerCreator<ModuleToInstall>(composite);
    tableViewerCreator.setCheckboxInFirstColumn(false);
    tableViewerCreator.setColumnsResizableByDefault(true);
    tableViewerCreator.setLinesVisible(true);
    tableViewerCreator.setLayoutMode(LAYOUT_MODE.CONTINUOUS);

    tableViewerCreator.createTable();

    createJarNameColumn();
    createModuleNameColumn();
    createContextColumn();
    createRequiredColumn();
    createLicenseColumn();

    urlcolumn = createMoreInformationColumn();

    installcolumn = createActionColumn();

    tableViewerCreator.init(inputList);
    addInstallButtons();
    layoutData = new GridData(GridData.FILL_BOTH);
    tableViewerCreator.getTable().setLayoutData(layoutData);
    tableViewerCreator.getTable().pack();

    Composite footComposite = new Composite(composite, SWT.NONE);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    footComposite.setLayoutData(layoutData);
    layout = new GridLayout();
    layout.numColumns = 2;
    footComposite.setLayout(layout);

    final Link moreInfor = new Link(footComposite, SWT.NONE);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.widthHint = 200;
    moreInfor.setText(Messages.getString("ExternalModulesInstallDialog_MoreInfor")); // $NON-NLS-1$
    moreInfor.setLayoutData(layoutData);
    moreInfor.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            //
            // Program.launch(Messages.getString("download.external.dialog.help.url"));
            // //$NON-NLS-1$
            openURL(Messages.getString("download.external.dialog.help.url")); // $NON-NLS-1$
          }
        });
    setupColumnSortListener();
    createFooter(composite);
    setTitle(title);
    return composite;
  }
  /**
   * DOC ocarbone Comment method "addTreeNavigator".
   *
   * @param parent
   * @param width
   * @param height
   */
  private void addTreeNavigator(Composite parent, int width, int height) {
    // Group
    Group group =
        Form.createGroup(
            parent,
            1,
            Messages.getString("DatabaseTableForm.navigatorTree"),
            height); //$NON-NLS-1$

    // ScrolledComposite
    ScrolledComposite scrolledCompositeFileViewer =
        new ScrolledComposite(group, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
    scrolledCompositeFileViewer.setExpandHorizontal(true);
    scrolledCompositeFileViewer.setExpandVertical(true);
    GridData gridData1 = new GridData(GridData.FILL_BOTH);
    gridData1.widthHint = width + 12;
    gridData1.heightHint = height;
    gridData1.horizontalSpan = 2;
    scrolledCompositeFileViewer.setLayoutData(gridData1);

    tableViewerCreator = new TableViewerCreator(scrolledCompositeFileViewer);
    tableViewerCreator.setHeaderVisible(false);
    tableViewerCreator.setColumnsResizableByDefault(false);
    tableViewerCreator.setBorderVisible(false);
    tableViewerCreator.setLinesVisible(false);
    tableViewerCreator.setLayoutMode(LAYOUT_MODE.NONE);
    tableViewerCreator.setCheckboxInFirstColumn(false);
    tableViewerCreator.setFirstColumnMasked(false);

    tableNavigator = tableViewerCreator.createTable();
    tableNavigator.setLayoutData(new GridData(GridData.FILL_BOTH));

    TableColumn tableColumn = new TableColumn(tableNavigator, SWT.NONE);
    tableColumn.setText(
        Messages.getString("DatabaseTableForm.tableColumnText.talbe")); // $NON-NLS-1$
    tableColumn.setWidth(width + 120);

    scrolledCompositeFileViewer.setContent(tableNavigator);
    scrolledCompositeFileViewer.setSize(width + 12, height);

    // // Button Add metadata Table
    Composite button =
        Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER);
    addTableButton =
        new UtilsButton(
            button,
            Messages.getString("DatabaseTableForm.AddTable"),
            width - 30,
            HEIGHT_BUTTON_PIXEL); //$NON-NLS-1$

    Composite rmButton =
        Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER);
    removeTableButton =
        new UtilsButton(rmButton, "Remove Schema", width - 30, HEIGHT_BUTTON_PIXEL); // $NON-NLS-1$
  }
Exemplo n.º 3
0
 @Override
 protected void setTableViewerCreatorOptions(
     TableViewerCreator<IMetadataColumn> newTableViewerCreator) {
   super.setTableViewerCreatorOptions(newTableViewerCreator);
   newTableViewerCreator.setLayoutMode(LAYOUT_MODE.DEFAULT);
 }