You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/03/03 15:01:26 UTC

[royale-asjs] branch develop updated: jewel-combobox: add ComboBoxTruncateText bead

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 18e8dba  jewel-combobox: add ComboBoxTruncateText bead
18e8dba is described below

commit 18e8dba847c5f3f604f5d7ce3de17cef0c73ec4d
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Mar 3 16:01:17 2020 +0100

    jewel-combobox: add ComboBoxTruncateText bead
---
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../controls/combobox/ComboBoxTruncateText.as      | 64 ++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 18d6084..f04c127 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -187,6 +187,7 @@
     <component id="ComboUpperCase" class="org.apache.royale.jewel.beads.controls.combobox.ComboUpperCase"/>
     <component id="ComboLowerCase" class="org.apache.royale.jewel.beads.controls.combobox.ComboLowerCase"/>
     <component id="ComboBoxDisabled" class="org.apache.royale.jewel.beads.controls.combobox.ComboBoxDisabled"/>
+    <component id="ComboBoxTruncateText" class="org.apache.royale.jewel.beads.controls.combobox.ComboBoxTruncateText"/>
 
     <component id="BasicLayout" class="org.apache.royale.jewel.beads.layouts.BasicLayout"/>
     <component id="NullLayout" class="org.apache.royale.jewel.beads.layouts.NullLayout"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxTruncateText.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxTruncateText.as
new file mode 100644
index 0000000..9fec209
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxTruncateText.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.controls.combobox
+{
+	import org.apache.royale.core.IBead;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.core.IStyledUIBase;
+	import org.apache.royale.core.StyledUIBase;
+	import org.apache.royale.jewel.beads.controls.textinput.TruncateText;
+	
+	/**
+	 *  The ComboBoxTruncateText class is a specialty bead that can be used with
+	 *  a Jewel ComboBox control. The bead truncate the text when no space is available
+	 *  using "..."
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class ComboBoxTruncateText implements IBead
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function ComboBoxTruncateText()
+		{
+		}
+
+		/**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function set strand(value:IStrand):void
+		{
+			(((value as StyledUIBase).view as IComboBoxView).textinput as IStyledUIBase).addBead(new TruncateText());
+		}
+	}
+}