// Used in the table label provider public String getViewerColumnValue(int index) { switch (index) { case 0: // transition name return transitionName; case 1: // qualified name return sourceFeature.getName() + "." + transitionData.stateMachineName + "." + transitionData.regionName; case 2: // requires safe composition return Boolean.toString(needsSAT); case 3: // has error return Boolean.toString(hasError); case 4: // logical proposition if (!needsSAT || hasError) { // if does not need SAT or is an error return empty return ""; } return SCUtils.translatesRequiringImpl(sourceFeature, requiringFeatures); case 5: // is consistent (if satisfiable means is inconsistent, that is why it is negated) if (!needsSAT || hasError) { // if does not need SAT or is an error return empty return ""; } return Boolean.toString(!evaluationValues.get(0)); // case 6: // eval time if (!needsSAT || hasError) { // if does not need SAT or is an error return empty return ""; } return Long.toString(evaluationTime); case 7: // remarks return errorMessage; default: return "unkown " + index; } } // getViewrColumnValue
private static void writeCloseListener(final Shell shell) throws IOException { // JSWriter writer = JSWriter.getWriterFor( shell ); Boolean newValue = Boolean.valueOf(ShellEvent.hasListener(shell)); Boolean defValue = Boolean.FALSE; // writer.set( PROP_SHELL_LISTENER, "hasShellListener", newValue, defValue ); boolean hasChanged = WidgetLCAUtil.hasChanged(shell, PROP_SHELL_LISTENER, newValue, defValue); if (hasChanged) { IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); if (newValue.booleanValue()) { synchronizer.addListener("closelistener"); } else { synchronizer.removeListener("closelistener"); } } }
public void preserveValues(final Widget widget) { ControlLCAUtil.preserveValues((Control) widget); Shell shell = (Shell) widget; IWidgetAdapter adapter = WidgetUtil.getAdapter(shell); adapter.preserve(PROP_ACTIVE_CONTROL, getActiveControl(shell)); adapter.preserve(PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell()); adapter.preserve(PROP_TEXT, shell.getText()); adapter.preserve(PROP_IMAGE, shell.getImage()); adapter.preserve(PROP_ALPHA, new Integer(shell.getAlpha())); adapter.preserve(PROP_MODE, getMode(shell)); adapter.preserve(PROP_FULLSCREEN, Boolean.valueOf(shell.getFullScreen())); adapter.preserve(PROP_SHELL_LISTENER, Boolean.valueOf(ShellEvent.hasListener(shell))); adapter.preserve(PROP_SHELL_MENU, shell.getMenuBar()); adapter.preserve(PROP_MINIMUM_SIZE, shell.getMinimumSize()); WidgetLCAUtil.preserveCustomVariant(shell); }
private static void writeFullScreen(final Shell shell) throws IOException { Object defValue = Boolean.FALSE; Boolean newValue = Boolean.valueOf(shell.getFullScreen()); if (WidgetLCAUtil.hasChanged(shell, PROP_FULLSCREEN, newValue, defValue)) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( "fullScreen", newValue ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("fullScreen", newValue); } }
private static void writeOpen(final Shell shell) throws IOException { // TODO [rst] workaround: qx window should be opened only once. Boolean defValue = Boolean.FALSE; Boolean actValue = Boolean.valueOf(shell.getVisible()); if (WidgetLCAUtil.hasChanged(shell, Props.VISIBLE, actValue, defValue) && shell.getVisible()) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.call( "open", null ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.call("open"); } }
static String getLibraryName(String mozillaPath) { /* * The name of the Gecko library to glue to changed between the XULRunner 10 and * 24 releases. However it's not possible to programmatically know the version * of a XULRunner that's being used before it has been glued. To determine the * appropriate Gecko library name to return, look for the presence of an "xpcom" * library in the mozilla path, which is present in all supported XULRunner releases * prior to XULRunner 24. If this library is there then return it, and if it's not * there then assume that XULRunner 24 is being used and return the new library name * instead ("xul"). */ if (IsXULRunner24 == null) { /* IsXULRunner24 not yet initialized */ IsXULRunner24 = new File(mozillaPath, LIB_XPCOM).exists() ? Boolean.FALSE : Boolean.TRUE; } return IsXULRunner24.booleanValue() ? LIB_XUL : LIB_XPCOM; }