|
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 |
Ralf Buschermoehle 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 |
Danny T. 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.03074 seconds