use of org.eclipse.jface.action.StatusLineManager in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method clearStatusLine.
/**
*
* Clear the status line information of CUBRID Query
*
*/
public void clearStatusLine() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
if (window instanceof WorkbenchWindow) {
StatusLineManager statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
if (statusLineManager != null) {
statusLineManager.remove(RESTORE_QUERY_EDITORS_CONTR_ID);
statusLineManager.remove(UPDATE_APP_CONTR_ID);
statusLineManager.remove(DB_INFO_CONTR_ID);
statusLineManager.remove(OBJ_NUM_INFO_CONTR_ID);
statusLineManager.update(true);
}
}
}
use of org.eclipse.jface.action.StatusLineManager in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method updateStatusLineForRestoreQueryEditor.
private void updateStatusLineForRestoreQueryEditor() {
final int countOfRestorableQueryEditors = ApplicationPersistUtil.getInstance().countOfRestorableQueryEditorsAtLastSession();
if (countOfRestorableQueryEditors <= 0) {
return;
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
StatusLineManager statusLineManager = null;
if (window instanceof WorkbenchWindow) {
statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
}
if (statusLineManager == null) {
return;
}
IContributionItem scaleItem = new ControlContribution(RESTORE_QUERY_EDITORS_CONTR_ID) {
protected Control createControl(Composite parent) {
Button btn = new Button(parent, SWT.None);
String buttonTitle = Messages.bind(com.cubrid.common.ui.common.Messages.restoreQueryEditorTitle, countOfRestorableQueryEditors);
btn.setText(buttonTitle);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ActionManager manager = ActionManager.getInstance();
IAction action = manager.getAction(RestoreQueryEditorAction.ID);
if (action != null && action instanceof RestoreQueryEditorAction) {
action.run();
}
}
});
return btn;
}
;
};
statusLineManager.add(scaleItem);
}
use of org.eclipse.jface.action.StatusLineManager in project ACS by ACS-Community.
the class MyStatusBar method createControls.
@PostConstruct
void createControls(Composite parent, MToolControl toolControl) {
if (!toolControl.isVisible()) {
System.out.println("Skipping creation of status bar as it is marked invisible in the model.");
return;
}
slm = new StatusLineManager();
slm.createControl(parent);
slm.setMessage("Refresh service data to get correct supplier/consumer info.");
}
Aggregations