All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rwt.widgets.Separator.js Maven / Gradle / Ivy

Go to download

The Rich Ajax Platform lets you build rich, Ajax-enabled Web applications.

There is a newer version: 3.29.0
Show newest version
/*******************************************************************************
 * Copyright (c) 2002, 2012 Innoopract Informationssysteme GmbH 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:
 *    Innoopract Informationssysteme GmbH - initial API and implementation
 *    EclipseSource - ongoing development
 ******************************************************************************/

/**
 * This class represents SWT Labels with style SWT.SEPARATOR
 */
rwt.qx.Class.define( "rwt.widgets.Separator", {
  extend : rwt.widgets.base.BoxLayout,

  construct : function() {
    this.base( arguments );
    // Fix IE Styling issues
    rwt.widgets.util.WidgetUtil.fixIEBoxHeight( this );
    // the actual separator line
    this._line = new rwt.widgets.base.Parent();
    this._line.setAnonymous( true );
    this._line.setAppearance( "separator-line" );
    this.add( this._line );
  },

  properties : {

    appearance : {
      refine : true,
      init : "separator"
    }
  },

  destruct : function() {
    this._line.dispose();
    this._line = null;
  },

  members : {

    addState : function( state ) {
      this.base( arguments, state );
      if( state.substr( 0, 8 ) == "variant_" ) {
        this._line.addState( state );
      }
    },

    removeState : function( state ) {
      this.base( arguments, state );
      if( state.substr( 0, 8 ) == "variant_" ) {
        this._line.removeState( state );
      }
    },

    setLineStyle : function( style ) {
      this._line.addState( style );
    },

    setLineOrientation : function( value ) {
      if( value == "vertical" ) {
        this.setHorizontalChildrenAlign( "center" );
        this._line.setHeight( "100%" );
        this._line.addState( "rwt_VERTICAL" );
      } else {
        this.setVerticalChildrenAlign( "middle" );
        this._line.setWidth( "100%" );
        this._line.removeState( "rwt_VERTICAL" );
      }
    }
  }
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy