|
Re: HowTo avoid minimal size of text in ControlContribution in Local Toolbar? [message #336961 is a reply to message #336941] |
Thu, 16 July 2009 13:34 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ralf Buschermoehle![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=buschermoehle%40offis.de) Messages: 81 Registered: July 2009 |
Member |
|
|
Hello,
the "problem" is that I don't create a new ToolBar / ToolBarManager but
try to use the existing one ->
IActionBars bars = getViewSite().getActionBars(); IToolBarManager
toolBarManager = bars.getToolBarManager();
Is is possible (re-)configure the ToolBar of toolBarManager?
Greetings,
Ralf
Ralf Buschermoehle wrote:
> Hello,
>
> I would like to have a resizable textfield in a toolbar.
>
> public class SearchAndExecuteField extends ControlContribution {
>
> protected SearchAndExecuteField(String id) {
> super(id);
> }
>
> @Override
> protected Control createControl(Composite parent) {
> nsURIField = new Text(parent, SWT.SINGLE | SWT.BORDER);
> nsURIField.setText("<search, execute>");
> GridData gridData = new GridData(GridData.FILL_HORIZONTAL,
> GridData.FILL_VERTICAL, true, true);
> nsURIField.setLayoutData(gridData);
> return nsURIField;
> }
> }
>
> Positioned with:
>
> private void fillLocalToolBar(IToolBarManager manager) {
> manager.add(new SearchAndExecuteField("<search, execute>"));
>
> Unfortunately the textfield has the minimal possible size ... ?
>
> Any hints how to stretch the textfield?
>
> Greetings,
>
> Ralf
|
|
|
Re: HowTo avoid minimal size of text in ControlContribution in Local Toolbar? [message #646070 is a reply to message #336941] |
Tue, 21 December 2010 19:59 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Danny T.![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=danny.trunk%40gmx.de) Messages: 1 Registered: December 2010 |
Junior Member |
|
|
Hi,
did you solved this?
Because I have the same issue...
Best regards,
Danny.
EDIT: I just found this way - but it's not dynamically filled:
public class SearchAndExecuteField extends ControlContribution {
protected SearchAndExecuteField(String id) {
super(id);
}
@Override
protected Control createControl(Composite parent) {
nsURIField = new Text(parent, SWT.SINGLE | SWT.BORDER);
nsURIField.setText("<search, execute>");
return nsURIField;
}
@Override
protected int computeWidth(Control control) {
return 200;
}
}
[Updated on: Thu, 23 December 2010 01:06] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02192 seconds