Search in sources :

Example 1 with BrokerStatusSettingDlg

use of com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerStatusSettingDlg 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)

Example 2 with BrokerStatusSettingDlg

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

the class BrokerDashboardViewPart 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.getParent().getServerInfo();
            settingDlg.setServerInfo(serverInfo);
            settingDlg.setAppendDiag(true);
            if (settingDlg.open() == Dialog.OK) {
                refreshLayout();
            }
        }

        /**
			 * refresh table layout
			 */
        private void refreshLayout() {
            //refresh basic info table
            TableLayout basicLayout = new TableLayout();
            brokerTablePart.setBasicLayout(basicLayout);
            basicTableViewer.getTable().setLayout(basicLayout);
            basicTableViewer.getTable().layout();
            //refresh apply server table
            TableLayout asLayout = new TableLayout();
            brokerTablePart.setAsLayout(asLayout);
            asTableViewer.getTable().setLayout(asLayout);
            asTableViewer.getTable().layout();
            //refresh job queue table
            TableLayout jqLayout = new TableLayout();
            brokerTablePart.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

ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 BrokerStatusSettingDlg (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerStatusSettingDlg)2 Action (org.eclipse.jface.action.Action)2 IToolBarManager (org.eclipse.jface.action.IToolBarManager)2 TableLayout (org.eclipse.jface.viewers.TableLayout)2 IActionBars (org.eclipse.ui.IActionBars)2