From ee9197650116b2854ccddf72d2dae8ea37d0ff68 Mon Sep 17 00:00:00 2001 From: vlad-iordanescu Date: Tue, 3 Jun 2014 18:16:06 +0300 Subject: [PATCH 1/9] Modifications for integration with other apps --- org.flowerplatform.core/.classpath | 1 + org.flowerplatform.core/.project | 15 +++++- .../.settings/org.eclipse.jdt.core.prefs | 6 +-- .../org.eclipse.wst.common.component | 5 ++ ....eclipse.wst.common.project.facet.core.xml | 7 +++ .../src/META-INF/MANIFEST.MF | 3 ++ .../src/FlexHostApp.mxml | 34 ++++++++++--- .../properties/PropertiesPlugin.as | 13 ++++- .../properties/PropertiesView.mxml | 51 +++++++++++++------ .../properties/PropertyItemRenderer.mxml | 5 ++ .../BasicPropertyRenderer.as | 18 ++++--- .../plugin/FlexPluginLoadingSession.as | 45 ++++++++++------ .../flexutil/plugin/FlexPluginManager.as | 2 +- .../flexutil/spinner/LogoSpinner.as | 11 ++-- org.flowerplatform.resources/.classpath | 1 + org.flowerplatform.resources/.project | 13 +++++ .../.settings/org.eclipse.jdt.core.prefs | 7 +++ .../org.eclipse.wst.common.component | 5 ++ ....eclipse.wst.common.project.facet.core.xml | 7 +++ .../src/META-INF/MANIFEST.MF | 3 ++ org.flowerplatform.util/.classpath | 1 + org.flowerplatform.util/.project | 13 +++++ .../.settings/org.eclipse.jdt.core.prefs | 6 +-- .../org.eclipse.wst.common.component | 5 ++ ....eclipse.wst.common.project.facet.core.xml | 7 +++ .../src/META-INF/MANIFEST.MF | 3 ++ .../util/servlet/PublicResourcesServlet.java | 10 +++- .../util/servlet/ResourcesServlet.java | 16 ++++++ 28 files changed, 252 insertions(+), 61 deletions(-) create mode 100644 org.flowerplatform.core/.settings/org.eclipse.wst.common.component create mode 100644 org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 org.flowerplatform.core/src/META-INF/MANIFEST.MF create mode 100644 org.flowerplatform.resources/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.flowerplatform.resources/.settings/org.eclipse.wst.common.component create mode 100644 org.flowerplatform.resources/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 org.flowerplatform.resources/src/META-INF/MANIFEST.MF create mode 100644 org.flowerplatform.util/.settings/org.eclipse.wst.common.component create mode 100644 org.flowerplatform.util/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 org.flowerplatform.util/src/META-INF/MANIFEST.MF diff --git a/org.flowerplatform.core/.classpath b/org.flowerplatform.core/.classpath index 878ef84c..a30f3d1f 100644 --- a/org.flowerplatform.core/.classpath +++ b/org.flowerplatform.core/.classpath @@ -6,5 +6,6 @@ + diff --git a/org.flowerplatform.core/.project b/org.flowerplatform.core/.project index 1a268b8e..5aa9df1e 100644 --- a/org.flowerplatform.core/.project +++ b/org.flowerplatform.core/.project @@ -5,6 +5,11 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder @@ -19,10 +24,18 @@ org.eclipse.pde.SchemaBuilder - + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature diff --git a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs b/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs index 11f6e462..f287d53c 100644 --- a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs +++ b/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.flowerplatform.core/.settings/org.eclipse.wst.common.component b/org.flowerplatform.core/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..0bc223f5 --- /dev/null +++ b/org.flowerplatform.core/.settings/org.eclipse.wst.common.component @@ -0,0 +1,5 @@ + + + + + diff --git a/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..7ba6051d --- /dev/null +++ b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.flowerplatform.core/src/META-INF/MANIFEST.MF b/org.flowerplatform.core/src/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/org.flowerplatform.core/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/org.flowerplatform.flex_client.host_app/src/FlexHostApp.mxml b/org.flowerplatform.flex_client.host_app/src/FlexHostApp.mxml index 1a490f56..487d690f 100644 --- a/org.flowerplatform.flex_client.host_app/src/FlexHostApp.mxml +++ b/org.flowerplatform.flex_client.host_app/src/FlexHostApp.mxml @@ -21,7 +21,7 @@ license-end - @@ -48,6 +48,7 @@ license-end - - diff --git a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesPlugin.as b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesPlugin.as index 24b5491c..0da1a6ac 100644 --- a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesPlugin.as +++ b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesPlugin.as @@ -21,6 +21,7 @@ package org.flowerplatform.flex_client.properties { import org.flowerplatform.flexutil.FactoryWithInitialization; import org.flowerplatform.flexutil.FlexUtilGlobals; import org.flowerplatform.flexutil.Utils; + import org.flowerplatform.flexutil.controller.TypeDescriptorRegistry; /** * @author Razvan Tache @@ -32,6 +33,8 @@ package org.flowerplatform.flex_client.properties { public var propertyRendererClasses:Dictionary = new Dictionary(); public var currentSelection:IList; + + public var nodeTypeDescriptorRegistry:TypeDescriptorRegistry; public static function getInstance():PropertiesPlugin { return INSTANCE; @@ -44,10 +47,16 @@ package org.flowerplatform.flex_client.properties { } INSTANCE = this; + if (CorePlugin.getInstance() != null) { + nodeTypeDescriptorRegistry = CorePlugin.getInstance().nodeTypeDescriptorRegistry; + } + FlexUtilGlobals.getInstance().composedViewProvider.addViewProvider(new PropertiesViewProvider()); - CorePlugin.getInstance().editorClassFactoryActionProvider.addActionClass(ShowPropertiesAction); - CorePlugin.getInstance().getEditorClassFactoryActionProvider().addActionClass(NewComposedAction); + if (CorePlugin.getInstance() != null) { + CorePlugin.getInstance().editorClassFactoryActionProvider.addActionClass(ShowPropertiesAction); + CorePlugin.getInstance().getEditorClassFactoryActionProvider().addActionClass(NewComposedAction); + } } override public function start():void { diff --git a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesView.mxml b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesView.mxml index acde8aeb..a790dbe9 100644 --- a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesView.mxml +++ b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertiesView.mxml @@ -34,6 +34,10 @@ import org.flowerplatform.flexutil.view_content_host.IViewHost; protected var _viewHost:IViewHost; + + protected var _nodes:IList; + + protected var _commitEachPropertyAutomatically:Boolean = true; private var currentPropertyDescriptorsDisplayed:IList; @@ -67,8 +71,17 @@ public function getActions(selection:IList):Vector. { return null; } - - private function selectionChangedHandler(event:SelectionChangedEvent):void { + + public function set commitEachPropertyAutomatically(value:Boolean):void { + _commitEachPropertyAutomatically = value; + } + + public function get nodes():IList { + return _nodes; + } + + public function set nodes(nodeList:IList):void { + _nodes = nodeList; var i:int; // remove listeners from previous selection @@ -93,17 +106,17 @@ } (recycledRenderers[type] as Array).push(propertyItemRenderer); } - + label.text = ""; - - if (event.selection == null || event.selection.length == 0 || !(event.selection.getItemAt(0) is Node)) { // happens when changing active view + + if (nodeList == null || nodeList.length == 0 || !(nodeList.getItemAt(0) is Node)) { // happens when changing active view currentPropertyDescriptorsDisplayed = null; propertyForm.removeAllElements(); return; } // get new selected node - var node:Node = Node(event.selection.getItemAt(0)); + var node:Node = Node(nodeList.getItemAt(0)); if (node.parent == null && node.children == null) { // root node, don't populate with properties currentPropertyDescriptorsDisplayed = null; @@ -112,16 +125,16 @@ } // update label - var titleProvider:GenericValueProviderFromDescriptor = NodeControllerUtils.getTitleProvider(CorePlugin.getInstance().nodeTypeDescriptorRegistry, node); + /* var titleProvider:GenericValueProviderFromDescriptor = NodeControllerUtils.getTitleProvider(PropertiesPlugin.getInstance().nodeTypeDescriptorRegistry, node); label.text = String(titleProvider.getValue(node)); - label.maxWidth = UIComponent(this).width; - + label.maxWidth = UIComponent(this).width; */ + // store new selection - PropertiesPlugin.getInstance().currentSelection = new ArrayList(event.selection.toArray()); + PropertiesPlugin.getInstance().currentSelection = new ArrayList(nodeList.toArray()); // get properties to display - var newPropertyDescriptorsToDisplay:IList = CorePlugin.getInstance().nodeTypeDescriptorRegistry.getExpectedTypeDescriptor(node.type).getAdditiveControllers(PropertiesConstants.PROPERTY_DESCRIPTOR, node); - + var newPropertyDescriptorsToDisplay:IList = PropertiesPlugin.getInstance().nodeTypeDescriptorRegistry.getExpectedTypeDescriptor(node.type).getAdditiveControllers(PropertiesConstants.PROPERTY_DESCRIPTOR, node); + // if same descriptors -> no need to recalculate renderers, only set new node properties if (currentPropertyDescriptorsDisplayed != newPropertyDescriptorsToDisplay) { propertyForm.removeAllElements(); @@ -131,16 +144,16 @@ for (i = 0; i < newPropertyDescriptorsToDisplay.length; i++) { var propertyRenderer:PropertyItemRenderer; var propertyDescriptor:PropertyDescriptor = PropertyDescriptor(ObjectUtil.copy(newPropertyDescriptorsToDisplay.getItemAt(i))); - + if (propertyDescriptor.category != currentCategory) { // display category renderer var categoryItem:CategoryPropertyRenderer = new CategoryPropertyRenderer(); categoryItem.label = propertyDescriptor.category; propertyForm.addElement(categoryItem); - + currentCategory = propertyDescriptor.category; } - + var renderersToReuse:Array = recycledRenderers[propertyDescriptor.type] as Array; if (renderersToReuse != null && renderersToReuse.length > 0) { // there is already created a renderer for this type of property descriptor, reuse it @@ -151,6 +164,8 @@ } propertyForm.addElement(propertyRenderer); propertyRenderer.data = propertyDescriptor; + if (!_commitEachPropertyAutomatically) + propertyRenderer.node = nodes.getItemAt(0) as Node; } } @@ -159,7 +174,7 @@ // get values from node properties nodeUpdatedHandler(new NodeUpdatedEvent(node)); - + // add listeners to current selection var currentSelection:IList = PropertiesPlugin.getInstance().currentSelection; if (currentSelection != null) { @@ -168,6 +183,10 @@ } } } + + private function selectionChangedHandler(event:SelectionChangedEvent):void { + nodes = event.selection; + } private function nodeUpdatedHandler(event:NodeUpdatedEvent):void { var node:Node = event.node; diff --git a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertyItemRenderer.mxml b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertyItemRenderer.mxml index 0a678d3f..f5770e6c 100644 --- a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertyItemRenderer.mxml +++ b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/PropertyItemRenderer.mxml @@ -12,6 +12,7 @@ import mx.core.UIComponent; import mx.events.FlexEvent; + import org.flowerplatform.flex_client.core.editor.remote.Node; import org.flowerplatform.flex_client.properties.property_renderer.BasicPropertyRenderer; import org.flowerplatform.flex_client.properties.remote.PropertyDescriptor; import org.flowerplatform.flexutil.FactoryWithInitialization; @@ -24,6 +25,10 @@ private var basicPropertyRenderer:BasicPropertyRenderer; + public function set node(_node:Node) { + basicPropertyRenderer._node = _node; + } + public function get data():Object { return _data; } diff --git a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/property_renderer/BasicPropertyRenderer.as b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/property_renderer/BasicPropertyRenderer.as index 639a9a73..b2859065 100644 --- a/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/property_renderer/BasicPropertyRenderer.as +++ b/org.flowerplatform.flex_client.properties/src/org/flowerplatform/flex_client/properties/property_renderer/BasicPropertyRenderer.as @@ -5,15 +5,15 @@ package org.flowerplatform.flex_client.properties.property_renderer { import mx.binding.utils.BindingUtils; - import spark.components.CheckBox; - import spark.components.DataRenderer; - import spark.layouts.HorizontalLayout; - import org.flowerplatform.flex_client.core.CorePlugin; import org.flowerplatform.flex_client.core.editor.remote.Node; import org.flowerplatform.flex_client.properties.PropertiesPlugin; import org.flowerplatform.flex_client.properties.remote.PropertyDescriptor; import org.flowerplatform.flex_client.resources.Resources; + + import spark.components.CheckBox; + import spark.components.DataRenderer; + import spark.layouts.HorizontalLayout; /** * @author Razvan Tache @@ -28,7 +28,9 @@ package org.flowerplatform.flex_client.properties.property_renderer { public var savePropertyEnabled:Boolean = true; public var changeCheckBox:CheckBox = new CheckBox(); - + + public var _node:Node; + public function BasicPropertyRenderer() { super(); layout = new HorizontalLayout; @@ -69,7 +71,11 @@ package org.flowerplatform.flex_client.properties.property_renderer { return true; } - protected function saveProperty():void { + protected function saveProperty():void { + if (_node != null) { + _node.properties[propertyDescriptor.name] = getValue(); + return; + } if (savePropertyEnabled && !propertyDescriptor.readOnly) { if (!validPropertyValue()) { return; diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginLoadingSession.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginLoadingSession.as index 1b84d9e5..a738fecb 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginLoadingSession.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginLoadingSession.as @@ -243,16 +243,18 @@ package org.flowerplatform.flexutil.plugin { // setup extension points for each (var descriptor:FlexPluginDescriptor in descriptors) { if (descriptor.errorObject == null) { - try { - var className:String = getClassNameForFlexPluginEntry(descriptor.url); - var clazz:Class = Class(getDefinitionByName(className)); - descriptor.flexPlugin = new clazz(); - descriptor.flexPlugin.flexPluginDescriptor = descriptor; - descriptor.flexPlugin.preStart(); - - flexPluginManager.flexPluginEntries.addItem(descriptor); - } catch (e:Object) { - descriptor.errorObject = e; + if (getStartPlugin(descriptor.url)) { + try { + var className:String = getClassNameForFlexPluginEntry(descriptor.url); + var clazz:Class = Class(getDefinitionByName(className)); + descriptor.flexPlugin = new clazz(); + descriptor.flexPlugin.flexPluginDescriptor = descriptor; + descriptor.flexPlugin.preStart(); + + flexPluginManager.flexPluginEntries.addItem(descriptor); + } catch (e:Object) { + descriptor.errorObject = e; + } } } @@ -261,12 +263,14 @@ package org.flowerplatform.flexutil.plugin { // start plugins for each (descriptor in descriptors) { if (descriptor.errorObject == null) { - try { - className = getClassNameForFlexPluginEntry(descriptor.url); - clazz = Class(getDefinitionByName(className)); - descriptor.flexPlugin.start(); - } catch (e:Object) { - descriptor.errorObject = e; + if (getStartPlugin(descriptor.url)) { + try { + className = getClassNameForFlexPluginEntry(descriptor.url); + clazz = Class(getDefinitionByName(className)); + descriptor.flexPlugin.start(); + } catch (e:Object) { + descriptor.errorObject = e; + } } } @@ -307,6 +311,15 @@ package org.flowerplatform.flexutil.plugin { } } + protected function getStartPlugin(url:String):Boolean { + var startPluginRegEx:RegExp = new RegExp("[\\?&]startPlugin=(.*?)[\\z|&]"); + var startPluginRegExGroups:Array = startPluginRegEx.exec(url); + if (startPluginRegExGroups != null && startPluginRegExGroups.length == 2 && startPluginRegExGroups[1] == "false") { + return false; + } + return true; + } + protected function handlePluginsWithErrors(failedEntries:ArrayCollection):void { var text:String = ""; for each (var entry:FlexPluginDescriptor in failedEntries) { diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginManager.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginManager.as index 05b23d35..420d1961 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginManager.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/plugin/FlexPluginManager.as @@ -44,7 +44,7 @@ package org.flowerplatform.flexutil.plugin { currentLoadingSession = createLoadingSession(); currentLoadingSession.loadPlugins(pluginSwcUrls, callbackFunction, callbackObject); } - + /** * Append "version=..." to list of url's parameters. * @author Cristina Constantinescu diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/spinner/LogoSpinner.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/spinner/LogoSpinner.as index c69919b9..ee782b16 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/spinner/LogoSpinner.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/spinner/LogoSpinner.as @@ -1,5 +1,7 @@ package org.flowerplatform.flexutil.spinner { import mx.controls.Image; + + import org.flowerplatform.flexutil.FlexUtilGlobals; /** * Spinner with logo. @@ -7,9 +9,9 @@ package org.flowerplatform.flexutil.spinner { */ public class LogoSpinner extends ModalSpinner { - private var logoIcon:Class; + private var logoIcon:Object; - public function LogoSpinner(logoIcon:Class) { + public function LogoSpinner(logoIcon:Object) { this.logoIcon = logoIcon; } @@ -19,7 +21,10 @@ package org.flowerplatform.flexutil.spinner { spinner.size = 46; var icon:Image = new Image(); - icon.source = logoIcon; + if (logoIcon is String) + icon.source = FlexUtilGlobals.getInstance().adjustImageBeforeDisplaying(logoIcon); + else + icon.source = logoIcon; addChildAt(icon, 0); } diff --git a/org.flowerplatform.resources/.classpath b/org.flowerplatform.resources/.classpath index b1dabee3..000104da 100644 --- a/org.flowerplatform.resources/.classpath +++ b/org.flowerplatform.resources/.classpath @@ -3,5 +3,6 @@ + diff --git a/org.flowerplatform.resources/.project b/org.flowerplatform.resources/.project index f4d548f9..0b3be501 100644 --- a/org.flowerplatform.resources/.project +++ b/org.flowerplatform.resources/.project @@ -5,6 +5,11 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder @@ -20,9 +25,17 @@ + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature diff --git a/org.flowerplatform.resources/.settings/org.eclipse.jdt.core.prefs b/org.flowerplatform.resources/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f287d53c --- /dev/null +++ b/org.flowerplatform.resources/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.flowerplatform.resources/.settings/org.eclipse.wst.common.component b/org.flowerplatform.resources/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..10b14158 --- /dev/null +++ b/org.flowerplatform.resources/.settings/org.eclipse.wst.common.component @@ -0,0 +1,5 @@ + + + + + diff --git a/org.flowerplatform.resources/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.flowerplatform.resources/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..7ba6051d --- /dev/null +++ b/org.flowerplatform.resources/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.flowerplatform.resources/src/META-INF/MANIFEST.MF b/org.flowerplatform.resources/src/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/org.flowerplatform.resources/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/org.flowerplatform.util/.classpath b/org.flowerplatform.util/.classpath index fb9061a6..d971c0a4 100644 --- a/org.flowerplatform.util/.classpath +++ b/org.flowerplatform.util/.classpath @@ -8,5 +8,6 @@ + diff --git a/org.flowerplatform.util/.project b/org.flowerplatform.util/.project index 2e7ba81a..5a6b2b6f 100644 --- a/org.flowerplatform.util/.project +++ b/org.flowerplatform.util/.project @@ -5,6 +5,11 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder @@ -20,9 +25,17 @@ + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature diff --git a/org.flowerplatform.util/.settings/org.eclipse.jdt.core.prefs b/org.flowerplatform.util/.settings/org.eclipse.jdt.core.prefs index 11f6e462..f287d53c 100644 --- a/org.flowerplatform.util/.settings/org.eclipse.jdt.core.prefs +++ b/org.flowerplatform.util/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.flowerplatform.util/.settings/org.eclipse.wst.common.component b/org.flowerplatform.util/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..59d34069 --- /dev/null +++ b/org.flowerplatform.util/.settings/org.eclipse.wst.common.component @@ -0,0 +1,5 @@ + + + + + diff --git a/org.flowerplatform.util/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.flowerplatform.util/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..7ba6051d --- /dev/null +++ b/org.flowerplatform.util/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.flowerplatform.util/src/META-INF/MANIFEST.MF b/org.flowerplatform.util/src/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/org.flowerplatform.util/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/org.flowerplatform.util/src/org/flowerplatform/util/servlet/PublicResourcesServlet.java b/org.flowerplatform.util/src/org/flowerplatform/util/servlet/PublicResourcesServlet.java index 866a2795..01b69565 100644 --- a/org.flowerplatform.util/src/org/flowerplatform/util/servlet/PublicResourcesServlet.java +++ b/org.flowerplatform.util/src/org/flowerplatform/util/servlet/PublicResourcesServlet.java @@ -20,6 +20,7 @@ import java.io.BufferedInputStream; import java.io.Closeable; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -55,7 +56,7 @@ public class PublicResourcesServlet extends ResourcesServlet { private static final long serialVersionUID = 1L; private static final int DEFAULT_BUFFER_SIZE = 10240; // 10KB. - + private static void close(Closeable resource) { if (resource != null) { try { @@ -192,7 +193,12 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t } } - requestedFile = "platform:/plugin" + plugin + "/" + UtilConstants.PUBLIC_RESOURCES_DIR + file; +// requestedFile = "platform:/plugin" + plugin + "/" + UtilConstants.PUBLIC_RESOURCES_DIR + file; + requestedFile = plugin + "/" + prefix + file; + if (useRealPath) { + requestedFile = getServletContext().getRealPath(requestedFile); + } + requestedFile = protocol + requestedFile; // Get content type by filename from the file or file inside zip String contentType = getServletContext().getMimeType(fileInsideZipArchive != null ? fileInsideZipArchive : file); diff --git a/org.flowerplatform.util/src/org/flowerplatform/util/servlet/ResourcesServlet.java b/org.flowerplatform.util/src/org/flowerplatform/util/servlet/ResourcesServlet.java index ed2e0a9e..f170e7f4 100644 --- a/org.flowerplatform.util/src/org/flowerplatform/util/servlet/ResourcesServlet.java +++ b/org.flowerplatform.util/src/org/flowerplatform/util/servlet/ResourcesServlet.java @@ -26,6 +26,18 @@ public abstract class ResourcesServlet extends HttpServlet { private static final Logger logger = LoggerFactory.getLogger(ResourcesServlet.class); protected boolean useFilesFromTemporaryDirectory = false; + + protected static final String PROTOCOL = "protocol"; + + protected static final String PREFIX = "prefix"; + + protected static final String USE_REAL_PATH = "useRealPath"; + + protected String protocol; + + protected String prefix; + + protected boolean useRealPath; /** * @author Cristina Constantinescu @@ -36,6 +48,10 @@ public void init(ServletConfig config) throws ServletException { ServletUtils.addAllAdditionalAttributesToServletContext(getServletContext()); useFilesFromTemporaryDirectory = Boolean.valueOf((String) getServletContext().getAttribute(ServletUtils.PROP_USE_FILES_FROM_TEMPORARY_DIRECTORY)); + + protocol = config.getInitParameter(PROTOCOL); + prefix = config.getInitParameter(PREFIX); + useRealPath = Boolean.parseBoolean(config.getInitParameter(USE_REAL_PATH)); } protected void send404(HttpServletRequest request, HttpServletResponse response) { From 947fe07057c2e2676aa26ba82dc8f05ca251de71 Mon Sep 17 00:00:00 2001 From: Florin Buzatu Date: Tue, 10 Jun 2014 09:52:48 +0300 Subject: [PATCH 2/9] small fix in main.jsp --- org.flowerplatform.flex_client.host_app/WebContent/main.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.flowerplatform.flex_client.host_app/WebContent/main.jsp b/org.flowerplatform.flex_client.host_app/WebContent/main.jsp index de27a8ea..e5e7cb59 100644 --- a/org.flowerplatform.flex_client.host_app/WebContent/main.jsp +++ b/org.flowerplatform.flex_client.host_app/WebContent/main.jsp @@ -39,7 +39,7 @@ From 743840cbb7f0fc1ce6f604528dff332af3326fb0 Mon Sep 17 00:00:00 2001 From: Iordanescu Vlad Date: Thu, 12 Jun 2014 17:05:50 +0300 Subject: [PATCH 3/9] Fix error in core --- .../.settings/org.eclipse.jdt.core.prefs | 10 +++++++--- .../org.eclipse.wst.common.project.facet.core.xml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs b/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs index f287d53c..838bd9d6 100644 --- a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs +++ b/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml index 7ba6051d..4144bc9e 100644 --- a/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -2,6 +2,6 @@ - + From ca8a5492d3f922db07d1185b947b88c64f97f0ee Mon Sep 17 00:00:00 2001 From: Florin Buzatu Date: Mon, 23 Jun 2014 13:22:51 +0300 Subject: [PATCH 4/9] Added method to add type descriptors to registry --- .../.settings/org.eclipse.jdt.core.prefs | 7 ---- .../flex_client/core/CorePlugin.as | 34 +------------------ .../controller/TypeDescriptorRegistry.as | 32 +++++++++++++++++ 3 files changed, 33 insertions(+), 40 deletions(-) delete mode 100644 org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs diff --git a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs b/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f287d53c..00000000 --- a/org.flowerplatform.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as b/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as index 030ef549..21cac783 100644 --- a/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as +++ b/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as @@ -194,39 +194,7 @@ package org.flowerplatform.flex_client.core { } ); - serviceLocator.invoke("nodeService.getRegisteredTypeDescriptors", null, - function(result:Object):void { - var list:ArrayCollection = ArrayCollection(result); - for (var i:int = 0; i < list.length; i++) { - var remote:TypeDescriptorRemote = TypeDescriptorRemote(list.getItemAt(i)); - - // create new type descriptor with remote type - var descriptor:TypeDescriptor = null; - if (Utils.beginsWith(remote.type, FlexUtilConstants.CATEGORY_PREFIX)) { - descriptor = nodeTypeDescriptorRegistry.getOrCreateCategoryTypeDescriptor(remote.type); - } else { - descriptor = nodeTypeDescriptorRegistry.getOrCreateTypeDescriptor(remote.type); - } - - // add static categories - for each (var category:String in remote.categories) { - descriptor.addCategory(category); - } - - // add single controllers - for (var singleControllerType:String in remote.singleControllers) { - descriptor.addSingleController(singleControllerType, remote.singleControllers[singleControllerType]); - } - - // add additive controllers - for (var additiveControllerType:String in remote.additiveControllers) { - for each (var additiveController:AbstractController in remote.additiveControllers[additiveControllerType]) { - descriptor.addAdditiveController(additiveControllerType, additiveController); - } - } - } - } - ); + serviceLocator.invoke("nodeService.getRegisteredTypeDescriptors", null, nodeTypeDescriptorRegistry.addTypeDescriptorsRemote); nodeTypeDescriptorRegistry.getOrCreateCategoryTypeDescriptor(FlexUtilConstants.CATEGORY_ALL) .addSingleController(CoreConstants.NODE_TITLE_PROVIDER, new GenericValueProviderFromDescriptor(CoreConstants.PROPERTY_FOR_TITLE_DESCRIPTOR)) diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/controller/TypeDescriptorRegistry.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/controller/TypeDescriptorRegistry.as index b0cbe0ac..1d0691a2 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/controller/TypeDescriptorRegistry.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/controller/TypeDescriptorRegistry.as @@ -1,6 +1,7 @@ package org.flowerplatform.flexutil.controller { import flash.utils.Dictionary; + import mx.collections.ArrayCollection; import mx.collections.IList; import mx.core.mx_internal; @@ -73,6 +74,37 @@ package org.flowerplatform.flexutil.controller { getDynamicCategoryProviders().addItem(provider); } + public function addTypeDescriptorsRemote(typeDescriptorRemoteList:ArrayCollection): void { + for (var i:int = 0; i < typeDescriptorRemoteList.length; i++) { + var remote:TypeDescriptorRemote = TypeDescriptorRemote(typeDescriptorRemoteList.getItemAt(i)); + + // create new type descriptor with remote type + var descriptor:TypeDescriptor = null; + if (Utils.beginsWith(remote.type, FlexUtilConstants.CATEGORY_PREFIX)) { + descriptor = this.getOrCreateCategoryTypeDescriptor(remote.type); + } else { + descriptor = this.getOrCreateTypeDescriptor(remote.type); + } + + // add static categories + for each (var category:String in remote.categories) { + descriptor.addCategory(category); + } + + // add single controllers + for (var singleControllerType:String in remote.singleControllers) { + descriptor.addSingleController(singleControllerType, remote.singleControllers[singleControllerType]); + } + + // add additive controllers + for (var additiveControllerType:String in remote.additiveControllers) { + for each (var additiveController:AbstractController in remote.additiveControllers[additiveControllerType]) { + descriptor.addAdditiveController(additiveControllerType, additiveController); + } + } + } + } + public function TypeDescriptorRegistry() { super(); addDynamicCategoryProvider(new AllDynamicCategoryProvider()); From f5d1c9074cfaf77f4290870b91294c3963f1b26c Mon Sep 17 00:00:00 2001 From: Sebastian Solomon Date: Fri, 11 Jul 2014 15:54:25 +0300 Subject: [PATCH 5/9] Events - first iteration --- org.flowerplatform.core/.classpath | 6 +++++- org.flowerplatform.core/.gitignore | 1 + .../org.eclipse.wst.common.project.facet.core.xml | 2 +- .../.flexLibProperties | 6 ++++++ .../.flexLibProperties | 11 +++++++++-- .../public-resources/.gitignore | 1 + org.flowerplatform.flex_client.resources/.gitignore | 1 + org.flowerplatform.flexdiagram/.gitignore | 1 + org.flowerplatform.flexutil_legacy/.gitignore | 1 + org.flowerplatform.resources/.gitignore | 2 ++ org.flowerplatform.util/.gitignore | 2 ++ 11 files changed, 30 insertions(+), 4 deletions(-) diff --git a/org.flowerplatform.core/.classpath b/org.flowerplatform.core/.classpath index a30f3d1f..e72574c1 100644 --- a/org.flowerplatform.core/.classpath +++ b/org.flowerplatform.core/.classpath @@ -2,10 +2,14 @@ - + + + + + diff --git a/org.flowerplatform.core/.gitignore b/org.flowerplatform.core/.gitignore index 5e56e040..167fb2c0 100644 --- a/org.flowerplatform.core/.gitignore +++ b/org.flowerplatform.core/.gitignore @@ -1 +1,2 @@ /bin +/bin diff --git a/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml index 7ba6051d..51caf299 100644 --- a/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/org.flowerplatform.core/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -2,6 +2,6 @@ - + diff --git a/org.flowerplatform.flex_client.core/.flexLibProperties b/org.flowerplatform.flex_client.core/.flexLibProperties index 3043e14d..fe78c50d 100644 --- a/org.flowerplatform.flex_client.core/.flexLibProperties +++ b/org.flowerplatform.flex_client.core/.flexLibProperties @@ -7,6 +7,12 @@ + + + + + + diff --git a/org.flowerplatform.flex_client.properties/.flexLibProperties b/org.flowerplatform.flex_client.properties/.flexLibProperties index e2fb37ad..e4f19c76 100644 --- a/org.flowerplatform.flex_client.properties/.flexLibProperties +++ b/org.flowerplatform.flex_client.properties/.flexLibProperties @@ -1,11 +1,18 @@ - - + + + + + + + + + diff --git a/org.flowerplatform.flex_client.properties/public-resources/.gitignore b/org.flowerplatform.flex_client.properties/public-resources/.gitignore index 67e8ead1..8934b89f 100644 --- a/org.flowerplatform.flex_client.properties/public-resources/.gitignore +++ b/org.flowerplatform.flex_client.properties/public-resources/.gitignore @@ -1 +1,2 @@ /swc +/swc diff --git a/org.flowerplatform.flex_client.resources/.gitignore b/org.flowerplatform.flex_client.resources/.gitignore index 5e56e040..167fb2c0 100644 --- a/org.flowerplatform.flex_client.resources/.gitignore +++ b/org.flowerplatform.flex_client.resources/.gitignore @@ -1 +1,2 @@ /bin +/bin diff --git a/org.flowerplatform.flexdiagram/.gitignore b/org.flowerplatform.flexdiagram/.gitignore index 167fb2c0..bca9b393 100644 --- a/org.flowerplatform.flexdiagram/.gitignore +++ b/org.flowerplatform.flexdiagram/.gitignore @@ -1,2 +1,3 @@ /bin /bin +/bin diff --git a/org.flowerplatform.flexutil_legacy/.gitignore b/org.flowerplatform.flexutil_legacy/.gitignore index 291ea662..abfbf763 100644 --- a/org.flowerplatform.flexutil_legacy/.gitignore +++ b/org.flowerplatform.flexutil_legacy/.gitignore @@ -41,3 +41,4 @@ /bin /bin /bin +/bin diff --git a/org.flowerplatform.resources/.gitignore b/org.flowerplatform.resources/.gitignore index 5e56e040..bca9b393 100644 --- a/org.flowerplatform.resources/.gitignore +++ b/org.flowerplatform.resources/.gitignore @@ -1 +1,3 @@ /bin +/bin +/bin diff --git a/org.flowerplatform.util/.gitignore b/org.flowerplatform.util/.gitignore index 5e56e040..bca9b393 100644 --- a/org.flowerplatform.util/.gitignore +++ b/org.flowerplatform.util/.gitignore @@ -1 +1,3 @@ /bin +/bin +/bin From e46389779c7f56c0eeb96016e561f100e436b357 Mon Sep 17 00:00:00 2001 From: Mircea Negreanu Date: Thu, 24 Jul 2014 12:22:23 +0300 Subject: [PATCH 6/9] Added posibility for the menu to have separator. --- .../flowerplatform/flexutil/global_menu/GlobalMenuBar.as | 5 +++++ .../flexutil/global_menu/GlobalMenuDataDescriptor.as | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuBar.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuBar.as index bfb25b27..3a4f3642 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuBar.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuBar.as @@ -77,6 +77,11 @@ package org.flowerplatform.flexutil.global_menu { */ protected var menuItemRender:IFactory; + /** + * Label for the action to be considered as separator + */ + public static const MENU_LABEL_SEPARATOR:String = "--"; + public function GlobalMenuBar(ap:IActionProvider = null):void { super(); diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuDataDescriptor.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuDataDescriptor.as index 11bed522..7656624f 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuDataDescriptor.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/global_menu/GlobalMenuDataDescriptor.as @@ -133,9 +133,14 @@ package org.flowerplatform.flexutil.global_menu { } /** - * Normal menu (other possible types: separator, check or radio) + * Menu type (possible values: normal, separator, check or radio) */ public function getType(node:Object):String { + if (node is IAction) { + if (IAction(node).label == GlobalMenuBar.MENU_LABEL_SEPARATOR) { + return "separator"; + } + } return "normal"; } From 2d1d8d858f67f7974d2b9b38b99bd27226cb8d86 Mon Sep 17 00:00:00 2001 From: Mircea Negreanu Date: Thu, 24 Jul 2014 12:51:15 +0300 Subject: [PATCH 7/9] Added a separator to the sample menu. --- .../flexutil/samples/global_menu/GlobalMenuSample.mxml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.flowerplatform.flexutil.samples/src/org/flowerplatform/flexutil/samples/global_menu/GlobalMenuSample.mxml b/org.flowerplatform.flexutil.samples/src/org/flowerplatform/flexutil/samples/global_menu/GlobalMenuSample.mxml index 7c682340..81dad0b7 100644 --- a/org.flowerplatform.flexutil.samples/src/org/flowerplatform/flexutil/samples/global_menu/GlobalMenuSample.mxml +++ b/org.flowerplatform.flexutil.samples/src/org/flowerplatform/flexutil/samples/global_menu/GlobalMenuSample.mxml @@ -69,6 +69,12 @@ license-end action.parentId = "secondaction"; action.icon = MultipleIconItemRendererSample.defaultImage; actionProvider.getActions(null).push(action); + + // create a separator. + action = new SampleActionGlobalMenu1(); + action.label = GlobalMenuBar.MENU_LABEL_SEPARATOR; + action.parentId = "secondaction"; + actionProvider.getActions(null).push(action); action = new SampleActionGlobalMenu1(); action.label = "Third SubAction"; From b5e6f62cba85991447aa28813512d7b4c83b8946 Mon Sep 17 00:00:00 2001 From: cristina-constantinescu Date: Wed, 22 Oct 2014 12:12:49 +0300 Subject: [PATCH 8/9] * ViewPopupWindow modified to accept components without initial width/height --- .../.actionScriptProperties | 2 +- .../.actionScriptProperties | 2 +- .../.actionScriptProperties | 2 +- .../.actionScriptProperties | 5 +++-- .../.actionScriptProperties | 5 +++-- .../.actionScriptProperties | 5 +++-- .../crispico/flower/util/layout/Workbench.as | 20 ++++++++++++------- .../util/layout/view/ViewPopupWindow.as | 14 +++++++------ 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/org.flowerplatform.flex_client.core/.actionScriptProperties b/org.flowerplatform.flex_client.core/.actionScriptProperties index 457f4ff5..23039ae0 100644 --- a/org.flowerplatform.flex_client.core/.actionScriptProperties +++ b/org.flowerplatform.flex_client.core/.actionScriptProperties @@ -1,5 +1,5 @@ - + diff --git a/org.flowerplatform.flex_client.properties/.actionScriptProperties b/org.flowerplatform.flex_client.properties/.actionScriptProperties index 9dcde00e..4ae0d400 100644 --- a/org.flowerplatform.flex_client.properties/.actionScriptProperties +++ b/org.flowerplatform.flex_client.properties/.actionScriptProperties @@ -1,5 +1,5 @@ - + diff --git a/org.flowerplatform.flex_client.resources/.actionScriptProperties b/org.flowerplatform.flex_client.resources/.actionScriptProperties index d9e7e4c8..7140a28f 100644 --- a/org.flowerplatform.flex_client.resources/.actionScriptProperties +++ b/org.flowerplatform.flex_client.resources/.actionScriptProperties @@ -1,5 +1,5 @@ - + diff --git a/org.flowerplatform.flexdiagram/.actionScriptProperties b/org.flowerplatform.flexdiagram/.actionScriptProperties index 50d40e42..86d83608 100644 --- a/org.flowerplatform.flexdiagram/.actionScriptProperties +++ b/org.flowerplatform.flexdiagram/.actionScriptProperties @@ -1,6 +1,6 @@ - - + + @@ -21,6 +21,7 @@ + diff --git a/org.flowerplatform.flexutil/.actionScriptProperties b/org.flowerplatform.flexutil/.actionScriptProperties index 684e7b0b..fd6e2747 100644 --- a/org.flowerplatform.flexutil/.actionScriptProperties +++ b/org.flowerplatform.flexutil/.actionScriptProperties @@ -1,6 +1,6 @@ - - + + @@ -22,6 +22,7 @@ + diff --git a/org.flowerplatform.flexutil_legacy/.actionScriptProperties b/org.flowerplatform.flexutil_legacy/.actionScriptProperties index 1fea4c7e..205a982b 100644 --- a/org.flowerplatform.flexutil_legacy/.actionScriptProperties +++ b/org.flowerplatform.flexutil_legacy/.actionScriptProperties @@ -1,6 +1,6 @@ - - + + @@ -21,6 +21,7 @@ + diff --git a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/Workbench.as b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/Workbench.as index 883f2f51..5a002061 100644 --- a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/Workbench.as +++ b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/Workbench.as @@ -38,14 +38,13 @@ package com.crispico.flower.util.layout { import com.crispico.flower.util.layout.view.activeview.ActiveViewList; import flash.display.DisplayObject; + import flash.events.Event; import flash.events.IEventDispatcher; import flash.events.MouseEvent; import flash.geom.Point; import flash.ui.Keyboard; import flash.utils.Dictionary; - import flexlib.containers.SuperTabNavigator; - import mx.collections.ArrayCollection; import mx.containers.BoxDirection; import mx.containers.Canvas; @@ -61,6 +60,10 @@ package com.crispico.flower.util.layout { import mx.core.UIComponent; import mx.core.mx_internal; import mx.events.FlexEvent; + import mx.events.ResizeEvent; + import mx.managers.PopUpManager; + + import flexlib.containers.SuperTabNavigator; import org.flowerplatform.flexutil.FlexUtilGlobals; import org.flowerplatform.flexutil.action.ActionBase; @@ -2250,7 +2253,7 @@ package com.crispico.flower.util.layout { * * @author Cristina */ - public function addViewInPopupWindow(view:Object, x:Number= NaN, y:Number=NaN, width:Number=NaN, height:Number=NaN, isModal:Boolean = false, existingComponent:UIComponent = null, existingViewPopupWindowInstance:ViewPopupWindow = null):ViewPopupWindow { + public function addViewInPopupWindow(view:Object, x:Number= NaN, y:Number=NaN, width:Number=NaN, height:Number=NaN, isModal:Boolean = false, existingComponent:UIComponent = null, existingViewPopupWindowInstance:ViewPopupWindow = null, parent:DisplayObject = null):ViewPopupWindow { // get viewLayoutData var viewLayoutData:ViewLayoutData; if (view is String) { @@ -2279,8 +2282,6 @@ package com.crispico.flower.util.layout { var component:UIComponent = existingComponent != null ? existingComponent : getNewViewComponentInstance(viewLayoutData); component.percentWidth = 100; component.percentHeight = 100; - popup.addChild(component); - if (viewLayoutData.dimensions.length != 0) { if (isNaN(x)) { @@ -2318,7 +2319,12 @@ package com.crispico.flower.util.layout { popup.viewLayoutData = viewLayoutData; popup.component = component; - popup.showPopup(width, height, null, isModal); + if (!component.initialized) { + popup.visible = false; + component.addEventListener(FlexEvent.CREATION_COMPLETE, function(e:Event):void {popup.visible = true; PopUpManager.centerPopUp(popup);}); + } + popup.showPopup(width, height, parent, isModal); + popup.addChild(component); // set coordonates if (!isNaN(x) && !isNaN(y)) { @@ -2333,7 +2339,7 @@ package com.crispico.flower.util.layout { return popup; } - + /** * Searches vertical for the first stack found below the first editor sash. * If not found, creates one. diff --git a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/ViewPopupWindow.as b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/ViewPopupWindow.as index e7db9e9f..0a08459f 100644 --- a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/ViewPopupWindow.as +++ b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/ViewPopupWindow.as @@ -98,14 +98,16 @@ package com.crispico.flower.util.layout.view close(); } - public function close(dispatchLayoutDataChangedEvent:Boolean = true):void { + public function close(dispatchLayoutDataChangedEvent:Boolean = true, shouldDispatchRemoveEvent:Boolean = true):void { closeFormInternal(); - // dispatch remove events - var viewsRemovedEvent:ViewsRemovedEvent = new ViewsRemovedEvent(new ArrayCollection([component])); - workbench.dispatchEvent(viewsRemovedEvent); - - component.dispatchEvent(new ViewRemovedEvent()); + if (shouldDispatchRemoveEvent) { + // dispatch remove events + var viewsRemovedEvent:ViewsRemovedEvent = new ViewsRemovedEvent(new ArrayCollection([component])); + workbench.dispatchEvent(viewsRemovedEvent); + + component.dispatchEvent(new ViewRemovedEvent()); + } if (dispatchLayoutDataChangedEvent) { workbench.dispatchEvent(new LayoutDataChangedEvent()); } From 2aa3bec34d6998ed60e0fad624a203f354b04714 Mon Sep 17 00:00:00 2001 From: cristina-constantinescu Date: Tue, 28 Oct 2014 15:51:41 +0200 Subject: [PATCH 9/9] #10167 - Parfois, l'editeur de vols n'affiche pas le nom de vols dans l'onglet "Editeur de vol" --- .../flower/util/layout/view/activeview/ActiveViewList.as | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/activeview/ActiveViewList.as b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/activeview/ActiveViewList.as index cc31e88c..8867a4fe 100644 --- a/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/activeview/ActiveViewList.as +++ b/org.flowerplatform.flexutil_legacy/src/com/crispico/flower/util/layout/view/activeview/ActiveViewList.as @@ -20,6 +20,7 @@ package com.crispico.flower.util.layout.view.activeview { import com.crispico.flower.util.layout.Workbench; import com.crispico.flower.util.layout.view.LayoutTabNavigator; + import com.crispico.flower.util.layout.view.ViewPopupWindow; import mx.collections.ArrayCollection; import mx.core.INavigatorContent; @@ -80,15 +81,15 @@ package com.crispico.flower.util.layout.view.activeview * Dispatches an event to notify about changes. */ public function setActiveView(newActiveView:UIComponent, setFocusOnNewView:Boolean = true, dispatchActiveViewChangedEvent:Boolean = true, restoreIfMinimized:Boolean = true):void { - if (newActiveView == null) { + if (newActiveView == null || newActiveView.parent is ViewPopupWindow) { return; } if (restoreIfMinimized) { // if minimized, restore it var viewLayoutData:ViewLayoutData = ViewLayoutData(workbench.componentToLayoutData[newActiveView]); - if (StackLayoutData(viewLayoutData.parent).mrmState == StackLayoutData.USER_MINIMIZED || - StackLayoutData(viewLayoutData.parent).mrmState == StackLayoutData.FORCED_MINIMIZED) { + if (viewLayoutData.parent != null && (StackLayoutData(viewLayoutData.parent).mrmState == StackLayoutData.USER_MINIMIZED || + StackLayoutData(viewLayoutData.parent).mrmState == StackLayoutData.FORCED_MINIMIZED)) { workbench.restore(StackLayoutData(viewLayoutData.parent)); } }