我有一个非常大的 flex builder 项目,需要移植到 Haxe。我们所有的 actionscript 文件都是使用 as3hx 转换的。我读过有关 HaxeUI、FeathersUI 和 NME 的信息。这些选项中的任何一个是否使移植 MXML 文件变得容易,而不是完全重写它们?重要的是要注意,我的大部分 MXML 文件都包含大量 CDATA。
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
bottom="0"
top="0"
left="0"
right="0"
implements="com.dstawd.modeler.IDiagramInfoComponent"
creationComplete="onCreationComplete()">
<mx:Metadata>
[ResourceBundle("Modeler")]
[ResourceBundle("ServiceModeler")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import com.dstawd.modeler.Diagram;
import com.dstawd.modeler.assets.Icons;
import com.dstawd.modeler.component.shape.ShapeUIComponent;
import com.dstawd.modeler.controller.Controller;
import com.dstawd.modeler.controller.ValidationErrorMap;
import com.dstawd.modeler.events.ValidateEvent;
import com.dstawd.modeler.managers.WorkspaceManager;
// import com.dstawd.modeler.service.component.shape.Loop;
// import com.dstawd.modeler.service.LoopDiagram;
import mx.collections.ArrayCollection;
import mx.core.Application;
[Bindable] private var _diagram:Diagram;
[Bindable] private var _errors:ArrayCollection = new ArrayCollection();
private function onCreationComplete():void
{
validateButton.setStyle("skin", null);
}
private function refreshValidations():void
{
var application:IModeler = Application.application as IModeler;
var controller:Controller = application.controller;
controller.validate();
}
public function get diagram():Diagram
{
return _diagram;
}
public function set diagram(value:Diagram):void
{
_diagram = value;
}
public function get errors():ArrayCollection
{
return _errors;
}
public function set errors( errs:ArrayCollection ):void
{
_errors = errs || new ArrayCollection();
}
private function doClickAsItem( item:ValidationErrorMap ):void
{
if ( summary.selectedIndex < summary.maxVerticalScrollPosition )
{
summary.verticalScrollPosition = summary.selectedIndex;
}
if (item.component is ShapeUIComponent)
{
diagram.select(item.component as ShapeUIComponent);
}
}
protected function onDoubleClick(event:MouseEvent):void
{
var item:ValidationErrorMap = summary.selectedItem as ValidationErrorMap;
if (item && item.component)
{
// selectParent( item );
doClickAsItem( item );
}
}
]]>
</mx:Script>
<mx:HBox height="20"
width="100%"
verticalAlign="middle"
paddingRight="5">
<mx:Label text="{resourceManager.getString('Modeler', 'validPropPage_lbl_validResults')}"
fontWeight="bold"/>
<mx:Spacer width="100%"/>
<mx:Image source="{Icons.Refresh}"
buttonMode="true"
toolTip="{resourceManager.getString('ServiceModeler', 'toolTip_refreshValidations')}"
id="validateButton"
height="17"
width="17"
click="refreshValidations()"
mouseDownEffect="Glow"/>
</mx:HBox>
<mx:DataGrid id="summary"
width="100%"
height="100%"
verticalScrollPolicy="on"
wordWrap="false"
paddingBottom="0"
dataProvider="{_errors}"
doubleClickEnabled="true"
doubleClick="onDoubleClick(event);">
<mx:columns>
<mx:DataGridColumn headerText="{resourceManager.getString('Modeler', 'validPropPage_hdr_element')}"
dataField="name" />
<mx:DataGridColumn headerText="{resourceManager.getString('Modeler', 'validPropPage_hdr_message')}"
dataField="message"
dataTipField="message"
showDataTips="true"/>
</mx:columns>
</mx:DataGrid>
</mx:VBox>