use of org.eclipse.swt.custom.CBanner in project netxms by netxms.
the class MobileApplicationWorkbenchWindowAdvisor method postWindowCreate.
/* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowCreate()
*/
@Override
public void postWindowCreate() {
super.postWindowCreate();
BindingService service = (BindingService) getWindowConfigurer().getWindow().getWorkbench().getService(IBindingService.class);
BindingManager bindingManager = service.getBindingManager();
try {
// $NON-NLS-1$
bindingManager.setActiveScheme(service.getScheme("org.netxms.ui.eclipse.defaultKeyBinding"));
} catch (NotDefinedException e) {
e.printStackTrace();
}
final Shell shell = getWindowConfigurer().getWindow().getShell();
shell.setMaximized(true);
for (Control ctrl : shell.getChildren()) {
// $NON-NLS-1$
ctrl.setData(RWT.CUSTOM_VARIANT, "gray");
if (ctrl instanceof CBanner) {
for (Control cc : ((CBanner) ctrl).getChildren()) // $NON-NLS-1$
cc.setData(RWT.CUSTOM_VARIANT, "gray");
} else if (// $NON-NLS-1$
ctrl.getClass().getName().equals("org.eclipse.swt.widgets.Composite")) {
for (Control cc : ((Composite) ctrl).getChildren()) // $NON-NLS-1$
cc.setData(RWT.CUSTOM_VARIANT, "gray");
}
}
// $NON-NLS-1$
shell.getMenuBar().setData(RWT.CUSTOM_VARIANT, "menuBar");
}
use of org.eclipse.swt.custom.CBanner in project netxms by netxms.
the class ApplicationWorkbenchWindowAdvisor method postWindowCreate.
/* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowCreate()
*/
@Override
public void postWindowCreate() {
super.postWindowCreate();
NXCSession session = (NXCSession) ConsoleSharedData.getSession();
// Changes the page title at runtime
JavaScriptExecutor executor = RWT.getClient().getService(JavaScriptExecutor.class);
if (executor != null) {
StringBuilder js = new StringBuilder();
// $NON-NLS-1$
js.append("document.title = ");
js.append("\"");
js.append(BrandingManager.getInstance().getProductName());
js.append(" - [");
js.append(session.getUserName());
js.append("@");
js.append(session.getServerAddress());
js.append("]");
js.append("\"");
executor.execute(js.toString());
}
BindingService service = (BindingService) getWindowConfigurer().getWindow().getWorkbench().getService(IBindingService.class);
BindingManager bindingManager = service.getBindingManager();
try {
// $NON-NLS-1$
bindingManager.setActiveScheme(service.getScheme("org.netxms.ui.eclipse.defaultKeyBinding"));
} catch (NotDefinedException e) {
e.printStackTrace();
}
final Shell shell = getWindowConfigurer().getWindow().getShell();
shell.setMaximized(true);
for (Control ctrl : shell.getChildren()) {
// $NON-NLS-1$
ctrl.setData(RWT.CUSTOM_VARIANT, "gray");
if (ctrl instanceof CBanner) {
for (Control cc : ((CBanner) ctrl).getChildren()) // $NON-NLS-1$
cc.setData(RWT.CUSTOM_VARIANT, "gray");
} else if (// $NON-NLS-1$
ctrl.getClass().getName().equals("org.eclipse.swt.widgets.Composite")) {
for (Control cc : ((Composite) ctrl).getChildren()) // $NON-NLS-1$
cc.setData(RWT.CUSTOM_VARIANT, "gray");
}
}
Menu menuBar = shell.getMenuBar();
if (menuBar != null)
// $NON-NLS-1$
menuBar.setData(RWT.CUSTOM_VARIANT, "menuBar");
}
Aggregations