diff --git a/.classpath b/.classpath index fd0b772..6a3cf78 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + @@ -32,5 +32,5 @@ - + diff --git a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java index 7ab57b9..73099a6 100644 --- a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java @@ -36,6 +36,10 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.cell.client.AbstractCell; import com.google.gwt.cell.client.Cell.Context; +import com.google.gwt.dom.client.BrowserEvents; +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.event.logical.shared.SelectionEvent; import com.google.gwt.event.logical.shared.SelectionHandler; import com.google.gwt.resources.client.ImageResource; @@ -210,7 +214,30 @@ public class ValidationsTasksPanel extends FramedPanel implements validationButton.setFalseIcon(ResourceBundle.INSTANCE.error()); validationButton.setTrueTitle("Valid"); validationButton.setFalseTitle("Error"); + + validationButton.addSelectHandler(new SelectHandler() { + @Override + public void onSelect(SelectEvent event) { + Log.debug("Button Pressed"); + + Context c = event.getContext(); + int rowIndex = c.getIndex(); + int columnIndex=c.getColumn(); + + Element el=tree.getView().getCell(rowIndex, columnIndex); + + NativeEvent contextEvent = Document.get().createMouseEvent(BrowserEvents.CONTEXTMENU, true, true,0, 0, 0, + el.getAbsoluteLeft(), el.getAbsoluteTop(), false, false, false, false, + NativeEvent.BUTTON_RIGHT, null); + + //NativeEvent contextEvent = Document.get().createContextMenuEvent(); + el.dispatchEvent(contextEvent); + //DomEvent + } + }); + + cc2.setCell(validationButton); List> l = new ArrayList>(); diff --git a/src/main/resources/org/gcube/portlets/user/td/tablewidget/client/custom/ValidationButton.css b/src/main/resources/org/gcube/portlets/user/td/tablewidget/client/custom/ValidationButton.css index 313afdc..e68e1e9 100644 --- a/src/main/resources/org/gcube/portlets/user/td/tablewidget/client/custom/ValidationButton.css +++ b/src/main/resources/org/gcube/portlets/user/td/tablewidget/client/custom/ValidationButton.css @@ -1,3 +1,3 @@ .image { - /*cursor: pointer;*/ + cursor: pointer; } \ No newline at end of file