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 130838 Details for
Bug 193064
[CTabFolder] CtabItem pre-closure/pre-selection changed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
example to show how to use the page manager
TestComposite.java (text/java), 1.87 KB, created by
Lakshmi P Shanmugam
on 2009-04-03 10:31:55 EDT
(
hide
)
Description:
example to show how to use the page manager
Filename:
MIME Type:
Creator:
Lakshmi P Shanmugam
Created:
2009-04-03 10:31:55 EDT
Size:
1.87 KB
patch
obsolete
>package bug.snippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.CTabFolder; >import org.eclipse.swt.custom.CTabFolderPageManager; >import org.eclipse.swt.custom.CTabItem; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > >public class TestComposite extends Composite implements CTabFolderPageManager{ > > public TestComposite(Composite parent, int style) { > super(parent, style); > } > > /* Validate the text in the tab to make sure it is not empty */ > public boolean canLeaveThePage(int oldIndex, int newIndex) { > CTabFolder parent = (CTabFolder)getParent(); > Control c = parent.getItem(oldIndex).getControl(); > String t; > if (c instanceof Text) > t = ((Text)c).getText(); > else > return true; > if ( t != null & !t.equals("")) { > return true; > } > return false; > } > > public static void main(String args[]) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > CTabFolder folder = new CTabFolder(shell, SWT.NONE); > CTabItem item1 = new CTabItem(folder, SWT.NONE); > item1.setText("Item &0"); > CTabItem item2 = new CTabItem(folder, SWT.NONE); > item2.setText("Item &1"); > > Text t1 = new Text(folder, SWT.MULTI | SWT.BORDER); > t1.setText("Hello"); > Text t2 = new Text(folder, SWT.MULTI | SWT.BORDER); > t2.setText(""); > > item1.setControl(t1); > item2.setControl(t2); > > TestComposite comp = new TestComposite(folder, SWT.NONE); > folder.setPageManager(comp); > > shell.pack(); > 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 193064
:
130832
|
130834
| 130838 |
160744