Bug 460810 - Selected DTreeItem is not visible on Mac OS X
Summary: Selected DTreeItem is not visible on Mac OS X
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Tree (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.1.0   Edit
Assignee: Esteban DUGUEPEROUX CLA
QA Contact: Vincent Richard CLA
URL:
Whiteboard:
Keywords: triaged
: 472020 (view as bug list)
Depends on:
Blocks: 475821
  Show dependency tree
 
Reported: 2015-02-25 10:02 EST by Maxime Porhel CLA
Modified: 2015-10-16 09:09 EDT (History)
2 users (show)

See Also:


Attachments
Sample VM with tree and table (3.47 KB, application/zip)
2015-02-25 10:02 EST, Maxime Porhel CLA
no flags Details
Corrected reproduction case. (3.47 KB, application/zip)
2015-07-07 08:49 EDT, Maxime Porhel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Porhel CLA 2015-02-25 10:02:20 EST
Created attachment 251097 [details]
Sample VM with tree and table

Open the tree from the attached reproduction case. 
Select a tree item.


See:  org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/editor/AbstractDTableViewerManager#triggerCustomDrawingTreeItems()

The code should be moved in table viewer manager as it does nothing for Tree representations. 
Without this listener, the selection is ok on my computer.

The correction will have to be tested on a DTree with different style defined in the VSM (non white background, non black foreground/label color) too.

Additional issue: the DTableEraseListener does not seem to work fine on Mac OS X. This might lead to the creation of a specific bug.
Comment 1 Eclipse Genie CLA 2015-02-25 11:03:51 EST
New Gerrit change created: https://git.eclipse.org/r/42661
Comment 2 Maxime Porhel CLA 2015-04-07 04:02:52 EDT
The following UnhandledEventLoopException seems to be caused by some code removed in the proposed patch: 

java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4462)
	at org.eclipse.swt.SWT.error(SWT.java:4396)
	at org.eclipse.swt.SWT.error(SWT.java:4367)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:783)
	at org.eclipse.swt.widgets.Tree.getColumn(Tree.java:1402)
	at org.eclipse.sirius.tree.ui.tools.internal.editor.DTreeViewerManager$3.keyPressed(DTreeViewerManager.java:428)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:167)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4203)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1504)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1500)
	at org.eclipse.swt.widgets.Tree.sendKeyEvent(Tree.java:2592)
	at org.eclipse.swt.widgets.Control.keyDown(Control.java:2402)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:607)
	at org.eclipse.swt.widgets.Tree.keyDown(Tree.java:1991)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5667)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)



There is no column in a DTree viewer.
Comment 4 Esteban DUGUEPEROUX CLA 2015-07-07 08:32:41 EDT
This bug occurs also on some Linux, see Bug 472020.
Comment 5 Esteban DUGUEPEROUX CLA 2015-07-07 08:33:30 EDT
*** Bug 472020 has been marked as a duplicate of this bug. ***
Comment 6 Maxime Porhel CLA 2015-07-07 08:49:36 EDT
Created attachment 255021 [details]
Corrected reproduction case.
Comment 7 Esteban DUGUEPEROUX CLA 2015-07-07 09:13:05 EDT
The change in DTableViewerManager.triggerColumnSelectedColumn() triggers the following exception when using left/right array keys to change of column :

java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4472)
	at org.eclipse.swt.SWT.error(SWT.java:4406)
	at org.eclipse.swt.SWT.error(SWT.java:4377)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:482)
	at org.eclipse.swt.widgets.Tree.getColumn(Tree.java:1196)
	at org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager$4.keyPressed(DTableViewerManager.java:533)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:167)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1351)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1336)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1363)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:763)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3317)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:785)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1965)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5590)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:3585)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4717)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9272)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1225)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2422)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Comment 8 Eclipse Genie CLA 2015-07-07 09:18:00 EDT
New Gerrit change created: https://git.eclipse.org/r/51489
Comment 10 Esteban DUGUEPEROUX CLA 2015-07-07 09:26:48 EDT
To validate this bugzilla :
1. Import the sample in attachment
2. Open the tree and test that selection of TreeItem display correctly selection, i.e. with background color and label color visible and changed.
3. Test also cell selection change using left/right arrow keys and that it doesn't throws exception when being at the left or right border.
Comment 11 Esteban DUGUEPEROUX CLA 2015-07-07 09:28:33 EDT
Fixed for 3.1
Comment 12 Esteban DUGUEPEROUX CLA 2015-07-07 09:38:20 EDT
About Comment 10, point 3 is on table representation : 
3. Test also cell selection change using left/right arrow keys and that it doesn't throws exception when being at the left or right border.
Comment 13 Maxime Porhel CLA 2015-10-06 10:53:32 EDT
Verified on Mac OS X 10.11 with Sirius 3.1.0-S20150930-080030
Comment 14 Pierre-Charles David CLA 2015-10-16 09:09:22 EDT
Available in Sirius 3.1.0.