use of org.eclipse.jface.action.StatusLineManager in project tdi-studio-se by Talend.
the class SQLBuilderEditorComposite method createStatusArea.
/**
* Creates UI for status bar.
*
* @param parent
*/
private void createStatusArea(Composite parent) {
// create bottom status bar
Composite statusBar = new Composite(parent, SWT.NULL);
GridLayout statusBarLayout = new GridLayout();
statusBarLayout.numColumns = 3;
statusBarLayout.verticalSpacing = 0;
statusBarLayout.marginHeight = 0;
statusBarLayout.marginWidth = 0;
statusBarLayout.marginTop = 0;
statusBarLayout.marginBottom = 0;
statusBarLayout.marginRight = 5;
statusBarLayout.horizontalSpacing = 5;
statusBarLayout.verticalSpacing = 0;
statusBar.setLayout(statusBarLayout);
GridData statusBarGridData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
statusBarGridData.verticalIndent = 0;
statusBarGridData.horizontalIndent = 0;
statusBar.setLayoutData(statusBarGridData);
// add status line manager
StatusLineManager statusMgr = new StatusLineManager();
statusMgr.createControl(statusBar);
GridData c1Grid = new GridData();
c1Grid.horizontalAlignment = SWT.FILL;
c1Grid.verticalAlignment = SWT.BOTTOM;
c1Grid.grabExcessHorizontalSpace = true;
c1Grid.grabExcessVerticalSpace = false;
statusMgr.getControl().setLayoutData(c1Grid);
// add checkbox for limiting results
GridData c2Grid = new GridData();
c2Grid.horizontalAlignment = SWT.RIGHT;
c2Grid.verticalAlignment = SWT.CENTER;
c2Grid.grabExcessHorizontalSpace = false;
c2Grid.grabExcessVerticalSpace = false;
final Button limitResults = new Button(statusBar, SWT.CHECK);
//$NON-NLS-1$
limitResults.setText(Messages.getString("SQL_Limit_Rows_2"));
limitResults.setSelection(true);
limitResults.setLayoutData(c2Grid);
// add input field for result limit
GridData c3Grid = new GridData();
c3Grid.horizontalAlignment = SWT.RIGHT;
c3Grid.verticalAlignment = SWT.CENTER;
c3Grid.grabExcessHorizontalSpace = false;
c3Grid.grabExcessVerticalSpace = false;
c3Grid.widthHint = 30;
maxResultText = new Text(statusBar, SWT.BORDER | SWT.SINGLE);
maxResultText.setText(IConstants.MAX_SQL_ROWS);
maxResultText.setLayoutData(c3Grid);
limitResults.addMouseListener(new MouseAdapter() {
// enable/disable input field when checkbox is clicked
@Override
public void mouseUp(MouseEvent e) {
maxResultText.setEnabled(limitResults.getSelection());
ifLimit = limitResults.getSelection();
}
});
}
use of org.eclipse.jface.action.StatusLineManager in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method changeStuatusLineForNavigator.
/**
*
* Change status line for navigator selection
*
* @param selection the ISelection object
*/
public void changeStuatusLineForNavigator(ISelection selection) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
WorkbenchWindow workbenchWindow = null;
StatusLineManager statusLineManager = null;
if (window instanceof WorkbenchWindow) {
workbenchWindow = (WorkbenchWindow) window;
statusLineManager = workbenchWindow.getStatusLineManager();
}
//workbenchWindow.setStatus("");
clearStatusLine();
updateStatusLineForRestoreQueryEditor();
if (selection == null || selection.isEmpty()) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (!(obj instanceof ICubridNode)) {
return;
}
CubridNavigatorView navigatorView = CubridNavigatorView.findNavigationView();
boolean isShowGroup = navigatorView == null ? false : navigatorView.savedIsShowGroup();
ICubridNode cubridNode = (ICubridNode) obj;
String nodePath = cubridNode.getLabel();
ICubridNode parent = cubridNode.getParent();
while (parent != null) {
if (!isShowGroup && NodeType.GROUP.equals(parent.getType())) {
break;
}
nodePath = parent.getLabel() + "/" + nodePath;
parent = parent.getParent();
}
//workbenchWindow.setStatus(nodePath);
CubridServer server = cubridNode.getServer();
ServerInfo serverInfo = server == null ? null : server.getServerInfo();
if (serverInfo == null || !serverInfo.isConnected()) {
return;
}
if (statusLineManager != null) {
updateStatusLine(statusLineManager, cubridNode);
}
}
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 Manager
*
*/
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(SERVER_INFO_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 changeStuatusLineForNavigator.
/**
*
* Change status line for navigator selection
*
* @param selection the ISelection object
*/
public void changeStuatusLineForNavigator(ISelection selection) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
//window.setStatus("");
clearStatusLine();
updateStatusLineForRestoreQueryEditor();
if (selection == null || selection.isEmpty()) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (!(obj instanceof ICubridNode)) {
return;
}
CubridNavigatorView navigatorView = CubridNavigatorView.getNavigatorView(CubridQueryNavigatorView.ID);
boolean isShowGroup = false;
if (navigatorView != null) {
isShowGroup = navigatorView.isShowGroup();
}
ICubridNode cubridNode = (ICubridNode) obj;
String nodePath = cubridNode.getLabel();
ICubridNode parent = cubridNode.getParent();
while (parent != null) {
if (!isShowGroup && NodeType.GROUP.equals(parent.getType())) {
break;
}
nodePath = parent.getLabel() + "/" + nodePath;
parent = parent.getParent();
}
//window.setStatus(nodePath);
if (window instanceof WorkbenchWindow) {
StatusLineManager statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
if (statusLineManager != null) {
updateStatusLine(statusLineManager, cubridNode);
}
}
}
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