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 writeMode(final Shell shell) throws IOException { Object defValue = null; Object newValue = getMode(shell); if (WidgetLCAUtil.hasChanged(shell, PROP_MODE, newValue, defValue)) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( "mode", newValue ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("mode", newValue); } }
/* (intentionally non-JavaDoc'ed) * This method is declared public only to be accessible from DisplayLCA */ public static void writeActiveControl(final Shell shell) throws IOException { final Control activeControl = getActiveControl(shell); String prop = PROP_ACTIVE_CONTROL; if (WidgetLCAUtil.hasChanged(shell, prop, activeControl, null)) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( "activeControl", new Object[] { activeControl } ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("activeControl", WidgetUtil.getId(activeControl)); } }
private static void writeActiveShell(final Shell shell) throws IOException { Shell activeShell = shell.getDisplay().getActiveShell(); boolean hasChanged = WidgetLCAUtil.hasChanged(shell, PROP_ACTIVE_SHELL, activeShell, null); if (shell == activeShell && hasChanged) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( "active", true ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("active", true); } }
private void writeAlpha(final Shell shell) throws IOException { int alpha = shell.getAlpha(); if (WidgetLCAUtil.hasChanged(shell, PROP_ALPHA, new Integer(alpha), new Integer(0xFF))) { // JSWriter writer = JSWriter.getWriterFor( shell ); float opacity = (alpha & 0xFF) * 1000 / 0xFF / 1000.0f; // writer.set( "opacity", opacity ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("opacity", opacity); } }
private static void writeText(final Shell shell) throws IOException { String text = shell.getText(); if (WidgetLCAUtil.hasChanged(shell, PROP_TEXT, text, "")) { // JSWriter writer = JSWriter.getWriterFor( shell ); text = WidgetLCAUtil.escapeText(text, false); // writer.set( JSConst.QX_FIELD_CAPTION, text ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty(JSConst.QX_FIELD_CAPTION, text); } }
private static void writeMinimumSize(final Shell shell) throws IOException { Point newValue = shell.getMinimumSize(); if (WidgetLCAUtil.hasChanged(shell, PROP_MINIMUM_SIZE, newValue)) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( "minWidth", new Integer( newValue.x ) ); // writer.set( "minHeight", new Integer( newValue.y ) ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty("minWidth", newValue.x); synchronizer.setWidgetProperty("minHeight", newValue.y); } }
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"); } }
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"); } } }
private static void writeImage(final Shell shell) throws IOException { if ((shell.getStyle() & SWT.TITLE) != 0) { Image image = shell.getImage(); if (image == null) { Image[] defaultImages = shell.getImages(); if (defaultImages.length > 0) { image = defaultImages[0]; } } if (WidgetLCAUtil.hasChanged(shell, PROP_IMAGE, image, null)) { // JSWriter writer = JSWriter.getWriterFor( shell ); // writer.set( JSConst.QX_FIELD_ICON, // ResourceFactory.getImagePath( image ) ); IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell); synchronizer.setWidgetProperty(JSConst.QX_FIELD_ICON, ResourceFactory.getImagePath(image)); } } }