
com.sun.webui.jsf.component.IFrame Maven / Gradle / Ivy
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007-2018 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.webui.jsf.component;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import com.sun.faces.annotation.Component;
import com.sun.faces.annotation.Property;
/**
* The Iframe component is used to create an inline frame.
*/
@Component(type = "com.sun.webui.jsf.IFrame", family = "com.sun.webui.jsf.IFrame",
displayName = "Iframe", instanceName = "iFrame", tagName = "iframe",
helpKey = "projrave_ui_elements_palette_wdstk-jsf1.2_i_frame",
propertiesHelpKey = "projrave_ui_elements_palette_wdstk-jsf1.2_propsheets_i_frame_props")
public class IFrame extends Frame {
/**
* Construct a new IFrame
.
*/
public IFrame() {
super();
setRendererType("com.sun.webui.jsf.IFrame");
}
/**
* Return the family for this component.
*/
@Override
public String getFamily() {
return "com.sun.webui.jsf.IFrame";
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Tag attribute methods
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* The component identifier for this component. This value must be unique
* within the closest parent component that is a naming container.
*/
@Property(name = "id")
@Override
public void setId(String id) {
super.setId(id);
}
/**
* Use the rendered attribute to indicate whether the HTML code for the
* component should be included in the rendered HTML page. If set to false,
* the rendered HTML page does not include the HTML for the component. If
* the component is not rendered, it is also not processed on any subsequent
* form submission.
*/
@Property(name = "rendered")
@Override
public void setRendered(boolean rendered) {
super.setRendered(rendered);
}
/**
* Specifies how to align the iframe according to the surrounding text. One
* of the following: left, right, top, middle, bottom
*/
@Property(name = "align", displayName = "Align", category = "Appearance")
private String align = null;
/**
* Specifies how to align the iframe according to the surrounding text. One
* of the following: left, right, top, middle, bottom
*/
public String getAlign() {
if (this.align != null) {
return this.align;
}
ValueExpression _vb = getValueExpression("align");
if (_vb != null) {
return (String) _vb.getValue(getFacesContext().getELContext());
}
return null;
}
/**
* Specifies how to align the iframe according to the surrounding text. One
* of the following: left, right, top, middle, bottom
* @see #getAlign()
*/
public void setAlign(String align) {
this.align = align;
}
/**
* Defines the height of the iframe in pixels or as a percentage of it's
* container
*/
@Property(name = "height", displayName = "Height", category = "Appearance")
private String height = null;
/**
* Defines the height of the iframe in pixels or as a percentage of it's
* container
*/
public String getHeight() {
if (this.height != null) {
return this.height;
}
ValueExpression _vb = getValueExpression("height");
if (_vb != null) {
return (String) _vb.getValue(getFacesContext().getELContext());
}
return null;
}
/**
* Defines the height of the iframe in pixels or as a percentage of it's
* container
* @see #getHeight()
*/
public void setHeight(String height) {
this.height = height;
}
/**
* Set the value of the noResize attribute to "true" when user
* is not allowed to resize the frame.
*/
@Property(name = "noResize", displayName = "No Resize", category = "Appearance", isHidden = true, isAttribute = false)
private boolean noResize = false;
private boolean noResize_set = false;
/**
* Set the value of the noResize attribute to "true" when user
* is not allowed to resize the frame.
*/
@Override
public boolean isNoResize() {
if (this.noResize_set) {
return this.noResize;
}
ValueExpression _vb = getValueExpression("noResize");
if (_vb != null) {
Object _result = _vb.getValue(getFacesContext().getELContext());
if (_result == null) {
return false;
} else {
return ((Boolean) _result).booleanValue();
}
}
return false;
}
/**
* Set the value of the noResize attribute to "true" when user
* is not allowed to resize the frame.
* @see #isNoResize()
*/
@Override
public void setNoResize(boolean noResize) {
this.noResize = noResize;
this.noResize_set = true;
}
/**
* Defines the width of the iframe in pixels or as a percentage of it's
* container
*/
@Property(name = "width", displayName = "Width", category = "Appearance")
private String width = null;
/**
* Defines the width of the iframe in pixels or as a percentage of it's
* container
*/
public String getWidth() {
if (this.width != null) {
return this.width;
}
ValueExpression _vb = getValueExpression("width");
if (_vb != null) {
return (String) _vb.getValue(getFacesContext().getELContext());
}
return null;
}
/**
* Defines the width of the iframe in pixels or as a percentage of it's
* container
* @see #getWidth()
*/
public void setWidth(String width) {
this.width = width;
}
/**
* Restore the state of this component.
*/
@Override
public void restoreState(FacesContext _context, Object _state) {
Object _values[] = (Object[]) _state;
super.restoreState(_context, _values[0]);
this.align = (String) _values[1];
this.height = (String) _values[2];
this.noResize = ((Boolean) _values[3]).booleanValue();
this.noResize_set = ((Boolean) _values[4]).booleanValue();
this.width = (String) _values[5];
}
/**
* Save the state of this component.
*/
@Override
public Object saveState(FacesContext _context) {
Object _values[] = new Object[6];
_values[0] = super.saveState(_context);
_values[1] = this.align;
_values[2] = this.height;
_values[3] = this.noResize ? Boolean.TRUE : Boolean.FALSE;
_values[4] = this.noResize_set ? Boolean.TRUE : Boolean.FALSE;
_values[5] = this.width;
return _values;
}
}