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 213531 Details for
Bug 376011
[accessibility] Eclipse 4.2 tab traversal needs refining (Clicking on a toolbar no longer activates the view)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
CTabFolderTraversalTest.java
CTabFolderTraversalTest.java (text/plain), 4.91 KB, created by
Carolyn MacLeod
on 2012-04-03 16:32:06 EDT
(
hide
)
Description:
CTabFolderTraversalTest.java
Filename:
MIME Type:
Creator:
Carolyn MacLeod
Created:
2012-04-03 16:32:06 EDT
Size:
4.91 KB
patch
obsolete
>package accessibility; > >import org.eclipse.swt.*; >import org.eclipse.swt.widgets.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.accessibility.*; >//import org.eclipse.swt.custom.*; >import org.eclipse.e4.ui.widgets.*; >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; > >public class CTabFolderTraversalTest { > > static String [][] tabFolderNames = new String [][] { > {"Package Explorer"}, > {"Item.java", "Tree.java", "Display.java", "Control.java"}, > {"Outline"}, > {"Problems", "Javadoc", "Declaration", "Search", "Console", "History"}, > }; > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout(3, false)); > shell.setText("Multi CTabFolder Traversal"); > Image viewMenuImage = new Image(display, 12, 12); > GC gc = new GC(viewMenuImage); > gc.setBackground(shell.getBackground()); > gc.fillRectangle(0, 0, 12, 12); > gc.drawPolygon(new int[] {2, 2, 11, 2, 7, 6, 6, 6}); > gc.dispose(); > > for (int i = 0; i < tabFolderNames.length; i++) { > String [] tabNames = tabFolderNames[i]; > CTabFolder tabFolder = new CTabFolder(shell, SWT.BORDER); > tabFolder.setMinimizeVisible(true); > tabFolder.setMaximizeVisible(true); > if (i == 0 || i == 3) { > tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, i == 0 ? 1 : 2, i == 0 ? 2 : 1)); > } else { > tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > } > if (i % 2 == 0) { > ToolBar tb = new ToolBar(tabFolder, SWT.FLAT); > ToolItem ti = new ToolItem(tb, SWT.PUSH); > ti.setImage(viewMenuImage); > ti.setToolTipText("View Menu"); > tb.getAccessible().addAccessibleListener(new AccessibleAdapter() { > public void getName(AccessibleEvent e) { > e.result = "View Menu"; > } > }); > tabFolder.setTopRight(tb); > } > for (int t = 0; t < tabNames.length; t++) { > CTabItem tab = new CTabItem(tabFolder, SWT.NONE); > tab.setText(tabNames[t]); > Composite tabContent = new Composite(tabFolder, SWT.NONE); > tabContent.setLayout(new FillLayout()); > tab.setControl(tabContent); > if (i % 2 == 0) { > Tree tree = new Tree(tabContent, SWT.NONE); > TreeItem rootItem = new TreeItem(tree, SWT.NONE); > rootItem.setText("MyClass"); > for (int m = 0; m < 4; m++) { > TreeItem item = new TreeItem(rootItem, SWT.NONE); > item.setText("method" + (m + 1) + "()"); > } > rootItem.setExpanded(true); > } else { > Text text = new Text(tabContent, SWT.MULTI); > if (i == 1) { > text.setText("\npublic class " + tabNames[t].substring(0, tabNames[t].indexOf('.')) + " {\n\tmethod1() {\n\t}\n\tmethod2() {\n\t}\n\tmethod3() {\n\t}\n\tmethod4() {\n\t}\n}\n"); > } else { > text.setText("\nHello world!\nand other\nlines of " + tabNames[t] + " output.\n"); > } > } > } > tabFolder.setSelection(i == 3 ? 4 : 0); > tabFolder.addKeyListener(new KeyAdapter() { > public void keyPressed(KeyEvent e) { > System.out.println("tabFolder got key down"); > } > }); > tabFolder.addMouseListener(new MouseAdapter() { > public void mouseDown(MouseEvent e) { > System.out.println("tabFolder got mouse down"); > } > }); > tabFolder.addTraverseListener(new TraverseListener() { > public void keyTraversed(TraverseEvent e) { > switch (e.detail) { > case SWT.TRAVERSE_ARROW_NEXT: > case SWT.TRAVERSE_ARROW_PREVIOUS: > System.out.println("tabFolder got arrow traverse"); > break; > case SWT.TRAVERSE_TAB_NEXT: > case SWT.TRAVERSE_TAB_PREVIOUS: > System.out.println("tabFolder got tab traverse"); > break; > case SWT.TRAVERSE_PAGE_NEXT: > case SWT.TRAVERSE_PAGE_PREVIOUS: > System.out.println("tabFolder got page traverse"); > break; > } > } > }); > tabFolder.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { > System.out.println("tabFolder got selection"); > } > }); > tabFolder.addListener(SWT.FocusIn, new Listener() { > public void handleEvent(Event event) { > System.out.println("tabFolder got focus, event.button=" + event.button + ", event.keyCode=" + event.keyCode); > } > }); > tabFolder.addListener(SWT.FocusOut, new Listener() { > public void handleEvent(Event event) { > System.out.println("tabFolder lost focus"); > } > }); > tabFolder.addListener(SWT.Activate, new Listener() { > public void handleEvent(Event event) { > System.out.println("tabFolder was activated, event.button=" + event.button + ", event.keyCode=" + event.keyCode); > } > }); > tabFolder.addListener(SWT.Deactivate, new Listener() { > public void handleEvent(Event event) { > System.out.println("tabFolder was deactivated"); > } > }); > } > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep(); > } > } >}
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 376011
:
213531
|
216308
|
217291