Search in sources :

Example 26 with TableLayout

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

the class BrokerDashboardViewPart method updateTableLayout.

/**
	 * Update table layout
	 */
private void updateTableLayout() {
    TableLayout basicLayout = new TableLayout();
    brokerTablePart.setBasicLayout(basicLayout);
    basicTableViewer.getTable().setLayout(basicLayout);
    basicTableViewer.getTable().layout();
    TableLayout asLayout = new TableLayout();
    brokerTablePart.setAsLayout(asLayout);
    asTableViewer.getTable().setLayout(asLayout);
    asTableViewer.getTable().layout();
    TableLayout jqLayout = new TableLayout();
    brokerTablePart.setJqLayout(jqLayout);
    jqTableViewer.getTable().setLayout(jqLayout);
    jqTableViewer.getTable().layout();
}
Also used : TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 27 with TableLayout

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

the class ShardEnvStatusView method updateTableLayout.

/**
	 * Update table layout
	 */
private void updateTableLayout() {
    TableLayout tlayout = new TableLayout();
    for (BrokerEnvStatusColumn column : BrokerEnvStatusColumn.values()) {
        if (column.getValue() == -1) {
            tlayout.addColumnData(new ColumnWeightData(0, 0, false));
        } else {
            tlayout.addColumnData(new ColumnWeightData(10, 40, true));
        }
    }
    tableViewer.getTable().setLayout(tlayout);
    tableViewer.getTable().layout(true);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) TableLayout(org.eclipse.jface.viewers.TableLayout) BrokerEnvStatusColumn(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)

Example 28 with TableLayout

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

the class BrokerStatusView method updateTableLayout.

/**
	 * Update table layout
	 */
private void updateTableLayout() {
    if (basicTableViewer != null) {
        TableLayout basicLayout = new TableLayout();
        setBasicLayout(basicLayout);
        basicTableViewer.getTable().setLayout(basicLayout);
        basicTableViewer.getTable().layout();
    }
    TableLayout asLayout = new TableLayout();
    setAsLayout(asLayout);
    asTableViewer.getTable().setLayout(asLayout);
    asTableViewer.getTable().layout();
    TableLayout jqLayout = new TableLayout();
    setJqLayout(jqLayout);
    jqTableViewer.getTable().setLayout(jqLayout);
    jqTableViewer.getTable().layout();
}
Also used : TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 29 with TableLayout

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

the class BrokerStatusView method createJobTable.

/**
	 * Create job table composite
	 * 
	 * @param comp the composite
	 * 
	 */
private void createJobTable(Composite comp) {
    Composite jobComposite = new Composite(comp, SWT.NONE);
    GridData gdJob = new GridData(SWT.FILL, SWT.FILL, true, true);
    jobComposite.setLayoutData(gdJob);
    jobComposite.setLayout(new GridLayout());
    final Label label = new Label(jobComposite, SWT.CENTER);
    label.setText(Messages.jobTblTitle);
    jqTableViewer = new TableViewer(jobComposite, SWT.FULL_SELECTION | SWT.NO_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    jqTableViewer.getTable().setHeaderVisible(true);
    jqTableViewer.getTable().setLinesVisible(true);
    TableLayout jqLayout = new TableLayout();
    setJqLayout(jqLayout);
    jqTableViewer.getTable().setLayout(jqLayout);
    jqTableViewer.getTable().setLayoutData(gdJob);
    TableColumn tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblJobId);
    tblColumn.setToolTipText(Messages.tblJobId);
    tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblJobPriority);
    tblColumn.setToolTipText(Messages.tblJobPriority);
    tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblJobAddress);
    tblColumn.setToolTipText(Messages.tblJobAddress);
    tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblJobTime);
    tblColumn.setToolTipText(Messages.tblJobTime);
    tblColumn = new TableColumn(jqTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblJobRequest);
    tblColumn.setToolTipText(Messages.tblJobRequest);
    jqTableViewer.setContentProvider(new JobContentProvider());
    jqTableViewer.setLabelProvider(new JobLabelProvider());
    jqTableViewer.setInput(jobinfoLst);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TableViewer(org.eclipse.jface.viewers.TableViewer) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 30 with TableLayout

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

the class BrokerStatusView method makeActions.

/**
	 * This method is to create actions at tool bar
	 * 
	 */
private void makeActions() {
    Action columnAction = new Action() {

        public void run() {
            BrokerStatusSettingDlg settingDlg = new BrokerStatusSettingDlg(null);
            ServerInfo serverInfo = brokerNode.getServer().getServerInfo();
            settingDlg.setServerInfo(serverInfo);
            if (settingDlg.open() == Dialog.OK) {
                refreshLayout();
            }
        }

        /**
			 * refresh table layout
			 */
        private void refreshLayout() {
            //refresh basic info table
            if (isSupportNewBrokerParamPropery) {
                TableLayout basicLayout = new TableLayout();
                setBasicLayout(basicLayout);
                basicTableViewer.getTable().setLayout(basicLayout);
                basicTableViewer.getTable().layout();
            }
            //refresh apply server table
            TableLayout asLayout = new TableLayout();
            setAsLayout(asLayout);
            asTableViewer.getTable().setLayout(asLayout);
            asTableViewer.getTable().layout();
            //refresh job queue table
            TableLayout jqLayout = new TableLayout();
            setJqLayout(jqLayout);
            jqTableViewer.getTable().setLayout(jqLayout);
            jqTableViewer.getTable().layout();
        }
    };
    columnAction.setText(Messages.columnSettingTxt);
    columnAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(columnAction);
}
Also used : Action(org.eclipse.jface.action.Action) BrokerStatusSettingDlg(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerStatusSettingDlg) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ApplyServerInfo(com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo) TableLayout(org.eclipse.jface.viewers.TableLayout) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

TableLayout (org.eclipse.jface.viewers.TableLayout)46 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)23 GridData (org.eclipse.swt.layout.GridData)23 TableColumn (org.eclipse.swt.widgets.TableColumn)20 Table (org.eclipse.swt.widgets.Table)18 TableViewer (org.eclipse.jface.viewers.TableViewer)16 Composite (org.eclipse.swt.widgets.Composite)16 GridLayout (org.eclipse.swt.layout.GridLayout)15 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 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)4 BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)4 Point (org.eclipse.swt.graphics.Point)4 Event (org.eclipse.swt.widgets.Event)4 Listener (org.eclipse.swt.widgets.Listener)4 Menu (org.eclipse.swt.widgets.Menu)4 CommonUITool.trimPaintColor (com.cubrid.common.ui.spi.util.CommonUITool.trimPaintColor)3 ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)3