Search in sources :

Example 21 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project GT by Tencent.

the class SMAPSView method createLocalToolBar.

private void createLocalToolBar() {
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(openLogAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 22 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project GT by Tencent.

the class StubAnalysisView method createLocalToolBar.

private void createLocalToolBar() {
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(openLogOnPCAction);
    manager.add(openLogOnPhoneAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 23 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project dbeaver by serge-rider.

the class BaseBrowserView method createBrowser.

private Browser createBrowser(Composite parent, final IActionBars actionBars) {
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    parent.setLayout(gridLayout);
    browser = new Browser(parent, SWT.NONE);
    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.FILL;
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = true;
    browser.setLayoutData(data);
    browser.addProgressListener(new ProgressAdapter() {

        IProgressMonitor monitor = actionBars.getStatusLineManager().getProgressMonitor();

        boolean working = false;

        int workedSoFar;

        @Override
        public void changed(ProgressEvent event) {
            if (event.total == 0)
                return;
            if (!working) {
                if (event.current == event.total)
                    return;
                //$NON-NLS-1$
                monitor.beginTask("", event.total);
                workedSoFar = 0;
                working = true;
            }
            monitor.worked(event.current - workedSoFar);
            workedSoFar = event.current;
        }

        @Override
        public void completed(ProgressEvent event) {
            monitor.done();
            working = false;
        }
    });
    browser.addStatusTextListener(new StatusTextListener() {

        IStatusLineManager status = actionBars.getStatusLineManager();

        @Override
        public void changed(StatusTextEvent event) {
            status.setMessage(event.text);
        }
    });
    browser.addLocationListener(new LocationAdapter() {

        @Override
        public void changed(LocationEvent event) {
            backAction.setEnabled(browser.isBackEnabled());
            forwardAction.setEnabled(browser.isForwardEnabled());
        //                if (event.top)
        //                    location.setText(event.location);
        }
    });
    browser.addTitleListener(new TitleListener() {

        @Override
        public void changed(TitleEvent event) {
            setPartName(event.title);
        }
    });
    /*
        browser.addOpenWindowListener(new OpenWindowListener() {
            public void open(WindowEvent event) {
                BaseBrowserView.this.openWindow(event);
            }
        });
*/
    // TODO: should handle VisibilityWindowListener.show and .hide events
    browser.addCloseWindowListener(new CloseWindowListener() {

        @Override
        public void close(WindowEvent event) {
            BaseBrowserView.this.close();
        }
    });
    /*
        location.addSelectionListener(new SelectionAdapter() {
            public void widgetDefaultSelected(SelectionEvent e) {
                browser.setUrl(location.getText());
            }
        });
*/
    // Hook the navigation actons as handlers for the retargetable actions
    // defined in BrowserActionBuilder.
    //$NON-NLS-1$
    actionBars.setGlobalActionHandler("back", backAction);
    //$NON-NLS-1$
    actionBars.setGlobalActionHandler("forward", forwardAction);
    //$NON-NLS-1$
    actionBars.setGlobalActionHandler("stop", stopAction);
    //$NON-NLS-1$
    actionBars.setGlobalActionHandler("refresh", refreshAction);
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    toolBarManager.add(backAction);
    toolBarManager.add(forwardAction);
    toolBarManager.add(stopAction);
    toolBarManager.add(refreshAction);
    backAction.setEnabled(false);
    forwardAction.setEnabled(false);
    return browser;
}
Also used : IStatusLineManager(org.eclipse.jface.action.IStatusLineManager) GridLayout(org.eclipse.swt.layout.GridLayout) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IToolBarManager(org.eclipse.jface.action.IToolBarManager) GridData(org.eclipse.swt.layout.GridData)

Example 24 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager 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 25 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager 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

IToolBarManager (org.eclipse.jface.action.IToolBarManager)37 IActionBars (org.eclipse.ui.IActionBars)19 Action (org.eclipse.jface.action.Action)18 RecordAction (com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction)6 Separator (org.eclipse.jface.action.Separator)6 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)4 IMenuManager (org.eclipse.jface.action.IMenuManager)4 DropDownAction (com.cubrid.common.ui.common.action.DropDownAction)3 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)3 IAction (org.eclipse.jface.action.IAction)3 MenuManager (org.eclipse.jface.action.MenuManager)3 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)3 ToolBarManager (org.eclipse.jface.action.ToolBarManager)3 TableLayout (org.eclipse.jface.viewers.TableLayout)3 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 IContributionItem (org.eclipse.jface.action.IContributionItem)2 SearchContributionComposite (com.cubrid.common.ui.common.control.SearchContributionComposite)1 BrokerEnvStatusColumn (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerEnvStatusColumn)1