jface ApplicationWindow [message #458893] |
Mon, 25 July 2005 18:36 |
Eclipse User |
|
|
|
Originally posted by: hansm.science.uva.nlDELETE
It seems that in jface.ApplicationWindow I cannot make the addCoolBar mechanism
work, whereas addToolBar does allright.
Code extract:
public class XYZ extends ApplicationWindow{...
protected ToolBarManager createToolBarManager(int style) {
ToolBarManager toolbarManager = new ToolBarManager();
// THE NEXT STATEMENT WORKS, ADDS ACTION.
toolbarManager.add(someAction);
return toolbarManager;
}
addToolBar(SWT.FLAT)
OR:
protected CoolBarManager createCoolBarManager(int style) {
CoolBarManager coolbarManager = new CoolBarManager();
// THE NEXT STATEMENT DOES NOT WORK, ADDS NOTHING
coolbarManager.add(someAction);
return coolbarManager;
// How for example can I put a Combo into the coolbar here?
}
addCoolBar(SWT.FLAT);
One of the problems making other solutions impossible (e.g. creating a coolbar
by myself, etc. and adding it) is the fact that the controls involved are not
realized before the open call. I guess the first moment the parent Shell can be
accessed is in the call to createContents, too late to do something with the
setup of bars and statusline.
Same sort of problem occurs with addStatusLine(). I have not been able to set
the layout of the statusline at its construction (subclassed it), because
ApplicationWindow makes its layout inaccessible.
StatusLineLayoutData layout = new StatusLineLayoutData();
cannot be used for example, because for the same reason createControl cannot be
executed on the statusline. I am thus prohibited to set width and height hints,
for example.
Is this known behaviour, i.e. limitations inherent to jface ApplicationWindow?
Or am I just misunderstanding proper usage.
thanks in advance for your opinion.
Hans van der Meer
|
|
|
Powered by
FUDForum. Page generated in 0.02691 seconds