Search in sources :

Example 91 with TableViewerColumn

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

the class UnifyHostConfigEditor method createCubridConfTabItem.

/**
	 * create cubrid table
	 */
public void createCubridConfTabItem() {
    Composite comp = new Composite(confTabFolder, SWT.NONE);
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    comp.setLayout(new GridLayout(1, false));
    cubridConfTableCTabItem = new CTabItem(confTabFolder, SWT.NONE);
    cubridConfTableCTabItem.setText(CUBRIDCONFCONFIGFILENAME);
    cubridConfTabTableViewer = new TableViewer(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    cubridConfTabTableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    cubridConfTabTableViewer.getTable().setHeaderVisible(true);
    cubridConfTabTableViewer.getTable().setLinesVisible(true);
    cubridConfTabTableViewer.setUseHashlookup(true);
    //create column
    TableViewerColumn column = new TableViewerColumn(cubridConfTabTableViewer, SWT.LEFT);
    column.getColumn().setWidth(0);
    column.getColumn().setText("");
    cubridConfTabTableViewer.setContentProvider(new UnifyHostCubridConfTableContentProvider());
    cubridConfTabTableViewer.setLabelProvider(new UnifyHostCubridConfTableLabelProvider());
    //use to mark click point, the right click menu use this point
    cubridConfTabTableViewer.getTable().addListener(SWT.MouseDown, new Listener() {

        public void handleEvent(Event event) {
            cubridConfTableClickPoint = new Point(event.x, event.y);
            cubridConfTableClickPointTiming = System.currentTimeMillis();
        }
    });
    registerCubridConfTableContextMenu();
    cubridConfTableCTabItem.setControl(comp);
    if (confTabFolder.getSelection() == null) {
        confTabFolder.setSelection(cubridConfTableCTabItem);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ICellEditorListener(org.eclipse.jface.viewers.ICellEditorListener) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FocusEvent(org.eclipse.swt.events.FocusEvent) MenuEvent(org.eclipse.swt.events.MenuEvent) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Point(org.eclipse.swt.graphics.Point) CTabItem(org.eclipse.swt.custom.CTabItem) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 92 with TableViewerColumn

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

the class UnifyHostConfigEditor method createCubridHAConfTabItem.

/**
	 * create cubrid HA table
	 */
public void createCubridHAConfTabItem() {
    Composite comp = new Composite(confTabFolder, SWT.NONE);
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    comp.setLayout(new GridLayout(1, false));
    CTabItem tableCTabItem = new CTabItem(confTabFolder, SWT.NONE);
    tableCTabItem.setText("cubrid_ha.conf");
    TableViewer cubridHAConfTabTableViewer = new TableViewer(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    cubridHAConfTabTableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    cubridHAConfTabTableViewer.getTable().setHeaderVisible(true);
    cubridHAConfTabTableViewer.getTable().setLinesVisible(true);
    cubridHAConfTabTableViewer.setUseHashlookup(true);
    //create column
    TableViewerColumn column = new TableViewerColumn(cubridHAConfTabTableViewer, SWT.LEFT);
    column.getColumn().setWidth(0);
    column.getColumn().setText("");
    //		
    //		brokerConfTabTableViewer.setContentProvider(new BrokerConfTableContentProvider());
    //		brokerConfTabTableViewer.setLabelProvider(new BrokerConfTableLabelProvider());
    //		brokerConfTabTableViewer.setSorter(new BrokerConfTableViewerSorter());
    tableCTabItem.setControl(comp);
    if (confTabFolder.getSelection() == null) {
        confTabFolder.setSelection(tableCTabItem);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) CTabItem(org.eclipse.swt.custom.CTabItem) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 93 with TableViewerColumn

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

the class UnifyHostConfigEditor method createCubridACLConfTabItem.

/**
	 * create cubrid ACL table
	 */
public void createCubridACLConfTabItem() {
    Composite comp = new Composite(confTabFolder, SWT.NONE);
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    comp.setLayout(new GridLayout(1, false));
    CTabItem tableCTabItem = new CTabItem(confTabFolder, SWT.NONE);
    tableCTabItem.setText("acl.conf");
    TableViewer cubridACLConfTabTableViewer = new TableViewer(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    cubridACLConfTabTableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    cubridACLConfTabTableViewer.getTable().setHeaderVisible(true);
    cubridACLConfTabTableViewer.getTable().setLinesVisible(true);
    cubridACLConfTabTableViewer.setUseHashlookup(true);
    //create column
    TableViewerColumn column = new TableViewerColumn(cubridACLConfTabTableViewer, SWT.LEFT);
    column.getColumn().setWidth(0);
    column.getColumn().setText("");
    //		
    //		brokerConfTabTableViewer.setContentProvider(new BrokerConfTableContentProvider());
    //		brokerConfTabTableViewer.setLabelProvider(new BrokerConfTableLabelProvider());
    //		brokerConfTabTableViewer.setSorter(new BrokerConfTableViewerSorter());
    tableCTabItem.setControl(comp);
    if (confTabFolder.getSelection() == null) {
        confTabFolder.setSelection(tableCTabItem);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) CTabItem(org.eclipse.swt.custom.CTabItem) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 94 with TableViewerColumn

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

the class DBAuthComparator method createUsersTable.

/**
	 * create user table
	 * 
	 * @param parent
	 */
public void createUsersTable(Composite parent) {
    userTableViewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
    userTableViewer.getTable().setHeaderVisible(false);
    userTableViewer.getTable().setLinesVisible(false);
    userTableViewer.getTable().setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
    final TableViewerColumn nameColumn = new TableViewerColumn(userTableViewer, SWT.LEFT);
    nameColumn.getColumn().setWidth(200);
    userTableViewer.setContentProvider(new UserContentProvider());
    userTableViewer.setLabelProvider(new UserLabelProvider());
    registerContextMenu();
    userTableViewer.getTable().addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            TableItem[] items = userTableViewer.getTable().getSelection();
            if (items.length == 1) {
                UserDetailInfo userInfo = (UserDetailInfo) items[0].getData();
                setAuthDetailInfoTableViewer(userInfo);
            }
        }
    });
}
Also used : SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn) SelectionListener(org.eclipse.swt.events.SelectionListener) UserDetailInfo(com.cubrid.cubridmanager.core.cubrid.user.model.UserDetailInfo)

Example 95 with TableViewerColumn

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

the class TriggerDashboardEditorPart method createTriggersDetailInfoTable.

/**
	 * create table
	 * @param parent
	 */
public void createTriggersDetailInfoTable(Composite parent) {
    final Composite tableComposite = new Composite(parent, SWT.NONE);
    tableComposite.setLayout(new FillLayout());
    tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    triggersDetailInfoTable = new TableViewer(tableComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    triggersDetailInfoTable.getTable().setHeaderVisible(true);
    triggersDetailInfoTable.getTable().setLinesVisible(true);
    final TableViewerColumn nameColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    nameColumn.getColumn().setWidth(150);
    nameColumn.getColumn().setText(Messages.triggersDetailInfoPartTableNameCol);
    final TableViewerColumn targetTableColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    targetTableColumn.getColumn().setWidth(120);
    targetTableColumn.getColumn().setText(Messages.triggersDetailInfoPartTableTargetTableCol);
    final TableViewerColumn eventTypeColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    eventTypeColumn.getColumn().setWidth(150);
    eventTypeColumn.getColumn().setText(Messages.triggersDetailInfoPartTableEventTypeCol);
    final TableViewerColumn triggerStatusColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    triggerStatusColumn.getColumn().setWidth(100);
    triggerStatusColumn.getColumn().setText(Messages.triggersDetailInfoPartTableTriggerStatusCol);
    final TableViewerColumn triggerPriorityColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    triggerPriorityColumn.getColumn().setWidth(120);
    triggerPriorityColumn.getColumn().setText(Messages.triggersDetailInfoPartTableTriggerPriorityCol);
    final TableViewerColumn executionTimeColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    executionTimeColumn.getColumn().setWidth(100);
    executionTimeColumn.getColumn().setText(Messages.triggersDetailInfoPartTableExecutionTimeCol);
    final TableViewerColumn actionTypeColumn = new TableViewerColumn(triggersDetailInfoTable, SWT.LEFT);
    actionTypeColumn.getColumn().setWidth(150);
    actionTypeColumn.getColumn().setText(Messages.triggersDetailInfoPartTableActionTypeCol);
    triggersDetailInfoTable.setComparator(new ColumnViewerSorter());
    triggersDetailInfoTable.setContentProvider(new TriggersDetailTableViewerContentProvider());
    triggersDetailInfoTable.setLabelProvider(new TriggersTableViewerLabelProvider());
    registerContextMenu();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

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