Search in sources :

Example 76 with TableViewerColumn

use of org.eclipse.jface.viewers.TableViewerColumn in project cubrid-manager by CUBRID.

the class BrokerConfigEditComposite method createBrokerConfTableData.

/**
	 * Create table data by CubridBrokerConf model
	 */
public void createBrokerConfTableData() {
    // remove column
    int oldCount = confTableViewer.getTable().getColumnCount();
    for (int i = 0; i < oldCount; i++) {
        confTableViewer.getTable().getColumn(0).dispose();
    }
    // create column
    TableViewerColumn column = new TableViewerColumn(confTableViewer, SWT.LEFT);
    column.getColumn().setWidth(150);
    column.getColumn().setText(Messages.cubridBrokerConfEditorColumnPropName);
    column.setEditingSupport(new PropValueEditingSupport(confTableViewer, 0));
    for (int i = 0; i < brokerConfig.getPropertyList().size(); i++) {
        TableViewerColumn propColumn = new TableViewerColumn(confTableViewer, SWT.LEFT);
        propColumn.getColumn().setWidth(160);
        propColumn.getColumn().setText(Messages.cubridBrokerConfEditorBrokerTitle + i);
        propColumn.setEditingSupport(new PropValueEditingSupport(confTableViewer, i + 1));
        propColumn.getColumn().addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                noOp();
            }
        });
    }
    confTableViewer.setLabelProvider(confTableLabelProvider);
    confTableViewer.setInput(confListData);
    confListData.clear();
    confListData.addAll(editorPart.parseBrokerConfigToCommonTableValue(brokerConfig));
    confTableViewer.refresh();
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Point(org.eclipse.swt.graphics.Point) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 77 with TableViewerColumn

use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.

the class ExportTbxDialog method createColumn.

/**
	 * 创建Table列
	 * @param viewer
	 *            ;
	 */
private void createColumn(final TableViewer viewer) {
    String[] clmnTitles = { Messages.getString("dialog.ExportTbxDialog.clmnTitles1"), Messages.getString("dialog.ExportTbxDialog.clmnTitles2"), Messages.getString("dialog.ExportTbxDialog.clmnTitles3"), Messages.getString("dialog.ExportTbxDialog.clmnTitles4") };
    int[] clmnBounds = { 50, 80, 100, 100 };
    TableViewerColumn col = createTableViewerColumn(viewer, clmnTitles[0], clmnBounds[0], 0);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getIndex();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[1], clmnBounds[1], 1);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getDbBean().getDbType();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[2], clmnBounds[2], 2);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getDbBean().getDatabaseName();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[3], clmnBounds[3], 3);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getExistLangs();
        }
    });
}
Also used : ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn) ExportDatabaseBean(net.heartsome.cat.database.bean.ExportDatabaseBean)

Example 78 with TableViewerColumn

use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.

the class ExportTbxDialog method createTableViewerColumn.

/**
	 * 设置TableViewer 列属性
	 * @param viewer
	 * @param title
	 *            列标题
	 * @param bound
	 *            列宽
	 * @param colNumber
	 *            列序号
	 * @return {@link TableViewerColumn};
	 */
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) {
    final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize);
    final TableColumn column = viewerColumn.getColumn();
    column.setText(title);
    column.setWidth(bound);
    column.setResizable(true);
    column.setMoveable(true);
    return viewerColumn;
}
Also used : TableColumn(org.eclipse.swt.widgets.TableColumn) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 79 with TableViewerColumn

use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.

the class ProjectSettingTBPage method createTableViewerColumn.

/**
	 * 设置TableViewer 列属性
	 * @param viewer
	 * @param title
	 *            列标题
	 * @param bound
	 *            列宽
	 * @param colNumber
	 *            列序号
	 * @return {@link TableViewerColumn};
	 */
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) {
    final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize);
    final TableColumn column = viewerColumn.getColumn();
    column.setText(title);
    column.setWidth(bound);
    column.setResizable(true);
    column.setMoveable(true);
    return viewerColumn;
}
Also used : TableColumn(org.eclipse.swt.widgets.TableColumn) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 80 with TableViewerColumn

use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.

the class ExportTmxDialog method createColumn.

/**
	 * 创建Table列
	 * @param viewer
	 *            ;
	 */
private void createColumn(final TableViewer viewer) {
    String[] clmnTitles = { Messages.getString("dialog.ExportTmxDialog.clmnTitles1"), Messages.getString("dialog.ExportTmxDialog.clmnTitles2"), Messages.getString("dialog.ExportTmxDialog.clmnTitles3"), Messages.getString("dialog.ExportTmxDialog.clmnTitles4") };
    int[] clmnBounds = { 50, 80, 100, 100 };
    TableViewerColumn col = createTableViewerColumn(viewer, clmnTitles[0], clmnBounds[0], 0);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getIndex();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[1], clmnBounds[1], 1);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getDbBean().getDbType();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[2], clmnBounds[2], 2);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getDbBean().getDatabaseName();
        }
    });
    col = createTableViewerColumn(viewer, clmnTitles[3], clmnBounds[3], 3);
    col.setLabelProvider(new ColumnLabelProvider() {

        public String getText(Object element) {
            ExportDatabaseBean bean = (ExportDatabaseBean) element;
            return bean.getExistLangs();
        }
    });
}
Also used : ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn) ExportDatabaseBean(net.heartsome.cat.database.bean.ExportDatabaseBean)

Aggregations

TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)134 TableViewer (org.eclipse.jface.viewers.TableViewer)72 Composite (org.eclipse.swt.widgets.Composite)53 GridData (org.eclipse.swt.layout.GridData)52 SelectionEvent (org.eclipse.swt.events.SelectionEvent)45 TableColumn (org.eclipse.swt.widgets.TableColumn)41 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)36 GridLayout (org.eclipse.swt.layout.GridLayout)32 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)28 Table (org.eclipse.swt.widgets.Table)25 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)19 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)16 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)16 Point (org.eclipse.swt.graphics.Point)15 TableColumnLayout (org.eclipse.jface.layout.TableColumnLayout)14 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)14 FillLayout (org.eclipse.swt.layout.FillLayout)14 Button (org.eclipse.swt.widgets.Button)14 Image (org.eclipse.swt.graphics.Image)13 Text (org.eclipse.swt.widgets.Text)11