Search in sources :

Example 11 with TableLayout

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

the class BrokerStatusView method createBasicTable.

/**
	 * Create basic info table
	 * 
	 * @param comp the parent composite
	 * 
	 */
private void createBasicTable(Composite comp) {
    final Composite basicComposite = new Composite(comp, SWT.NONE);
    GridData gdBasic = new GridData(SWT.FILL, SWT.NONE, false, false);
    basicComposite.setLayoutData(gdBasic);
    basicComposite.setLayout(new GridLayout());
    basicTableViewer = new TableViewer(basicComposite, SWT.NO_SCROLL | SWT.BORDER);
    Table basicTable = basicTableViewer.getTable();
    basicTable.setHeaderVisible(true);
    basicTable.setLinesVisible(true);
    GridData tblBasic = new GridData(SWT.FILL, SWT.TOP, true, false);
    tblBasic.heightHint = CommonUITool.getHeightHintOfTable(basicTable);
    basicTable.setLayoutData(tblBasic);
    TableLayout basicLayout = new TableLayout();
    setBasicLayout(basicLayout);
    basicTable.setLayout(basicLayout);
    basicTable.setBackground(basicComposite.getBackground());
    TableColumn tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscPid);
    tblColumn.setToolTipText(Messages.tblBscPid);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscPort);
    tblColumn.setToolTipText(Messages.tblBscPort);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscJobQueue);
    tblColumn.setToolTipText(Messages.tblBscJobQueue);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscAutoAddAs);
    tblColumn.setToolTipText(Messages.tblBscAutoAddAs);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscSqlLogMode);
    tblColumn.setToolTipText(Messages.tblBscSqlLogMode);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscLongTranTime);
    tblColumn.setToolTipText(Messages.tblBscLongTranTime);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscLongQueryTime);
    tblColumn.setToolTipText(Messages.tblBscLongQueryTime);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscSessionTimeout);
    tblColumn.setToolTipText(Messages.tblBscSessionTimeout);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscKeepConn);
    tblColumn.setToolTipText(Messages.tblBscKeepConn);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscAccessMode);
    tblColumn.setToolTipText(Messages.tblBscAccessMode);
    basicTableViewer.setContentProvider(new BrokerBasicInfoContentProvider());
    ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
    BrokerBasicInfoLabelProvider basicInfoLabelProvider = new BrokerBasicInfoLabelProvider();
    basicInfoLabelProvider.setServerInfo(serverInfo);
    basicTableViewer.setLabelProvider(basicInfoLabelProvider);
    basicTableViewer.setInput(basicInfoLst);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ApplyServerInfo(com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 12 with TableLayout

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

the class NewDirectoryDialog method createDirectoryList.

/**
	 * create the directory list
	 * 
	 * @param composite the parent composite
	 */
private void createDirectoryList(Composite composite) {
    directoryList = new Table(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
    directoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    directoryList.setLinesVisible(true);
    directoryList.setHeaderVisible(true);
    directoryList.setEnabled(false);
    TableLayout tableLayout = new TableLayout();
    tableLayout.addColumnData(new ColumnWeightData(20, true));
    directoryList.setLayout(tableLayout);
    final TableColumn currentVolumeColumn = new TableColumn(directoryList, SWT.LEFT);
    currentVolumeColumn.setText(Messages.tblColDirectoryVolume);
    currentVolumeColumn.pack();
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Table(org.eclipse.swt.widgets.Table) GridData(org.eclipse.swt.layout.GridData) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 13 with TableLayout

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

the class OptimizeDialog method createDialogArea.

/**
	 * Create dialog area content
	 *
	 * @param parent the parent composite
	 * @return the control
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    final Composite composite = new Composite(parentComp, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    composite.setLayout(layout);
    final Group dbNameGroup = new Group(composite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    dbNameGroup.setLayout(layout);
    final GridData gdDbNameGroup = new GridData(GridData.FILL_HORIZONTAL);
    dbNameGroup.setLayoutData(gdDbNameGroup);
    final Label dbNameLabel = new Label(dbNameGroup, SWT.LEFT | SWT.WRAP);
    dbNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    dbNameLabel.setText(Messages.lblOptimizeDbName);
    databaseName = new Text(dbNameGroup, SWT.BORDER);
    databaseName.setEnabled(false);
    final GridData gdDatabaseName = new GridData(SWT.FILL, SWT.FILL, true, false);
    databaseName.setLayoutData(gdDatabaseName);
    final Label optimizeLabel = new Label(dbNameGroup, SWT.WRAP);
    optimizeLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    optimizeLabel.setText(Messages.lblOptimizeClassName);
    GridData gdClassName = new org.eclipse.swt.layout.GridData(SWT.FILL, SWT.FILL, true, false);
    className = new Combo(dbNameGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
    className.setLayoutData(gdClassName);
    className.setVisibleItemCount(15);
    final Group descGroup = new Group(composite, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    descGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    descGroup.setLayout(layout);
    descGroup.setText(Messages.grpOptimizeDesc);
    final Label descriptionLabel = new Label(descGroup, SWT.WRAP);
    descriptionLabel.setText(Messages.lblOptimizeDesc);
    descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    volumeTable = new Table(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.READ_ONLY);
    volumeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    volumeTable.setLinesVisible(false);
    volumeTable.setHeaderVisible(false);
    TableLayout tableLayout = new TableLayout();
    volumeTable.setLayout(tableLayout);
    final TableColumn currentVolumeColumn = new TableColumn(volumeTable, SWT.LEFT);
    currentVolumeColumn.setText("");
    currentVolumeColumn.pack();
    setMessage(Messages.msgOptimizeDbInformation);
    setTitle(Messages.titleOptimizeDbDialog);
    initial();
    return parentComp;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 14 with TableLayout

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

the class DiagStatusMonitorTemplateDialog method createTableSelectedItem.

/**
	 * This method initializes tableSelectedItem
	 * 
	 */
private void createTableSelectedItem() {
    TableLayout tlayout = new TableLayout();
    tlayout.addColumnData(new ColumnWeightData(150, 150, true));
    tlayout.addColumnData(new ColumnWeightData(150, 150, true));
    tagetTbl.setLayout(tlayout);
    TableColumn categoryColumn = new TableColumn(tagetTbl, SWT.CENTER);
    categoryColumn.setText(DIAG_CATEGORY);
    TableColumn nameColumn = new TableColumn(tagetTbl, SWT.CENTER);
    nameColumn.setText(DIAG_NAME);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 15 with TableLayout

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

the class ChartCompositePart method updateSettingTable.

/**
	 * Update the setting table
	 *
	 * @param selectedItem the selected item
	 * @param checked whether show in the table
	 * @param rgb the item background color
	 */
private void updateSettingTable(String selectedItem, boolean checked, RGB rgb) {
    org.eclipse.swt.graphics.Color color = new org.eclipse.swt.graphics.Color(composite.getDisplay(), rgb);
    int index = 0;
    for (Map.Entry<String, ShowSetting> entry : settingMap.entrySet()) {
        if (entry.getKey().equals(selectedItem)) {
            entry.getValue().setChecked(checked);
            entry.getValue().setSeriesRgb(rgb);
            seriesTableViewer.getTable().getItem(0).setBackground(index + 1, color);
        }
        index++;
    }
    TableLayout seriesLayout = new TableLayout();
    setSeriesTableLayout(seriesLayout);
    seriesTableViewer.getTable().setLayout(seriesLayout);
    seriesTableViewer.getTable().layout(true);
}
Also used : Color(java.awt.Color) CommonUITool.trimPaintColor(com.cubrid.common.ui.spi.util.CommonUITool.trimPaintColor) Map(java.util.Map) TreeMap(java.util.TreeMap) TableLayout(org.eclipse.jface.viewers.TableLayout)

Aggregations

TableLayout (org.eclipse.jface.viewers.TableLayout)43 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)22 GridData (org.eclipse.swt.layout.GridData)22 TableColumn (org.eclipse.swt.widgets.TableColumn)19 Table (org.eclipse.swt.widgets.Table)17 GridLayout (org.eclipse.swt.layout.GridLayout)15 Composite (org.eclipse.swt.widgets.Composite)15 TableViewer (org.eclipse.jface.viewers.TableViewer)14 Label (org.eclipse.swt.widgets.Label)10 ColumnPixelData (org.eclipse.jface.viewers.ColumnPixelData)8 TableItem (org.eclipse.swt.widgets.TableItem)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)4 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)4 BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)4 Event (org.eclipse.swt.widgets.Event)4 Listener (org.eclipse.swt.widgets.Listener)4 CommonUITool.trimPaintColor (com.cubrid.common.ui.spi.util.CommonUITool.trimPaintColor)3 Color (java.awt.Color)3 Map (java.util.Map)3