Re: TextConverter method call

2019-11-26 Thread serkan . tas

Hi Alex,

Sorry for inconvenience. I was just sent it before leaving home in the  
morning. I am going to send you the real code and check your sample  
later today.


But I did not understand the what should I do for FormatDescriptor.

Is there a workaround ?


Alıntı Alex Harui :


That link took me to the FormatDescriptor class.

The FormatDescriptor exception is a side-effect of having naked  
static initialization code.  We want to defer static initialization  
until it is really needed so that the load order of classes doesn’t  
matter as much (or at all).


My current opinion (again without spending too much time thinking  
about it) is to convert the var into a get function.  Most other  
methods in TextConverter access _descriptor and thus would  
initialize it just-in-time as it is needed.  Something like:


Static private var __descriptors:Array;

static public function get _descriptors():Array
{
  If (!__descriptors) {
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter,  
TextLayoutExporter, TEXT_LAYOUT_FORMAT,__descriptors);
addFormat(TEXT_FIELD_HTML_FORMAT,  
TextFieldHtmlImporter,  TextFieldHtmlExporter, null,__descriptors);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter,  
PlainTextExporter, "air:text", __descriptors);

}
  }

And add an optional last param to addFormat to specify the array to  
add to, so it doesn’t access the getter during initialization.


HTH,
-Alex

From: Serkan Taş 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 8:14 PM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Alex, I have implemented in other way, here it is : >  
https://drive.google.com/open?id=1oPLnVz7jyWJe7Z_V25o773hQYlrRaD6B


But I have another exception in other thread , can you check it ?

subject : "org.apache.royale.textLayout.conversion.FormatDescriptor  
is not a constructor"

27.11.2019 01:34 tarihinde Alex Harui yazdı:
Nevermind, that won’t work in this case.  I think you still need to  
initialize _descriptors with a static initializer.  I think I would  
use an internal version of addFormat for doing that.  Or maybe  
manually code _descriptors as a get/set.


HTH,
-Alex

From: Alex Harui 
Reply-To: "users@royale.apache.org"  


Date: Tuesday, November 26, 2019 at 2:22 PM
To: "users@royale.apache.org"  


Subject: Re: TextConverter method call

Yes, probably a good idea, in which I case I would just use a dummy  
initializer


/** @private */
static public function setFormatsToDefault():Boolean// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter,  
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
 TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter,  
PlainTextExporter, "air:text");

return true;
}
static public var _descriptors:Array;
static private var formatsSet:Boolean = setFormatsToDefault()




From: Serkan Taş  

Reply-To: "users@royale.apache.org"  


Date: Tuesday, November 26, 2019 at 11:44 AM
To: "users@royale.apache.org"  


Subject: Re: TextConverter method call

Do I have to keep addFormat and addFormatAt compatible for external  
usage, because they are public may be called from other classes ?

26.11.2019 21:15 tarihinde Alex Harui yazdı:
It “should” but we are not fully supporting “naked code” (code not  
in methods) right now.  I’ve never liked the pattern and I’m not  
sure all minifiers know how to handle it, so the easiest answer for  
now is to rewrite the pattern.


One way to rewrite is to have setFormatDefaults return an array and  
initialize _descriptors.  Something like:


// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():Array// No PMD
{
var arr:Array = [];
addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter,  
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(arr, TEXT_FIELD_HTML_FORMAT,  
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
addFormat(arr,PLAIN_TEXT_FORMAT, 

Re: TextConverter method call

2019-11-26 Thread Alex Harui
That link took me to the FormatDescriptor class.

The FormatDescriptor exception is a side-effect of having naked static 
initialization code.  We want to defer static initialization until it is really 
needed so that the load order of classes doesn’t matter as much (or at all).

My current opinion (again without spending too much time thinking about it) is 
to convert the var into a get function.  Most other methods in TextConverter 
access _descriptor and thus would initialize it just-in-time as it is needed.  
Something like:

Static private var __descriptors:Array;

static public function get _descriptors():Array
{
  If (!__descriptors) {
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT,__descriptors);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null,__descriptors);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text", __descriptors);
}
  }

And add an optional last param to addFormat to specify the array to add to, so 
it doesn’t access the getter during initialization.

HTH,
-Alex

From: Serkan Taş 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 8:14 PM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Alex, I have implemented in other way, here it is : > 
https://drive.google.com/open?id=1oPLnVz7jyWJe7Z_V25o773hQYlrRaD6B

But I have another exception in other thread , can you check it ?

subject : "org.apache.royale.textLayout.conversion.FormatDescriptor is not a 
constructor"
27.11.2019 01:34 tarihinde Alex Harui yazdı:
Nevermind, that won’t work in this case.  I think you still need to initialize 
_descriptors with a static initializer.  I think I would use an internal 
version of addFormat for doing that.  Or maybe manually code _descriptors as a 
get/set.

HTH,
-Alex

From: Alex Harui 
Reply-To: "users@royale.apache.org" 

Date: Tuesday, November 26, 2019 at 2:22 PM
To: "users@royale.apache.org" 

Subject: Re: TextConverter method call

Yes, probably a good idea, in which I case I would just use a dummy initializer

/** @private */
static public function setFormatsToDefault():Boolean// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
return true;
}
static public var _descriptors:Array;
static private var formatsSet:Boolean = setFormatsToDefault()




From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Tuesday, November 26, 2019 at 11:44 AM
To: "users@royale.apache.org" 

Subject: Re: TextConverter method call

Do I have to keep addFormat and addFormatAt compatible for external usage, 
because they are public may be called from other classes ?
26.11.2019 21:15 tarihinde Alex Harui yazdı:
It “should” but we are not fully supporting “naked code” (code not in methods) 
right now.  I’ve never liked the pattern and I’m not sure all minifiers know 
how to handle it, so the easiest answer for now is to rewrite the pattern.

One way to rewrite is to have setFormatDefaults return an array and initialize 
_descriptors.  Something like:

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():Array// No PMD
{
var arr:Array = [];
addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(arr, TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");
return arr;
}
static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,
-Alex

From: Serkan Taş 

Reply-To: 

Re: TextConverter method call

2019-11-26 Thread Serkan Taş
Alex, I have implemented in other way, here it is : > 
https://drive.google.com/open?id=1oPLnVz7jyWJe7Z_V25o773hQYlrRaD6B


But I have another exception in other thread , can you check it ?

subject : "org.apache.royale.textLayout.conversion.FormatDescriptor is 
not a constructor"


27.11.2019 01:34 tarihinde Alex Harui yazdı:


Nevermind, that won’t work in this case.  I think you still need to 
initialize _descriptors with a static initializer.  I think I would 
use an internal version of addFormat for doing that.  Or maybe 
manually code _descriptors as a get/set.


HTH,

-Alex

*From: *Alex Harui 
*Reply-To: *"users@royale.apache.org" 
*Date: *Tuesday, November 26, 2019 at 2:22 PM
*To: *"users@royale.apache.org" 
*Subject: *Re: TextConverter method call

Yes, probably a good idea, in which I case I would just use a dummy 
initializer


        /** @private */
        static public function setFormatsToDefault():Boolean    // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");


    return true;
        }
        static public var _descriptors:Array;

    static private var formatsSet:Boolean = setFormatsToDefault()


*From: *Serkan Taş 
*Reply-To: *"users@royale.apache.org" 
*Date: *Tuesday, November 26, 2019 at 11:44 AM
*To: *"users@royale.apache.org" 
*Subject: *Re: TextConverter method call

Do I have to keep addFormat and addFormatAt compatible for external 
usage, because they are public may be called from other classes ?


26.11.2019 21:15 tarihinde Alex Harui yazdı:

It “should” but we are not fully supporting “naked code” (code not
in methods) right now.  I’ve never liked the pattern and I’m not
sure all minifiers know how to handle it, so the easiest answer
for now is to rewrite the pattern.

One way to rewrite is to have setFormatDefaults return an array
and initialize _descriptors.  Something like:

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():Array    //
No PMD
        {
            var arr:Array = [];
            addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter,
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(arr, TEXT_FIELD_HTML_FORMAT,
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
            addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter,
PlainTextExporter, "air:text");

return arr;
        }
        static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,

-Alex

*From: *Serkan Taş 

*Reply-To: *"users@royale.apache.org"
 

*Date: *Tuesday, November 26, 2019 at 9:13 AM
*To: *"users@royale.apache.org" 
 
*Subject: *Re: TextConverter method call

Unfortunately there is not a getter for the property, but the call
for setFormatsToDefault is in the class body.

        public static const TEXT_LAYOUT_FORMAT:String =
"textLayoutFormat";

        // Descriptors - ordered list of all FormatDescriptors
        /** @private */
        static public var _descriptors:Array = [];

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():void // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter,
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT,
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter,
PlainTextExporter, "air:text");
        }


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan

26.11.2019 08:06 tarihinde Alex Harui yazdı:

Without looking at more of the code, I’m guessing there is a
“descriptors” property that returns the “_descriptors” array. 
If that’s the case, then I would add a check to the
descriptors getter to check if _descriptors has been
initialized and if not, call setFormatsToDefault.

-Alex

*From: *Serkan Taş 

*Reply-To: *"users@royale.apache.org"
 

*Date: *Monday, November 25, 2019 at 

Re: AdvancedDataGrid Emulation

2019-11-26 Thread Takeshita Shoichiro
Alex, thanks for help.

groupedColumns is one of the important components for our Flex
application.  I want to make it work for proposal presentation.

2019年11月27日(水) 0:21 Alex Harui :

> I don’t think anyone has tried groupedColumns yet.  I can look into it
> after we help Alina’s team finish their goal unless someone else beats me
> to it.  They are using ADG heavily, but I haven’t seen groupedColumns, just
> regular columns.
>
>
>
> -Alex
>
>
>
> *From: *Takeshita Shoichiro 
> *Reply-To: *"users@royale.apache.org" 
> *Date: *Tuesday, November 26, 2019 at 5:33 AM
> *To: *"users@royale.apache.org" 
> *Subject: *AdvancedDataGrid Emulation
>
>
>
>
>
> Hi,
>
>
>
>
>
>
>
> Is AdvancedDataGrid emulation supported by Royale? The compiled result of
> the following generates a frame but no contents.
>
>
>
>
>
>
>
> Do I need to do change other things other than name spaces?
>
>
>
>
>
>
>
> Thanks for your advice.
>
>
>
>
>
>
>
> S. Takeshita
>
>
>
>
> 
>
>
>
>
>
>
>
> 
>
>
>
> http://ns.adobe.com/mxml/2009
> 
> "
>
>
>
>xmlns:mx="library://ns.apache.org/royale/mx
> 
> "
>
>
>
>xmlns:s="library://ns.apache.org/royale/spark
> 
> "
>
>
>
>width="550" height="340">
>
>
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
>
>
>
>
> 
>
>
>  dataProvider="{dpFlat}"
>
>
>
>  width="100%" height="100%">
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>headerText="Territory Rep"/>
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
>
>
>
>
>
> --
>
> Shoichiro Takeshita
> 武下 祥一郎
>
-- 
Shoichiro Takeshita
武下 祥一郎


Re: TextConverter method call

2019-11-26 Thread Alex Harui
Nevermind, that won’t work in this case.  I think you still need to initialize 
_descriptors with a static initializer.  I think I would use an internal 
version of addFormat for doing that.  Or maybe manually code _descriptors as a 
get/set.

HTH,
-Alex

From: Alex Harui 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 2:22 PM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Yes, probably a good idea, in which I case I would just use a dummy initializer

/** @private */
static public function setFormatsToDefault():Boolean// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
return true;
}
static public var _descriptors:Array;
static private var formatsSet:Boolean = setFormatsToDefault()



From: Serkan Taş 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 11:44 AM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Do I have to keep addFormat and addFormatAt compatible for external usage, 
because they are public may be called from other classes ?
26.11.2019 21:15 tarihinde Alex Harui yazdı:
It “should” but we are not fully supporting “naked code” (code not in methods) 
right now.  I’ve never liked the pattern and I’m not sure all minifiers know 
how to handle it, so the easiest answer for now is to rewrite the pattern.

One way to rewrite is to have setFormatDefaults return an array and initialize 
_descriptors.  Something like:

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():Array// No PMD
{
var arr:Array = [];
addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(arr, TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");
return arr;
}
static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,
-Alex

From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Tuesday, November 26, 2019 at 9:13 AM
To: "users@royale.apache.org" 

Subject: Re: TextConverter method call

Unfortunately there is not a getter for the property, but the call for 
setFormatsToDefault is in the class body.

public static const TEXT_LAYOUT_FORMAT:String = "textLayoutFormat";

// Descriptors - ordered list of all FormatDescriptors
/** @private */
static public var _descriptors:Array = [];

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan
26.11.2019 08:06 tarihinde Alex Harui yazdı:
Without looking at more of the code, I’m guessing there is a “descriptors” 
property that returns the “_descriptors” array.  If that’s the case, then I 
would add a check to the descriptors getter to check if _descriptors has been 
initialized and if not, call setFormatsToDefault.

-Alex

From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Monday, November 25, 2019 at 12:55 PM
To: "users@royale.apache.org" 

Subject: TextConverter method call

Hi,

TextConverter has a method named setFormatsToDefault() and called while the 
application is loaded  - I guess automatically because I could not find any 
reference - in Flex, but never called in Royale.

Source piece Royale  :

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, 

Re: TextConverter method call

2019-11-26 Thread Alex Harui
Yes, probably a good idea, in which I case I would just use a dummy initializer

/** @private */
static public function setFormatsToDefault():Boolean// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
return true;
}
static public var _descriptors:Array;
static private var formatsSet:Boolean = setFormatsToDefault()


From: Serkan Taş 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 11:44 AM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Do I have to keep addFormat and addFormatAt compatible for external usage, 
because they are public may be called from other classes ?
26.11.2019 21:15 tarihinde Alex Harui yazdı:
It “should” but we are not fully supporting “naked code” (code not in methods) 
right now.  I’ve never liked the pattern and I’m not sure all minifiers know 
how to handle it, so the easiest answer for now is to rewrite the pattern.

One way to rewrite is to have setFormatDefaults return an array and initialize 
_descriptors.  Something like:

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():Array// No PMD
{
var arr:Array = [];
addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(arr, TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");
return arr;
}
static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,
-Alex

From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Tuesday, November 26, 2019 at 9:13 AM
To: "users@royale.apache.org" 

Subject: Re: TextConverter method call

Unfortunately there is not a getter for the property, but the call for 
setFormatsToDefault is in the class body.

public static const TEXT_LAYOUT_FORMAT:String = "textLayoutFormat";

// Descriptors - ordered list of all FormatDescriptors
/** @private */
static public var _descriptors:Array = [];

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan
26.11.2019 08:06 tarihinde Alex Harui yazdı:
Without looking at more of the code, I’m guessing there is a “descriptors” 
property that returns the “_descriptors” array.  If that’s the case, then I 
would add a check to the descriptors getter to check if _descriptors has been 
initialized and if not, call setFormatsToDefault.

-Alex

From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Monday, November 25, 2019 at 12:55 PM
To: "users@royale.apache.org" 

Subject: TextConverter method call

Hi,

TextConverter has a method named setFormatsToDefault() and called while the 
application is loaded  - I guess automatically because I could not find any 
reference - in Flex, but never called in Royale.

Source piece Royale  :

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}


Flex :

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static tlf_internal function setFormatsToDefault():void// No PMD
{
 

"org.apache.royale.textLayout.conversion.FormatDescriptor is not a constructor"

2019-11-26 Thread Serkan Taş

Hi Alex,

no compiler error, no console output on browser bu  discover this 
message in debugger, and can not explain. May be you have an idea :





message :

"org.apache.royale.textLayout.conversion.FormatDescriptor is not a 
constructor" stack :


"TypeError: org.apache.royale.textLayout.conversion.FormatDescriptor is 
not a constructor at eval (eval at 
org.apache.royale.textLayout.conversion.TextConverter.addFormatAt 
(http://192.168.1.32:4000/PInara/org/apache/royale/textLayout/conversion/TextConverter.js:353:92), 
:1:1) at 
Function.org.apache.royale.textLayout.conversion.TextConverter.addFormatAt 
(http://192.168.1.32:4000/PInara/org/apache/royale/textLayout/conversion/TextConverter.js:353:92) 
at 
Function.org.apache.royale.textLayout.conversion.TextConverter.addFormat 
(http://192.168.1.32:4000/PInara/org/apache/royale/textLayout/conversion/TextConverter.js:388:59) 
at 
Function.org.apache.royale.textLayout.conversion.TextConverter.setFormatsToDefault 
(http://192.168.1.32:4000/PInara/org/apache/royale/textLayout/conversion/TextConverter.js:147:57) 
at 
http://192.168.1.32:4000/PInara/org/apache/royale/textLayout/conversion/TextConverter.js:478:124; 



Re: TextConverter method call

2019-11-26 Thread Serkan Taş
Do I have to keep addFormat and addFormatAt compatible for external 
usage, because they are public may be called from other classes ?


26.11.2019 21:15 tarihinde Alex Harui yazdı:


It “should” but we are not fully supporting “naked code” (code not in 
methods) right now.  I’ve never liked the pattern and I’m not sure all 
minifiers know how to handle it, so the easiest answer for now is to 
rewrite the pattern.


One way to rewrite is to have setFormatDefaults return an array and 
initialize _descriptors.  Something like:


        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():Array // No PMD
        {
            var arr:Array = [];
            addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(arr, TEXT_FIELD_HTML_FORMAT, 
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
            addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");


    return arr;
        }
        static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,

-Alex

*From: *Serkan Taş 
*Reply-To: *"users@royale.apache.org" 
*Date: *Tuesday, November 26, 2019 at 9:13 AM
*To: *"users@royale.apache.org" 
*Subject: *Re: TextConverter method call

Unfortunately there is not a getter for the property, but the call for 
setFormatsToDefault is in the class body.


        public static const TEXT_LAYOUT_FORMAT:String = 
"textLayoutFormat";


        // Descriptors - ordered list of all FormatDescriptors
        /** @private */
        static public var _descriptors:Array = [];

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():void // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");

        }


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan

26.11.2019 08:06 tarihinde Alex Harui yazdı:

Without looking at more of the code, I’m guessing there is a
“descriptors” property that returns the “_descriptors” array.  If
that’s the case, then I would add a check to the descriptors
getter to check if _descriptors has been initialized and if not,
call setFormatsToDefault.

-Alex

*From: *Serkan Taş 

*Reply-To: *"users@royale.apache.org"
 

*Date: *Monday, November 25, 2019 at 12:55 PM
*To: *"users@royale.apache.org" 
 
*Subject: *TextConverter method call

Hi,

TextConverter has a method named /setFormatsToDefault()/ and
called while the application is loaded  - I guess automatically
because I could not find any reference - in Flex, but never called
in Royale.

Source piece Royale  :

// register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():void    // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter,
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT,
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter,
PlainTextExporter, "air:text");
        }


Flex :

// register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static tlf_internal function setFormatsToDefault():void   
// No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter,
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT,
TextFieldHtmlImporter,  TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter,
PlainTextExporter, "air:text");
        }

How should be the mechanism for the flow in Royale ?

Thanks,
Serkan








Re: TextConverter method call

2019-11-26 Thread Alex Harui
It “should” but we are not fully supporting “naked code” (code not in methods) 
right now.  I’ve never liked the pattern and I’m not sure all minifiers know 
how to handle it, so the easiest answer for now is to rewrite the pattern.

One way to rewrite is to have setFormatDefaults return an array and initialize 
_descriptors.  Something like:

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():Array// No PMD
{
var arr:Array = [];
addFormat(arr, TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(arr, TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(arr,PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");
return arr;
}
static public var _descriptors:Array = setFormatsToDefault()

You’ll have to change addFormat to accept the array to modify.

HTH,
-Alex

From: Serkan Taş 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 9:13 AM
To: "users@royale.apache.org" 
Subject: Re: TextConverter method call

Unfortunately there is not a getter for the property, but the call for 
setFormatsToDefault is in the class body.

public static const TEXT_LAYOUT_FORMAT:String = "textLayoutFormat";

// Descriptors - ordered list of all FormatDescriptors
/** @private */
static public var _descriptors:Array = [];

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan
26.11.2019 08:06 tarihinde Alex Harui yazdı:
Without looking at more of the code, I’m guessing there is a “descriptors” 
property that returns the “_descriptors” array.  If that’s the case, then I 
would add a check to the descriptors getter to check if _descriptors has been 
initialized and if not, call setFormatsToDefault.

-Alex

From: Serkan Taş 

Reply-To: "users@royale.apache.org" 

Date: Monday, November 25, 2019 at 12:55 PM
To: "users@royale.apache.org" 

Subject: TextConverter method call

Hi,

TextConverter has a method named setFormatsToDefault() and called while the 
application is loaded  - I guess automatically because I could not find any 
reference - in Flex, but never called in Royale.

Source piece Royale  :

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static public function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}


Flex :

// register standard importers and exporters
setFormatsToDefault();

/** @private */
static tlf_internal function setFormatsToDefault():void// No PMD
{
_descriptors = [];
addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, 
"air:text");
}

How should be the mechanism for the flow in Royale ?

Thanks,
Serkan






Re: TextConverter method call

2019-11-26 Thread Serkan Taş
Unfortunately there is not a getter for the property, but the call for 
setFormatsToDefault is in the class body.


        public static const TEXT_LAYOUT_FORMAT:String = "textLayoutFormat";

        // Descriptors - ordered list of all FormatDescriptors
        /** @private */
        static public var _descriptors:Array = [];

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():void    // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");

        }


Shouldn't it be called while the class is initialized ?

Thanks,
Serkan

26.11.2019 08:06 tarihinde Alex Harui yazdı:


Without looking at more of the code, I’m guessing there is a 
“descriptors” property that returns the “_descriptors” array.  If 
that’s the case, then I would add a check to the descriptors getter to 
check if _descriptors has been initialized and if not, call 
setFormatsToDefault.


-Alex

*From: *Serkan Taş 
*Reply-To: *"users@royale.apache.org" 
*Date: *Monday, November 25, 2019 at 12:55 PM
*To: *"users@royale.apache.org" 
*Subject: *TextConverter method call

Hi,

TextConverter has a method named /setFormatsToDefault()/ and called 
while the application is loaded  - I guess automatically because I 
could not find any reference - in Flex, but never called in Royale.


Source piece Royale  :

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static public function setFormatsToDefault():void // No PMD
        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");

        }


Flex :

        // register standard importers and exporters
        setFormatsToDefault();

        /** @private */
        static tlf_internal function setFormatsToDefault():void    // 
No PMD

        {
            _descriptors = [];
            addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, 
TextLayoutExporter, TEXT_LAYOUT_FORMAT);
            addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  
TextFieldHtmlExporter, null);
            addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, 
PlainTextExporter, "air:text");

        }

How should be the mechanism for the flow in Royale ?

Thanks,
Serkan





Re: AdvancedDataGrid Emulation

2019-11-26 Thread Alex Harui
I don’t think anyone has tried groupedColumns yet.  I can look into it after we 
help Alina’s team finish their goal unless someone else beats me to it.  They 
are using ADG heavily, but I haven’t seen groupedColumns, just regular columns.

-Alex

From: Takeshita Shoichiro 
Reply-To: "users@royale.apache.org" 
Date: Tuesday, November 26, 2019 at 5:33 AM
To: "users@royale.apache.org" 
Subject: AdvancedDataGrid Emulation


Hi,




Is AdvancedDataGrid emulation supported by Royale? The compiled result of the 
following generates a frame but no contents.




Do I need to do change other things other than name spaces?




Thanks for your advice.




S. Takeshita








http://ns.adobe.com/mxml/2009"

   
xmlns:mx="library://ns.apache.org/royale/mx"

   
xmlns:s="library://ns.apache.org/royale/spark"

   width="550" height="340">






































--
Shoichiro Takeshita
武下 祥一郎