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);
}
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 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);
}
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);
}
Aggregations