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 37670 Details for
Bug 134003
TableEditor doesn't track moving of cells properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Testcase w. better workaround
TestCase_TableEditorNotTracking.java (text/java), 3.07 KB, created by
Max Rotvel
on 2006-04-04 16:47:51 EDT
(
hide
)
Description:
Testcase w. better workaround
Filename:
MIME Type:
Creator:
Max Rotvel
Created:
2006-04-04 16:47:51 EDT
Size:
3.07 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.TableEditor; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.FormAttachment; >import org.eclipse.swt.layout.FormData; >import org.eclipse.swt.layout.FormLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >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.Table; >import org.eclipse.swt.widgets.TableColumn; >import org.eclipse.swt.widgets.TableItem; > >public class TestCase_TableEditorNotTracking >{ > static Table table; > private static final int WIDTH = 250, HEIGHT = 200; > static boolean workaround; > static TableColumn col; > > public static void main(String[] args) > { > Display display = Display.getDefault(); > Shell shell = new Shell(display, SWT.DIALOG_TRIM); > shell.setLayout(new FormLayout()); > shell.setSize(WIDTH, HEIGHT); > > final Composite tableParent = new Composite(shell, SWT.NONE); > tableParent.setLayout(new FillLayout()); > table = new Table(tableParent, SWT.BORDER | SWT.SINGLE > | SWT.HIDE_SELECTION | SWT.V_SCROLL); > > final TableColumn remBtnCol = new TableColumn(table, SWT.NONE); > final TableColumn fileCol = new TableColumn(table, SWT.LEAD); > > remBtnCol.setWidth(100); > fileCol.setWidth(100); > > final Button autoClearBtn = new Button(shell, SWT.CHECK); > autoClearBtn.setText("Workaround"); > autoClearBtn.addListener(SWT.Selection, new Listener() > { > public void handleEvent(Event event) > { > workaround = autoClearBtn.getSelection(); > } > }); > > FormAttachment min = new FormAttachment(0, 0); > FormAttachment max = new FormAttachment(100, 0); > > FormData fd1 = new FormData(); > fd1.left = min; > fd1.bottom = max; > autoClearBtn.setLayoutData(fd1); > > FormData fd2 = new FormData(); > fd2.left = min; > fd2.right = max; > fd2.top = min; > fd2.bottom = new FormAttachment(autoClearBtn, 2); > tableParent.setLayoutData(fd2); > > for (int i = 0; i < 4; i++) > { > TableItem item = new TableItem(table, SWT.NONE); > Button button = new Button(table, SWT.PUSH); > button.addListener(SWT.Selection, selector); > button.setText("Remove" + i); > // Store the item with the button > button.setData(item); > > TableEditor editor = new TableEditor(table); > editor.grabHorizontal = true; > editor.setEditor(button, item, 0); > > item.setText(1, " Row" + i); > // Store the editor with the item > item.setData(editor); > } > col = table.getColumns()[0]; > > shell.open(); > while (!shell.isDisposed()) > { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > private static Listener selector = new Listener() > { > public void handleEvent(Event evt) > { > TableItem item = (TableItem) evt.widget.getData(); > TableEditor editor = (TableEditor) item.getData(); > editor.getEditor().dispose(); > editor.dispose(); > item.dispose(); > if (workaround) > col.notifyListeners(SWT.Move, null); > }; > }; >}
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 134003
:
37283
| 37670