Search in sources :

Example 1 with BrokerEnvStatusSettingDlg

use of com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusSettingDlg in project cubrid-manager by CUBRID.

the class BrokerEnvStatusView method makeActions.

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

        public void run() {
            BrokerEnvStatusSettingDlg settingDlg = new BrokerEnvStatusSettingDlg(null);
            if (settingDlg.open() == Dialog.OK) {
                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();
            }
        }
    };
    columnAction.setText(Messages.envColumnSettingTxt);
    columnAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(columnAction);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) BrokerEnvStatusSettingDlg(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusSettingDlg) TableLayout(org.eclipse.jface.viewers.TableLayout) BrokerEnvStatusColumn(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)1 BrokerEnvStatusSettingDlg (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusSettingDlg)1 Action (org.eclipse.jface.action.Action)1 IToolBarManager (org.eclipse.jface.action.IToolBarManager)1 ColumnWeightData (org.eclipse.jface.viewers.ColumnWeightData)1 TableLayout (org.eclipse.jface.viewers.TableLayout)1 IActionBars (org.eclipse.ui.IActionBars)1