How to exclude ToolBar from the composite
up vote
1
down vote
favorite
I have created a User Interface in SWT and I have a text box and a ToolItem in my composite. I am able to exclude the text box from the UI by using GridData.exclude and setVisible method of Text control when I select Disable Text box SWT button by using the below code.
buttonOne.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
GridData griddata = (GridData) txtInput.getLayoutData();
griddata.exclude = state;
txtInput.setVisible(!state);
txtInput.getParent().layout(false);
}
});
But I am not able to do the same with ToolBar. Now I have to make the Toolbar vanish/exclude which contains the tool item PUSH item from the user interface when I select the Disable ToolItem SWT button and bring it back If I select another SWT button.

java swt
add a comment |
up vote
1
down vote
favorite
I have created a User Interface in SWT and I have a text box and a ToolItem in my composite. I am able to exclude the text box from the UI by using GridData.exclude and setVisible method of Text control when I select Disable Text box SWT button by using the below code.
buttonOne.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
GridData griddata = (GridData) txtInput.getLayoutData();
griddata.exclude = state;
txtInput.setVisible(!state);
txtInput.getParent().layout(false);
}
});
But I am not able to do the same with ToolBar. Now I have to make the Toolbar vanish/exclude which contains the tool item PUSH item from the user interface when I select the Disable ToolItem SWT button and bring it back If I select another SWT button.

java swt
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
In my view it, griddata.exclude will not work withToolItemas it not swt control
– Shashwat
Nov 23 at 12:25
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have created a User Interface in SWT and I have a text box and a ToolItem in my composite. I am able to exclude the text box from the UI by using GridData.exclude and setVisible method of Text control when I select Disable Text box SWT button by using the below code.
buttonOne.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
GridData griddata = (GridData) txtInput.getLayoutData();
griddata.exclude = state;
txtInput.setVisible(!state);
txtInput.getParent().layout(false);
}
});
But I am not able to do the same with ToolBar. Now I have to make the Toolbar vanish/exclude which contains the tool item PUSH item from the user interface when I select the Disable ToolItem SWT button and bring it back If I select another SWT button.

java swt
I have created a User Interface in SWT and I have a text box and a ToolItem in my composite. I am able to exclude the text box from the UI by using GridData.exclude and setVisible method of Text control when I select Disable Text box SWT button by using the below code.
buttonOne.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
GridData griddata = (GridData) txtInput.getLayoutData();
griddata.exclude = state;
txtInput.setVisible(!state);
txtInput.getParent().layout(false);
}
});
But I am not able to do the same with ToolBar. Now I have to make the Toolbar vanish/exclude which contains the tool item PUSH item from the user interface when I select the Disable ToolItem SWT button and bring it back If I select another SWT button.

java swt
java swt
edited Nov 23 at 12:23
Shashwat
1,3351026
1,3351026
asked Nov 21 at 18:22
Subash J
1,2431620
1,2431620
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
In my view it, griddata.exclude will not work withToolItemas it not swt control
– Shashwat
Nov 23 at 12:25
add a comment |
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
In my view it, griddata.exclude will not work withToolItemas it not swt control
– Shashwat
Nov 23 at 12:25
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
In my view it, griddata.exclude will not work with
ToolItem as it not swt control– Shashwat
Nov 23 at 12:25
In my view it, griddata.exclude will not work with
ToolItem as it not swt control– Shashwat
Nov 23 at 12:25
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418343%2fhow-to-exclude-toolbar-from-the-composite%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Toolbar should work just the same. Show us a Minimal, Complete, and Verifiable example that we can actually test.
– greg-449
Nov 23 at 10:16
In my view it, griddata.exclude will not work with
ToolItemas it not swt control– Shashwat
Nov 23 at 12:25