| /******************************************************************************* |
| * Copyright (c) 2011, 2012 EclipseSource and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * EclipseSource - initial API and implementation |
| ******************************************************************************/ |
| |
| qx.Class.define( "org.eclipse.rwt.test.tests.SeparatorTest", { |
| |
| extend : qx.core.Object, |
| |
| members : { |
| |
| testCreateByProtocol : function() { |
| var TestUtil = org.eclipse.rwt.test.fixture.TestUtil; |
| var shell = TestUtil.createShellByProtocol( "w2" ); |
| var processor = rwt.protocol.MessageProcessor; |
| processor.processOperation( { |
| "target" : "w3", |
| "action" : "create", |
| "type" : "rwt.widgets.Separator", |
| "properties" : { |
| "style" : [ "SEPARATOR" ], |
| "parent" : "w2" |
| } |
| } ); |
| var ObjectManager = rwt.protocol.ObjectRegistry; |
| var widget = ObjectManager.getObject( "w3" ); |
| assertTrue( widget instanceof rwt.widgets.Separator ); |
| assertIdentical( shell, widget.getParent() ); |
| assertTrue( widget.getUserData( "isControl") ); |
| assertFalse( widget._line.hasState( "rwt_VERTICAL" ) ); |
| assertTrue( widget._line.hasState( "rwt_SHADOW_NONE" ) ); |
| shell.destroy(); |
| widget.destroy(); |
| }, |
| |
| testCreateByProtocolVerical : function() { |
| var TestUtil = org.eclipse.rwt.test.fixture.TestUtil; |
| var shell = TestUtil.createShellByProtocol( "w2" ); |
| var processor = rwt.protocol.MessageProcessor; |
| processor.processOperation( { |
| "target" : "w3", |
| "action" : "create", |
| "type" : "rwt.widgets.Separator", |
| "properties" : { |
| "style" : [ "SEPARATOR", "VERTICAL" ], |
| "parent" : "w2" |
| } |
| } ); |
| var ObjectManager = rwt.protocol.ObjectRegistry; |
| var widget = ObjectManager.getObject( "w3" ); |
| assertTrue( widget._line.hasState( "rwt_VERTICAL" ) ); |
| shell.destroy(); |
| widget.destroy(); |
| }, |
| |
| testCreateByProtocolWithShadowIn : function() { |
| var TestUtil = org.eclipse.rwt.test.fixture.TestUtil; |
| var shell = TestUtil.createShellByProtocol( "w2" ); |
| var processor = rwt.protocol.MessageProcessor; |
| processor.processOperation( { |
| "target" : "w3", |
| "action" : "create", |
| "type" : "rwt.widgets.Separator", |
| "properties" : { |
| "style" : [ "SEPARATOR", "SHADOW_IN" ], |
| "parent" : "w2" |
| } |
| } ); |
| var ObjectManager = rwt.protocol.ObjectRegistry; |
| var widget = ObjectManager.getObject( "w3" ); |
| assertTrue( widget._line.hasState( "rwt_SHADOW_IN" ) ); |
| shell.destroy(); |
| widget.destroy(); |
| }, |
| |
| testCreateByProtocolWithShadowOut : function() { |
| var TestUtil = org.eclipse.rwt.test.fixture.TestUtil; |
| var shell = TestUtil.createShellByProtocol( "w2" ); |
| var processor = rwt.protocol.MessageProcessor; |
| processor.processOperation( { |
| "target" : "w3", |
| "action" : "create", |
| "type" : "rwt.widgets.Separator", |
| "properties" : { |
| "style" : [ "SEPARATOR", "SHADOW_OUT" ], |
| "parent" : "w2" |
| } |
| } ); |
| var ObjectManager = rwt.protocol.ObjectRegistry; |
| var widget = ObjectManager.getObject( "w3" ); |
| assertTrue( widget._line.hasState( "rwt_SHADOW_OUT" ) ); |
| shell.destroy(); |
| widget.destroy(); |
| } |
| |
| } |
| |
| } ); |