Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TableLayout


              item.setText(0, rootItem.getPathName());
              item.setText(1, rootItem.getFolder().getProjectRelativePath().toString());
              item.setData(rootItem);
      }
     
      TableLayout tableLayout = new TableLayout();
     
      GridData data = new GridData(GridData.FILL_BOTH);
      this.table.setLayoutData(data);
     
      TableColumn col = new TableColumn(table, SWT.NONE);
      col.setText(Messages.ProjectPropertyPage_TablePathName);
      ColumnWeightData colData = new ColumnWeightData(10, 100, true);
      tableLayout.addColumnData(colData);

      col = new TableColumn(table, SWT.NONE);
      col.setText(Messages.ProjectPropertyPage_TableHtdocsFolder);
      colData = new ColumnWeightData(10, 100, true);
      tableLayout.addColumnData(colData);
      table.setLayout(tableLayout);
     
      this.tableEditor = new TableEditor(table);
      this.tableEditor.horizontalAlignment = SWT.LEFT;
      this.tableEditor.grabHorizontal = true;
View Full Code Here


        table.setFont(font);

        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        final TableLayout tableLayout = new TableLayout();
        table.setLayout(tableLayout);

        final TableColumn column1 = new TableColumn(table, SWT.NULL);
        column1.setWidth(80);
        column1.setText(RuntimePreferenceMessages.name);
View Full Code Here

    }

    private void createColumns() {

        final Tree tree = viewer.getTree();
        final TableLayout layout = new TableLayout();
        TreeViewerColumn column;
        final String[] names = {
                "Kind", "Function", org.erlide.debug.ui.views.ActionMessages.getString("DebuggerTraceView.5") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        for (final String name : names) {
            column = new TreeViewerColumn(viewer, SWT.NONE);
            final TreeColumn treeColumn = column.getColumn();
            treeColumn.setResizable(true);
            treeColumn.setMoveable(true);
            treeColumn.addSelectionListener(new SelectionListener() {

                @Override
                public void widgetDefaultSelected(final SelectionEvent e) {
                }

                @Override
                public void widgetSelected(final SelectionEvent e) {
                }
            });

            // column.getColumn().setData(MARKER_FIELD, markerField);
            // Show the help in the first column
            column.setLabelProvider(new ColumnLabelProvider());
            treeColumn.setText(name);
            treeColumn.setToolTipText(name);
        }
        // column = new TreeViewerColumn(viewer, SWT.NONE);
        // treeColumn = column.getColumn();
        // treeColumn.setResizable(true);
        // treeColumn.setMoveable(true);
        // column.setLabelProvider(new ColumnLabelProvider());
        // column.getColumn().setImage(markerField.getColumnHeaderImage());

        // final EditingSupport support = markerField
        // .getEditingSupport(viewer);
        // if (support != null) {
        // column.setEditingSupport(support);
        // }

        // if (builder.getPrimarySortField().equals(markerField)) {
        // updateDirectionIndicator(column.getColumn(), markerField);
        // }

        int columnWidth = -1;

        for (int i = 0; i < names.length; ++i) {
            if (i == 0) {
                // Compute and store a font metric
                final GC gc = new GC(tree);
                gc.setFont(tree.getFont());
                final FontMetrics fontMetrics = gc.getFontMetrics();
                gc.dispose();
                columnWidth = Math.max(100, fontMetrics.getAverageCharWidth() * 20);
            }

            // if (columnWidths != null) {
            // final Integer value = columnWidths.getInteger(getFieldId(column
            // .getColumn()));
            //
            // // Make sure we get a useful value
            // if (value != null && value.intValue() > 0) {
            // columnWidth = value.intValue();
            // }
            // }

            // // Take trim into account if we are using the default value, but
            // not
            // // if it is restored.
            // if (columnWidth < 0) {
            // layout.addColumnData(new ColumnPixelData(markerField
            // .getDefaultColumnWidth(tree), true, true));
            // } else {
            layout.addColumnData(new ColumnPixelData(columnWidth, true));
            // }
        }
        // }

        // Remove extra columns
View Full Code Here

            if (fTableColumns == null) {
                fTable = createTableViewer(parent);
                final Table tableControl = fTable.getTable();

                fTableControl = tableControl;
                tableControl.setLayout(new TableLayout());
            } else {
                final TableLayoutComposite composite = new TableLayoutComposite(parent,
                        SWT.NONE);
                fTableControl = composite;
View Full Code Here

          };
        viewerPane.createControl(getContainer());
        tableViewer = (TableViewer)viewerPane.getViewer();

        Table table = tableViewer.getTable();
        TableLayout layout = new TableLayout();
        table.setLayout(layout);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        TableColumn objectColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(3, 100, true));
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);

        TableColumn selfColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(2, 100, true));
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);

        tableViewer.setColumnProperties(new String [] {"a", "b"});
        tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
View Full Code Here

          };
        viewerPane.createControl(getContainer());
        tableViewer = (TableViewer)viewerPane.getViewer();

        Table table = tableViewer.getTable();
        TableLayout layout = new TableLayout();
        table.setLayout(layout);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        TableColumn objectColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(3, 100, true));
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);

        TableColumn selfColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(2, 100, true));
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);

        tableViewer.setColumnProperties(new String [] {"a", "b"});
        tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
View Full Code Here

  public Table createTable(Composite parent) {

    commandstable = new Table(parent, SWT.MULTI | SWT.BORDER);
    commandstable.setLayoutData(new GridData(GridData.FILL_BOTH));
    TableLayout tableLayout = new TableLayout();
    commandstable.setLayout(tableLayout);
    commandstable.setHeaderVisible(true);
    commandstable.setLinesVisible(true);

    TableColumn column = new TableColumn(commandstable, SWT.CENTER
        | SWT.BORDER_SOLID, 0);
    column.setText("Alias");
    ColumnWeightData columnLayout = new ColumnWeightData(200);
    tableLayout.addColumnData(columnLayout);

    column = new TableColumn(commandstable, SWT.CENTER | SWT.BORDER_SOLID,
        1);
    column.setText("Active");
    columnLayout = new ColumnWeightData(50);
    tableLayout.addColumnData(columnLayout);

    return commandstable;

  }
View Full Code Here

        newColumnTableColumn.setWidth(740);
        newColumnTableColumn.setText("Resources for Generate Diff of Post-commit");

        table.setHeaderVisible(true);// 显示表头
        table.setLinesVisible(true);// 显示表格线
        TableLayout tLayOut = new TableLayout();// 专用于表格的布局
        table.setLayout(tLayOut);
        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

        tLayOut.addColumnData(new ColumnWeightData(740));// ID列宽

        tableViewer.setContentProvider(new TableViewerContentProvider());
        tableViewer.setLabelProvider(new ResourceTableViewerLabelProvider());
        tableViewer.setInput(resourceList);
View Full Code Here

        });

        Tree tree = viewer.getTree();
        tree.setLayoutData(new GridData(GridData.FILL_BOTH));

        TableLayout layout = new TableLayout();
        layout.addColumnData(new ColumnWeightData(COLUMN_DEFAULT_WEIGHT, COLUMN_MIN_WITH, true));
        layout.addColumnData(new ColumnWeightData(COLUMN_DEFAULT_WEIGHT, COLUMN_MIN_WITH, true));
        layout.addColumnData(new ColumnWeightData(COLUMN_LIGHT_WEIGHT, COLUMN_MIN_WITH, true));
        layout.addColumnData(new ColumnWeightData(COLUMN_DEFAULT_WEIGHT, COLUMN_MIN_WITH, true));
        tree.setLayout(layout);

        new TreeColumn(tree, SWT.LEFT).setText("Organization");
        new TreeColumn(tree, SWT.LEFT).setText("Module");
        new TreeColumn(tree, SWT.LEFT).setText("Revision");
View Full Code Here

        if (tableViewer != null) {
            disposeTableViewer();
        }
        final Table table = new Table(parent, style);
        table.setLinesVisible(true);
        TableLayout layout = new TableLayout();
        table.setLayout(layout);

        FeatureTableContentProvider ftp = new FeatureTableContentProvider(this,
                this.progressMonitorProvider);
        FeatureTableLabelProvider flp = new FeatureTableLabelProvider(this);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TableLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.