Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 146812 Details for
Bug 73012
[CTabFolder] setEnabled for CTabItems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
test case
Bug_73012.java (text/java), 1.99 KB, created by
Lakshmi P Shanmugam
on 2009-09-09 16:44:17 EDT
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Lakshmi P Shanmugam
Created:
2009-09-09 16:44:17 EDT
Size:
1.99 KB
patch
obsolete
>package bug.snippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.CTabFolder; >import org.eclipse.swt.custom.CTabItem; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > >public class Bug_73012 { > public static void main (String [] args) { > Display display = new Display (); > > final Shell shell = new Shell (display); > shell.setLayout(new GridLayout()); > final CTabFolder folder = new CTabFolder(shell, SWT.NONE); > folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > > final Button b = new Button(folder, SWT.PUSH); > b.setText("button "); > final Text t = new Text(folder, SWT.NONE); > t.setText("text"); > for (int i = 0; i < 4; i++) { > CTabItem item = new CTabItem(folder, SWT.CLOSE ); > item.setText("Item&"+i); > if (i%2 == 0) item.setControl(t); > else item.setControl(b); > item.setToolTipText("item" + i); > } > folder.setSelection(0); > final CTabItem item = folder.getItem(1); > item.setEnabled(false); > > Button button = new Button(shell, SWT.PUSH); > button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, > false)); > button.setText("enable/disable tab 1"); > button.addListener(SWT.Selection, new Listener() { > public void handleEvent(Event event) { > item.setEnabled(!item.getEnabled()); > } > }); > > Button button1 = new Button(shell, SWT.PUSH); > button1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, > false)); > button1.setText("enable/disable control"); > button1.addListener(SWT.Selection, new Listener() { > public void handleEvent(Event event) { > b.setEnabled(!b.getEnabled()); > } > }); > > shell.open (); > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > display.dispose (); >} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 73012
:
146811
| 146812 |
147320