incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r439859 - in /incubator/xap/trunk/src/xap/bridges/xap: ButtonBridge.js CheckboxBridge.js LabelBridge.js RadioButtonBridge.js
Date Sun, 03 Sep 2006 22:41:00 GMT
Author: jmargaris
Date: Sun Sep  3 15:41:00 2006
New Revision: 439859

URL: http://svn.apache.org/viewvc?view=rev&rev=439859
Log:
new button, label, radioButton and checkBox widgets

Added:
    incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js   (with props)
    incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js   (with props)
    incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js   (with props)
    incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js   (with props)

Added: incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js?view=auto&rev=439859
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js Sun Sep  3 15:41:00 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+Xap.provide("xap.bridges.xap.ButtonBridge"); 
+Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+Xap.require("xap.widgets.Button");
+
+xap.bridges.xap.ButtonBridge = function() {
+	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call(this);
+}
+
+Xap.setupClassAsSubclassOf("xap.bridges.xap.ButtonBridge", "xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+
+
+xap.bridges.xap.ButtonBridge.prototype = new xap.bridges.xap.LabelBridge();
+
+xap.bridges.xap.ButtonBridge.prototype.obtainPeer = function() {
+
+	this._peer = new xap.widgets.Button();
+	
+	this._peer.setOnClick(this, 'fireEvent', 'onCommand');  /* hook up the widget's onclick
to execute the bridge's oncommand */
+
+}
+
+
+
+
+
+/*
+xap.bridges.xap.ButtonBridge.prototype.getRootDomNode = function() {
+	return this._peer._rootDomNode;
+}	
+
+
+xap.bridges.xap.ButtonBridge.prototype.getNewAllowedAttributes = function() {
+	return ["text"];
+}	
+
+
+xap.bridges.xap.ButtonBridge.prototype.setTextAttribute = function(value) {
+	this._peer.setText(value);
+}	
+*/

Propchange: incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js?view=auto&rev=439859
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js Sun Sep  3 15:41:00 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+Xap.provide("xap.bridges.xap.CheckboxBridge"); 
+Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+Xap.require("xap.widgets.Checkbox");
+
+xap.bridges.xap.CheckboxBridge = function() {
+	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call(this);
+}
+
+Xap.setupClassAsSubclassOf("xap.bridges.xap.CheckboxBridge", "xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+
+
+xap.bridges.xap.CheckboxBridge.prototype = new xap.bridges.xap.LabelBridge();
+
+xap.bridges.xap.CheckboxBridge.prototype.obtainPeer = function() {
+
+	this._peer = new xap.widgets.Checkbox();
+	
+	if (this.getElement().getAttribute('onStateChange') != '') {
+		this._peer.setOnClick(this, 'fireEvent', 'onStateChange');  /* hook up the widget's onclick
to execute the bridge's oncommand */
+	}
+}
+
+
+
+/*
+xap.bridges.xap.CheckboxBridge.prototype.getRootDomNode = function() {
+	return this._peer._rootDomNode;
+}	
+
+
+xap.bridges.xap.CheckboxBridge.prototype.getNewAllowedAttributes = function() {
+	return ["text"];
+}	
+
+
+xap.bridges.xap.CheckboxBridge.prototype.setTextAttribute = function(value) {
+	this._peer.setText(value);
+}	
+*/

Propchange: incubator/xap/trunk/src/xap/bridges/xap/CheckboxBridge.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js?view=auto&rev=439859
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js Sun Sep  3 15:41:00 2006
@@ -0,0 +1,66 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+Xap.provide("xap.bridges.xap.LabelBridge"); 
+Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+Xap.require("xap.widgets.Label");
+
+xap.bridges.xap.LabelBridge = function() {
+	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call(this);
+}
+
+Xap.setupClassAsSubclassOf("xap.bridges.xap.LabelBridge", "xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+
+
+
+xap.bridges.xap.LabelBridge.prototype.obtainPeer = function() {
+
+  var labelWidget = new xap.widgets.Label();
+	
+	this._peer = labelWidget;
+
+}
+
+
+xap.bridges.xap.LabelBridge.prototype.getRootDomNode = function() {
+	return this._peer._rootDomNode;
+}	
+
+
+xap.bridges.xap.LabelBridge.prototype.getNewAllowedAttributes = function() {
+	return ["text", "alignVertical", "alignHorizontal", "textPlacementHorizontal", "textPlacementVertical"];
+}	
+
+xap.bridges.xap.LabelBridge.prototype.setTextAttribute = function(text) {
+	this.getPeer().setText(text);
+}
+
+xap.bridges.xap.LabelBridge.prototype.setAlignVerticalAttribute = function(alignment) {
+	this.getPeer().setAlignVertical(alignment);	
+}
+
+xap.bridges.xap.LabelBridge.prototype.setAlignHorizontalAttribute = function(alignment) {
+	this.getPeer().setAlignHorizontal(alignment);
+}
+
+xap.bridges.xap.LabelBridge.prototype.setTextPlacementHorizontalAttribute = function(alignment)
{
+	this.getPeer().setTextPlacementHorizontal(alignment);	
+}
+
+xap.bridges.xap.LabelBridge.prototype.setTextPlacementVerticalAttribute = function(alignment)
{
+	this.getPeer().setTextPlacementVertical(alignment);
+}

Propchange: incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js?view=auto&rev=439859
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js Sun Sep  3 15:41:00 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+Xap.provide("xap.bridges.xap.RadioButtonBridge"); 
+Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+Xap.require("xap.widgets.RadioButton");
+
+xap.bridges.xap.RadioButtonBridge = function() {
+	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call(this);
+}
+
+Xap.setupClassAsSubclassOf("xap.bridges.xap.RadioButtonBridge", "xap.bridges.basic.AbstractBlackBoxWidgetBridge");
+
+
+xap.bridges.xap.RadioButtonBridge.prototype = new xap.bridges.xap.LabelBridge();
+
+xap.bridges.xap.RadioButtonBridge.prototype.obtainPeer = function() {
+
+	this._peer = new xap.widgets.RadioButton();
+	this.group = this.getElement().getAttribute('group');
+	
+	var session = this.getSession();
+	
+	
+	if (!session.radioGroup) session.radioGroup = {}; /* create a general radioGroup attribute
in the global session */
+	if (!session.radioGroup[this.group]) session.radioGroup[this.group] = null; /* placeholder
for the currently clicked radio button for this radio group */
+
+	
+	this._peer.setOnClick(this, 'register', null);
+
+}
+
+
+xap.bridges.xap.RadioButtonBridge.prototype.register = function() {
+	
+	var session = this.getSession();	
+	var activeRadioButton = session.radioGroup[this.group]; 
+	
+	activeRadioButton && activeRadioButton.reset(); /* reset current active radio button
for this radio group in the session object */
+	
+	if (this.getElement().getAttribute('onStateChange') != '') this.fireEvent('onStateChange');
+
+	session.radioGroup[this.group] = this._peer;
+	        
+}

Propchange: incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message