Go.property improvements

Dropdowns

It would be really helpful to be able to do dropdowns of different options for go.property(). So you write something like maybe this in your code:

go.property(“value”, 0, {options={foo = 1, bar = 2, foobar = 100}})

And then get a drop-down with the options foo, bar and foobar. A typical case for this is if you want to be able to set the type of something. Just having a number box where you can write any number won’t be very intuitive.

Booleans

go.property(“boolean_value”, true)
That displays a checkbox.

Tooltips

go.property(“value”, msg.url(), {tooltip = “A tooltip text that is shown when the field is hovered”})

Grouping

go.property(“value”, msg.url(), {group = “Things”})
(As per Grouping script properties)

More complex interface options

For a vector4 I would want to be able to say that it is a color, and get a color picker.
For numbers I would like to be able to set the range and then get a slider as well as the number field

Booleans are already working that way - otherwise good suggestions

When I use a bool in go.property I get a java error in the editor:

> java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Boolean
> 	at com.dynamo.cr.properties.descriptors.BooleanPropertyDesc$Editor.refresh(BooleanPropertyDesc.java:48)
> 	at com.dynamo.cr.properties.FormPropertySheetViewer.refresh(FormPropertySheetViewer.java:120)
> 	at com.dynamo.cr.properties.FormPropertySheetViewer.setInput(FormPropertySheetViewer.java:353)
> 	at com.dynamo.cr.properties.FormPropertySheetPage.setSelection(FormPropertySheetPage.java:105)
> 	at com.dynamo.cr.properties.FormPropertySheetPage.selectionChanged(FormPropertySheetPage.java:88)
> 	at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:365)
> 	at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
> 	at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71)
> 	at org.eclipse.ui.part.PageBookView$5.run(PageBookView.java:255)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.core.runtime.Platform.run(Platform.java:857)
> 	at org.eclipse.ui.part.PageBookView$SelectionManager.selectionChanged(PageBookView.java:253)
> 	at org.eclipse.ui.part.PageBookView$SelectionProvider.postSelectionChanged(PageBookView.java:329)
> 	at org.eclipse.ui.part.PageBookView.postSelectionChanged(PageBookView.java:919)
> 	at org.eclipse.ui.part.PageBookView.access$3(PageBookView.java:914)
> 	at org.eclipse.ui.part.PageBookView$3.selectionChanged(PageBookView.java:172)
> 	at org.eclipse.ui.views.contentoutline.ContentOutlinePage$1.run(ContentOutlinePage.java:112)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.ui.views.contentoutline.ContentOutlinePage.fireSelectionChanged(ContentOutlinePage.java:110)
> 	at org.eclipse.ui.views.contentoutline.ContentOutlinePage.selectionChanged(ContentOutlinePage.java:170)
> 	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
> 	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
> 	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162)
> 	at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188)
> 	at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211)
> 	at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1241)
> 	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:239)
> 	at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:233)
> 	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403)
> 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> 	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
> 	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
> 	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)

Update: This happened when I changed the type of an existing value. Making a new one worked fine.

Yes, that is a known bug.