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);
}
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;
}
use of org.eclipse.jface.action.IToolBarManager 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);
}
use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.
the class DbDashboardHistoryViewPart method makeActions.
/**
* This method is to create actions at tool bar
*
*/
private void makeActions() {
Action settingAction = new Action() {
public void run() {
fireChartSetting();
}
};
settingAction.setText(Messages.chartSettingTxt);
settingAction.setToolTipText(Messages.chartSettingTxt);
settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
final IActionBars bars = getViewSite().getActionBars();
IToolBarManager manager = bars.getToolBarManager();
manager.add(settingAction);
}
use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.
the class HostDashboardViewPart method makeActions.
/**
* This method is to create actions at tool bar
*
*/
private void makeActions() {
Action settingAction = new Action() {
public void run() {
fireChartSetting();
}
};
settingAction.setText(Messages.chartSettingTxt);
settingAction.setToolTipText(Messages.chartSettingTxt);
settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
final IActionBars bars = getViewSite().getActionBars();
IToolBarManager manager = bars.getToolBarManager();
manager.add(settingAction);
RecordAction recordAction = new RecordAction();
recordAction.setRecorder(this);
recordAction.setPrepareTooltip(Messages.hostDashboardMonitorStartRecordTooltip);
recordAction.setRecordTooltip(Messages.hostDashboardRecordingTooltip);
recordAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/monitor/prepare_record.png"));
recordAction.setToolTipText(Messages.hostDashboardMonitorStartRecordTooltip);
manager.add(recordAction);
}
Aggregations