Merge remote-tracking branch 'origin/develop' into mw 31/21731/1
authoryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Tue, 27 May 2014 03:01:15 +0000 (12:01 +0900)
committeryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Tue, 27 May 2014 03:01:15 +0000 (12:01 +0900)
* origin/develop: (24 commits)
  UIB : Fix initializing index.html. Remove managed.css when index.html loading time.
  PROP : Advanced border style layout.
  DATABIND : update listdivider widget descriptor a. add text binding for the listdivider widget
  NSCREEN : remove move action 1. nscreen item  : remove move action
  PROP : Advanced size style.
  UIB: apply n-screen to preview
  NSCREEN : Modify list of screen feature. Integrated list of screen feature for profile.
  NSCREEN : remove duplicate data in index.meta.xml. if page had css file for nscreen, write nscreen in index.meta.xml.
  ANIMATOR : Change lock, visible widget flow Event flow is changed for lock and visible widget.
  UIB: fixed classpath error remove absolute path. and transformerfactory bug fixed.
  PROP : Add z-index/visible/overflow style. Advanced style tab layout.
  DATABIND: Modify the icons
  UIB: fixed classpath error remove absolute path.
  ANIMATOR : Bug fix about fireEvent Change fireEvent time when predefined animation is added
  ANIMATOR : Add KeyFrameControl KeyFrameControl is the ability to expand the KeyFrames.
  UIB: fixed the problem META tag is added when we save on source tab. Added xalan library. HtmlWriter use it.
  UIB: undo, redo will be possible about editing between source and design. Modified ReloadCommand. It process about HTML loading.
  NSCREEN : modify initialization part of nscreen model. Modify initialization part of nscreen model.
  CSSSELECTOR : fix SelectorDialog position. 1. Fixed - where the selector dialog opens. 2. fixed a bug that occurs because of the widget id does not exist.
  DATABIND : Modify Set Source Dialog.        add data validation.        modify data add condition.        static source editor 'DEL' key binding.        data tree refresh interval 600ms.
  ...

Change-Id: Icaecff1b01b9541363f4af8497c15f8073e33d3f
Signed-off-by: yonghwan82.jeon <yonghwan82.jeon@samsung.com>
118 files changed:
org.tizen.webuibuilder/.classpath
org.tizen.webuibuilder/META-INF/MANIFEST.MF
org.tizen.webuibuilder/build.properties
org.tizen.webuibuilder/lib/serializer.jar [new file with mode: 0644]
org.tizen.webuibuilder/lib/xalan.jar [new file with mode: 0644]
org.tizen.webuibuilder/plugin.xml
org.tizen.webuibuilder/res/descriptors/Tizen-web-ui-fw/CSSProperties.xml
org.tizen.webuibuilder/res/descriptors/Tizen-web-ui-fw/tizen.types.xml
org.tizen.webuibuilder/res/descriptors/Tizen-web-ui-fw/widget/tizen.listdivider.widget.xml
org.tizen.webuibuilder/res/icons/add_css_selector_hover.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/add_css_selector_nml.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/add_css_selector_pushed.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/binded.gif [deleted file]
org.tizen.webuibuilder/res/icons/binding_hide.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/binding_show.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/databinding.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/datamodel_add.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/datamodel_delete.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/datasource_add.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/datasource_delete.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/datasource_open.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/delete.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/hide_bind.gif [deleted file]
org.tizen.webuibuilder/res/icons/link.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/link_image.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/modelitem_add.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/remove_css_selector_hover.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/remove_css_selector_nml.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/remove_css_selector_pushed.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/rename.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/reset_css_selector_hover.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/reset_css_selector_nml.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/reset_css_selector_pushed.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/second_folding_closed.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/second_folding_opened.png [new file with mode: 0644]
org.tizen.webuibuilder/res/icons/show_bind.gif [deleted file]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/BuilderConstants.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateAndChangeFrameCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationLockCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationMakeInvisibleCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathMoveCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPropertyChangeCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimationPathModel.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorFrame.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorKeyframe.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/TimelineContentContainer.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameEditCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/common/TimelineConstants.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/editpart/TimelineEditPart.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tool/TimelineToolbar.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimeTreeElement.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimelineOutlineElement.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimelineWidgetElement.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/widget/KeyFrame.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/widget/KeyFrameUnit.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ChangeCssSelectorCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/CreateCssSelectorCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ReloadCommand.java [new file with mode: 0644]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/RemoveCssSelectorCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ResetCssSelectorCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/DesignerEditPart.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/editparts/HoverViewerEditPart.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/figure/WidgetFigure.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/Part.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/WidgetValidator.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/app/AppManager.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/app/AppManagerForHTML.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/app/io/HtmlMetaReader_ver_1.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/app/io/HtmlMetaWriter_ver_1.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/descriptors/TypeDescriptor.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/html/io/HtmlWriter.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/NScreenModel.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/NScreenModelManager.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/descriptors/NScreenDescriptor.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/page/PageDataForHTML.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/page/PageDataSet.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/project/ProjectManager.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerForAppXML.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerForHTML.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/texteditor/TextEditor.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/selector/CSSSelectorDialog.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/selector/CssSelecotrAction.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/pagetemplate/action/CssSelecotrAction.java with 84% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/DataBindingPage.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/AddDataSourceAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/AddViewModelAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/AddViewModelItemAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/EditDataSourceAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/RemoveBindingInfoAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/RemoveDataSourceAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/RemoveViewModelAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/RenameDataSourceAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/actions/RenameViewModelAction.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/StaticSubPage.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenItem.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/FoldingComposite.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/PropertiesConstant.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/PropertiesTabItem.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/action/ActionTab.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/attributes/AttributesTab.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/BorderMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/ComboMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/GroupMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/IntegerMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/IntegerStyleMethod.java [new file with mode: 0644]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/MethodCreationFactory.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/MethodUtil.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/SizeMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/SizeRealMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/TextStyleMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/TransformMethod.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/style/CssSelectorCategoryComposite.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/style/CssStyleEventDelegater.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/style/CssStyleTab.java
package/changelog
package/pkginfo.manifest

index b353d12..8bca225 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry exported="true" kind="lib" path="lib/js-14.jar" sourcepath="D:/__WORK/chagall/tizenpublic/develop/rhino/src"/>
+       <classpathentry exported="true" kind="lib" path="lib/js-14.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/nekohtml-1.9.18.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/json-simple-1.1.1.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
index 3c7bfd1..97a3620 100644 (file)
@@ -56,4 +56,6 @@ Bundle-ClassPath: .,
  lib/phloc-commons-4.0.8.jar,
  lib/nekohtml-1.9.18.jar,
  lib/json-simple-1.1.1.jar,
- lib/js-14.jar
+ lib/js-14.jar,
+ lib/xalan.jar,
+ lib/serializer.jar
index ae5a972..4ac4d94 100644 (file)
@@ -8,5 +8,7 @@ bin.includes = .,\
                about.properties,\
                plugin.properties,\
                plugin.xml,\
-               lib/
+               lib/,\
+               lib/xalan.jar,\
+               lib/serializer.jar
 bin.excludes = res/descriptors/
diff --git a/org.tizen.webuibuilder/lib/serializer.jar b/org.tizen.webuibuilder/lib/serializer.jar
new file mode 100644 (file)
index 0000000..99f98db
Binary files /dev/null and b/org.tizen.webuibuilder/lib/serializer.jar differ
diff --git a/org.tizen.webuibuilder/lib/xalan.jar b/org.tizen.webuibuilder/lib/xalan.jar
new file mode 100644 (file)
index 0000000..458fa73
Binary files /dev/null and b/org.tizen.webuibuilder/lib/xalan.jar differ
index 339431d..238e0e7 100644 (file)
       <view
             category="org.tizen.nativeapp.viewCategory"
             class="org.tizen.webuibuilder.ui.views.databinding.DataBindingView"
+            icon="res/icons/databinding.png"
             id="org.tizen.webuibuilder.ui.views.databinding"
             name="DataBinding"
             restorable="true">
index 72fa360..4f6c760 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- 
 <!DOCTYPE css [
-       <!ENTITY tizen.css.types SYSTEM "tizen.css.types.xml">
+    <!ENTITY tizen.css.types SYSTEM "tizen.css.types.xml">
 ]>
  -->
 <style>
-       <category name="layout" displayName="Layout" brief="%position%">
-               <property name="position" type="position@position" displayName="Position" deafult=""></property>
-               <property name="display" type="display@display" displayName="Display" deafult="inline"></property>
-       </category>
+    <category name="layout" displayName="Layout" brief="%position%">
+        <property name="position" type="position@position" displayName="Position" default="" inline="true"></property>
+        <property name="display" type="display@display" displayName="Display" default="" inline="true"></property>
+        <property name="overflow" type="overflow@overflow" displayName="Overflow" default="" inline="true"></property>
+        <property name="visibility" type="visibility@visibility" displayName="Visibility" default="" inline="true"></property>
+        <property name="z-index" type="integer@style" displayName="Z-Index" default="auto" inline="true"></property>
+    </category>
     <category name="dimension" displayName="Dimension" brief="%left%,%top%,%width%,%height%">
-       <property name="left" type="size" displayName="Left" default="auto" inline="true"></property>
+        <property name="left" type="size" displayName="Left" default="auto" inline="true"></property>
         <property name="top" type="size" displayName="Top" default="auto" inline="true"></property>
         <property name="width" type="size" displayName="Width" inline="true" default="auto"></property>
-           <property name="height" type="size" displayName="Height" inline="true" default="auto"></property>
+        <property name="height" type="size" displayName="Height" inline="true" default="auto"></property>
     </category>
 
     <category name="text" displayName="Text" brief="">
-       <property name="text-style" type="group-text" displayName="">
-                   <property name="font-family" type="font@family" displayName=""></property>
-               <property name="font-size" type="size" displayName=""></property>
-               <property name="" type="group-icon" displayName="">
-                       <property name="font-weight" type="icon@font-weight"></property>
-                       <property name="font-style" type="icon@font-style"></property>
-                       <property name="text-decoration" type="icon@text-decoration"></property>
+        <property name="text-style" type="group-text" displayName="">
+            <property name="font-family" type="font@family" displayName=""></property>
+            <property name="font-size" type="size" displayName=""></property>
+            <property name="" type="group-icon" displayName="">
+                <property name="font-weight" type="icon@font-weight"></property>
+                <property name="font-style" type="icon@font-style"></property>
+                <property name="text-decoration" type="icon@text-decoration"></property>
 
-               </property>
-               <property name="text-transform" type="icon@text-transform" displayName=""></property>
-               <property name="color" type="color-fill" displayName=""></property>
-               <property name="text-align" type="icon@text-align" displayName=""></property>
-               <property name="vertical-align" type="icon@vertical-align" displayName=""></property>
-               <property name="letter-spacing" type="text@letter-spacing" displayName="Space"></property>
-               <property name="line-height" type="text@line-height" displayName="Height"></property>
-               <property name="-webkit-text-stroke-color" type="color" displayName="Stroke" inline="true"></property>
-               <property name="-webkit-text-stroke-width" type="size" displayName="Width" inline="true" default="0px"></property>
-               <property name="text-shadow" type="group" displayName="Shadow">
-                       <property name="text-shadow.color" type="color" displayName="" default="#000000"></property>
-                       <property name="empty" type="empty" inline="true"></property>
-                       <property name="text-shadow.x" type="size" displayName="X" default="0px"></property>
-                       <property name="text-shadow.y" type="size" displayName="Y" default="0px"></property>
-                       <property name="text-shadow.blur" type="size" displayName="Blur" default="0px"></property>
-               </property>
-       </property>
+            </property>
+            <property name="text-transform" type="icon@text-transform" displayName=""></property>
+            <property name="color" type="color-fill" displayName=""></property>
+            <property name="text-align" type="icon@text-align" displayName=""></property>
+            <property name="vertical-align" type="icon@vertical-align" displayName=""></property>
+            <property name="letter-spacing" type="text@letter-spacing" displayName="Space"></property>
+            <property name="line-height" type="text@line-height" displayName="Height"></property>
+            <property name="-webkit-text-stroke-color" type="color" displayName="Stroke" inline="true"></property>
+            <property name="-webkit-text-stroke-width" type="size" displayName="Width" inline="true" default="0px"></property>
+            <property name="text-shadow" type="group" displayName="Shadow">
+                <property name="text-shadow.color" type="color" displayName="" default="#000000"></property>
+                <property name="empty" type="empty" inline="true"></property>
+                <property name="text-shadow.x" type="size" displayName="X" default="0px"></property>
+                <property name="text-shadow.y" type="size" displayName="Y" default="0px"></property>
+                <property name="text-shadow.blur" type="size" displayName="Blur" default="0px"></property>
+            </property>
+        </property>
     </category>
     
     <category name="transform" displayName="Transform" brief="">
-       <property name="-webkit-transform" type="group-transform" displayName="">
-               <property name="translate" type="group-value" displayName="Translate">
-                       <property name="translate.x" type="size" displayName="X" default="0px"></property>
-                       <property name="translate.y" type="size" displayName="Y" default="0px"></property>
-               </property>
-               
-               <property name="rotate" type="group-value" displayName="Rotate">
-                       <property name="rotate.z" type="size@deg" displayName="Z" default="0deg"></property>
-               </property>
+        <property name="-webkit-transform" type="group-transform" displayName="">
+            <property name="translate" type="group-value" displayName="Translate">
+                <property name="translate.x" type="size" displayName="X" default="0px"></property>
+                <property name="translate.y" type="size" displayName="Y" default="0px"></property>
+            </property>
+            
+            <property name="rotate" type="group-value" displayName="Rotate">
+                <property name="rotate.z" type="size@deg" displayName="Z" default="0deg"></property>
+            </property>
 
-               <property name="scale" type="group-value" displayName="Scale">
-                       <property name="scale.x" type="size@real" displayName="X" default="1"></property>
-                       <property name="scale.y" type="size@real" displayName="Y" default="1"></property>
-               </property>
-               <property name="skew" type="group-value" displayName="Skew">
-                       <property name="skew.x" type="size@deg" displayName="X" default="0deg"></property>
-                               <property name="skew.y" type="size@deg" displayName="Y" default="0deg"></property>
-                       </property>
-           </property> 
-           <property name="-webkit-transform-origin" type="group" displayName="Origin">
-               <property name="-webkit-transform-origin.x" type="size" displayName="X" default="50"></property>
-               <property name="-webkit-transform-origin.y" type="size" displayName="Y" default="50"></property>
-           </property>         
+            <property name="scale" type="group-value" displayName="Scale">
+                <property name="scale.x" type="size@real" displayName="X" default="1"></property>
+                <property name="scale.y" type="size@real" displayName="Y" default="1"></property>
+            </property>
+            <property name="skew" type="group-value" displayName="Skew">
+                <property name="skew.x" type="size@deg" displayName="X" default="0deg"></property>
+                <property name="skew.y" type="size@deg" displayName="Y" default="0deg"></property>
+            </property>
+        </property> 
+        <property name="-webkit-transform-origin" type="group" displayName="Origin">
+            <property name="-webkit-transform-origin.x" type="size" displayName="X" default="50"></property>
+            <property name="-webkit-transform-origin.y" type="size" displayName="Y" default="50"></property>
+        </property>     
     </category>
     
     <category name="background" displayName="Background" brief="%background-color%">
-       <property name="background-color" type="color-fill" displayName="Color"></property>
-       <property name="opacity" type="scale@per" displayName="Opacity" default="100">
-               <condition name="integer-min" value="0" error="integer-min"/>
-               <condition name="integer-max" value="100" error="integer-max"/>         
-       </property>
-       <property type="separator"></property>
-       <property name="background-image" type="image" displayName="Image"></property>
-       <property name="background-repeat" type="background@repeat" displayName="Repeat" deafult="repeat"></property>
-       <property name="background-size" type="group" displayName="Size">
-               <property name="background-size.x" type="size" displayName="X" default="auto"></property>
-               <property name="background-size.y" type="size" displayName="Y" default="auto"></property>
-       </property>
-       <property name="background-position" type="group" displayName="Position">
-               <property name="background-position.x" type="size" displayName="X" default="0"></property>
-               <property name="background-position.y" type="size" displayName="Y" default="0"></property>
-       </property>
+        <property name="background-color" type="color-fill" displayName="Color"></property>
+        <property name="opacity" type="scale@per" displayName="Opacity" default="100">
+            <condition name="integer-min" value="0" error="integer-min"/>
+            <condition name="integer-max" value="100" error="integer-max"/>     
+        </property>
+        <property type="separator"></property>
+        <property name="background-image" type="image" displayName="Image"></property>
+        <property name="background-repeat" type="background@repeat" displayName="Repeat" default="repeat"></property>
+        <property name="background-size" type="group" displayName="Size">
+            <property name="background-size.x" type="size" displayName="X" default="auto"></property>
+            <property name="background-size.y" type="size" displayName="Y" default="auto"></property>
+        </property>
+        <property name="background-position" type="group" displayName="Position">
+            <property name="background-position.x" type="size" displayName="X" default="0"></property>
+            <property name="background-position.y" type="size" displayName="Y" default="0"></property>
+        </property>
     </category>
     <category name="border" displayName="Border" brief="%border%" folding="border-top, border-bottom, border-left, border-right">
-       <property name="border" type="group-border" displayName="All">
-               <property name="border.color" type="color" default="#000000"></property>
-               <property name="border.width" type="size" default="0px"></property>
-               <property name="border.style" type="border@style" default=""></property>
-       </property>
-       <property name="border-top" type="group-border" displayName="Top">
-               <property name="border-top.color" type="color" default="#000000"></property>
-               <property name="border-top.width" type="size" default="0px"></property>
-               <property name="border-top.style" type="border@style" default=""></property>
-       </property>
-       <property name="border-bottom" type="group-border" displayName="Bottom">
-               <property name="border-bottom.color" type="color" default="#000000"></property>
-               <property name="border-bottom.width" type="size" default="0px"></property>
-               <property name="border-bottom.style" type="border@style" default=""></property>
-       </property>
-       <property name="border-left" type="group-border" displayName="Left">
-               <property name="border-left.color" type="color" default="#000000"></property>
-               <property name="border-left.width" type="size" default="0px"></property>
-               <property name="border-left.style" type="border@style" default=""></property>
-       </property>
-       <property name="border-right" type="group-border" displayName="Right">
-               <property name="border-right.color" type="color" default="#000000"></property>
-               <property name="border-right.width" type="size" default="0px"></property>
-               <property name="border-right.style" type="border@style" default=""></property>
-       </property>
-       
+        <property name="border" type="group-border" displayName="All">
+            <property name="border.color" type="color" default="#000000"></property>
+            <property name="border.width" type="size" default="0px"></property>
+            <property name="border.style" type="border@style" default=""></property>
+        </property>
+        <property name="border-top" type="group-border" displayName="Top">
+            <property name="border-top.color" type="color" default="#000000"></property>
+            <property name="border-top.width" type="size" default="0px"></property>
+            <property name="border-top.style" type="border@style" default=""></property>
+        </property>
+        <property name="border-bottom" type="group-border" displayName="Bottom">
+            <property name="border-bottom.color" type="color" default="#000000"></property>
+            <property name="border-bottom.width" type="size" default="0px"></property>
+            <property name="border-bottom.style" type="border@style" default=""></property>
+        </property>
+        <property name="border-left" type="group-border" displayName="Left">
+            <property name="border-left.color" type="color" default="#000000"></property>
+            <property name="border-left.width" type="size" default="0px"></property>
+            <property name="border-left.style" type="border@style" default=""></property>
+        </property>
+        <property name="border-right" type="group-border" displayName="Right">
+            <property name="border-right.color" type="color" default="#000000"></property>
+            <property name="border-right.width" type="size" default="0px"></property>
+            <property name="border-right.style" type="border@style" default=""></property>
+        </property>
+        
     </category>
 <!--  
     <category name="text" displayName="Text" brief="">
-       <property name="color" type="color-fill" displayName="Color"></property>
-       <property name ="separator" type="separator"></property>
-       <property name="-webkit-text-stroke-color" type="color" displayName="Stroke" inline="true"></property>
-       <property name="-webkit-text-stroke-width" type="size" displayName="Width" inline="true"></property>
-       <property name="text-shadow" type="group" displayName="Shadow">
-               <property name="text-shadow.color" type="color" displayName=""></property>
-               <property name="empty" type="empty" inline="true"></property>
-               <property name="text-shadow.x" type="size" displayName="X" default="0"></property>
-               <property name="text-shadow.y" type="size" displayName="Y" default="0"></property>
-               <property name="text-shadow.blur" type="size" displayName="Blur" default="0"></property>
-       </property>
-       <property name="separator" type="separator"></property>
-       <property name="font-family" type="font@family" displayName="Font" inline="true"></property>
-       <property name="font-size" type="size" displayName="Size" inline="true"></property>
-       <property name="line-height" type="size" displayName="Height"></property>
-       <property name="letter-spacing" type="size" displayName="Space"></property>
-       <property name="separator" type="separator"></property>
-       <property name="text-align" type="icon@text-align" displayName="H align"></property>
-       <property name="" type="group-icon" displayName="Decoration">
-               <property name="font-weight" type="icon@font-weight"></property>
-               <property name="font-style" type="icon@font-style"></property>
-               <property name="text-decoration" type="icon@text-decoration"></property>
-       </property>
-       <property name="text-transform" type="icon@text-transform" displayName="Transform"></property>
+        <property name="color" type="color-fill" displayName="Color"></property>
+        <property name ="separator" type="separator"></property>
+        <property name="-webkit-text-stroke-color" type="color" displayName="Stroke" inline="true"></property>
+        <property name="-webkit-text-stroke-width" type="size" displayName="Width" inline="true"></property>
+        <property name="text-shadow" type="group" displayName="Shadow">
+            <property name="text-shadow.color" type="color" displayName=""></property>
+            <property name="empty" type="empty" inline="true"></property>
+            <property name="text-shadow.x" type="size" displayName="X" default="0"></property>
+            <property name="text-shadow.y" type="size" displayName="Y" default="0"></property>
+            <property name="text-shadow.blur" type="size" displayName="Blur" default="0"></property>
+        </property>
+        <property name="separator" type="separator"></property>
+        <property name="font-family" type="font@family" displayName="Font" inline="true"></property>
+        <property name="font-size" type="size" displayName="Size" inline="true"></property>
+        <property name="line-height" type="size" displayName="Height"></property>
+        <property name="letter-spacing" type="size" displayName="Space"></property>
+        <property name="separator" type="separator"></property>
+        <property name="text-align" type="icon@text-align" displayName="H align"></property>
+        <property name="" type="group-icon" displayName="Decoration">
+            <property name="font-weight" type="icon@font-weight"></property>
+            <property name="font-style" type="icon@font-style"></property>
+            <property name="text-decoration" type="icon@text-decoration"></property>
+        </property>
+        <property name="text-transform" type="icon@text-transform" displayName="Transform"></property>
     </category>
 -->
 
     <category name="shadow" displayName="Shadow" brief="">
-       <property name="box-shadow" type="group" displayName="">
-               <property name="box-shadow.color" type="color" displayName="Color" default="#000000"></property>
-               <property name="empty" type="empty" inline="true"></property>
-               <property name="box-shadow.horizontal" type="size" displayName="Horz" default="0px"></property>
-               <property name="box-shadow.vertical" type="size" displayName="Vert" default="0px"></property>
-               <property name="box-shadow.blur" type="size" displayName="Blur" default="0px"></property>
-               <property name="box-shadow.spread" type="size" displayName="Spread" default="0px"></property>
-       </property>
+        <property name="box-shadow" type="group" displayName="">
+            <property name="box-shadow.color" type="color" displayName="Color" default="#000000"></property>
+            <property name="empty" type="empty" inline="true"></property>
+            <property name="box-shadow.horizontal" type="size" displayName="Horz" default="0px"></property>
+            <property name="box-shadow.vertical" type="size" displayName="Vert" default="0px"></property>
+            <property name="box-shadow.blur" type="size" displayName="Blur" default="0px"></property>
+            <property name="box-shadow.spread" type="size" displayName="Spread" default="0px"></property>
+        </property>
     </category>
     <category name="metrics" displayName="Metrics" brief="">
-       <property name="metrics" type="metrics"  displayName="" default=""></property>
+        <property name="metrics" type="metrics"  displayName="" default=""></property>
     </category>
 <!--  
     <category name="filter" displayName="Filters" brief="">
-       <property name="-webkit-filter" type="group-filter" displayName="">
-               <property name="blur" type="group-value" displayName="Blur">
-                       <property name="blur" type="scale@px" displayName="" default="0px"> 
-                               <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="10" error="integer-max"/>
-                       </property>             
-               </property>
-               <property name="contrast" type="group-value" displayName="Contrast">
-                       <property name="contrast" type="scale@per" displayName="" default="100%">
-                           <condition name="integer-min" value="0" error="integer-min"/>
-                           <condition name="integer-max" value="100" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="grayscale" type="group-value" displayName="Grayscale">
-                       <property name="grayscale" type="scale@per" displayName="" default="0%">
-                           <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="100" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="hue-rotate" type="group-value" displayName="Hue-Rotate">
-                       <property name="hue-rotate" type="scale@deg" displayName="" default="0deg">
-                           <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="360" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="invert" type="group-value" displayName="Invert">
-                       <property name="invert" type="scale@per" displayName="" default="0%">
-                           <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="100" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="saturate" type="group-value" displayName="Saturate">
-                       <property name="saturate" type="scale@per" displayName="" default="100%">
-                               <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="100" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="sepia" type="group-value" displayName="Sepia">
-                       <property name="sepia" type="scale@per" displayName="" default="0%">
-                               <condition name="integer-min" value="0" error="integer-min"/>
-                               <condition name="integer-max" value="100" error="integer-max"/>
-                       </property>
-               </property>
-               <property name="drop-shadow" type="group-value" displayName="Shadow">
-                       <property name="drop-shadow.color" type="color" displayName=""></property>
-                       <property name="drop-shadow.blur" type="size" displayName="Blur" default="0px"></property>
-                       <property name="drop-shadow.x" type="size" displayName="X" default="0px"></property>
-                       <property name="drop-shadow.y" type="size" displayName="Y" default="0px"></property>
-               </property>
-       </property>
+        <property name="-webkit-filter" type="group-filter" displayName="">
+            <property name="blur" type="group-value" displayName="Blur">
+                <property name="blur" type="scale@px" displayName="" default="0px"> 
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="10" error="integer-max"/>
+                </property>         
+            </property>
+            <property name="contrast" type="group-value" displayName="Contrast">
+                <property name="contrast" type="scale@per" displayName="" default="100%">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="100" error="integer-max"/>
+                </property>
+            </property>
+            <property name="grayscale" type="group-value" displayName="Grayscale">
+                <property name="grayscale" type="scale@per" displayName="" default="0%">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="100" error="integer-max"/>
+                </property>
+            </property>
+            <property name="hue-rotate" type="group-value" displayName="Hue-Rotate">
+                <property name="hue-rotate" type="scale@deg" displayName="" default="0deg">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="360" error="integer-max"/>
+                </property>
+            </property>
+            <property name="invert" type="group-value" displayName="Invert">
+                <property name="invert" type="scale@per" displayName="" default="0%">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="100" error="integer-max"/>
+                </property>
+            </property>
+            <property name="saturate" type="group-value" displayName="Saturate">
+                <property name="saturate" type="scale@per" displayName="" default="100%">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="100" error="integer-max"/>
+                </property>
+            </property>
+            <property name="sepia" type="group-value" displayName="Sepia">
+                <property name="sepia" type="scale@per" displayName="" default="0%">
+                    <condition name="integer-min" value="0" error="integer-min"/>
+                    <condition name="integer-max" value="100" error="integer-max"/>
+                </property>
+            </property>
+            <property name="drop-shadow" type="group-value" displayName="Shadow">
+                <property name="drop-shadow.color" type="color" displayName=""></property>
+                <property name="drop-shadow.blur" type="size" displayName="Blur" default="0px"></property>
+                <property name="drop-shadow.x" type="size" displayName="X" default="0px"></property>
+                <property name="drop-shadow.y" type="size" displayName="Y" default="0px"></property>
+            </property>
+        </property>
     </category>
 -->
     <category name="clip" displayName="Clip" brief="">
-       <property name="clip" type="clip"        displayName="" default=""></property>
+        <property name="clip" type="clip"    displayName="" default=""></property>
     </category>
     <category name="custom" displayName="Custom CSS" brief="">
-       <property name="custom-css" type="custom-css"/>
+        <property name="custom-css" type="custom-css"/>
     </category>
 <!-- 
     <category name="Background">
-           <property name="background" type="string" displayName="Background"></property>
-           <property name="background-attachment" type="string" displayName="Attachment"></property>
-           <property name="background-color" type="string" displayName="Color" default="#F8F6EF"></property>
-           <property name="background-image" type="image" displayName="Image"></property>
-           <property name="background-position" type="background@position" displayName="Position"></property>
-           <property name="background-repeat" type="background@repeat" displayName="Repeat" default=""></property>
-           <property name="background-clip" type="string" displayName="Clip"></property>
-           <property name="background-origin" type="string" displayName="Origin"></property>
-           <property name="background-size" type="string" displayName="Size"></property>
+        <property name="background" type="string" displayName="Background"></property>
+        <property name="background-attachment" type="string" displayName="Attachment"></property>
+        <property name="background-color" type="string" displayName="Color" default="#F8F6EF"></property>
+        <property name="background-image" type="image" displayName="Image"></property>
+        <property name="background-position" type="background@position" displayName="Position"></property>
+        <property name="background-repeat" type="background@repeat" displayName="Repeat" default=""></property>
+        <property name="background-clip" type="string" displayName="Clip"></property>
+        <property name="background-origin" type="string" displayName="Origin"></property>
+        <property name="background-size" type="string" displayName="Size"></property>
     </category>
     <category name="Border">
         <property name="border" type="string" displayName="Border"></property>
         <property name="border-top-style" type="string" displayName="Border Top Style"></property>
         <property name="border-top-width" type="string" displayName="Border Top Width"></property>
         <property name="border-width" type="style@size" displayName="Width">
-               <condition name="integer-max" value="999" error="integer-max"/>
+            <condition name="integer-max" value="999" error="integer-max"/>
         </property>
         <property name="border-bottom-left-radius" type="string" displayName="Border Bottom Left Radius"></property>
         <property name="border-bottom-right-radius" type="string" displayName="Border Bottom Right Radius"></property>
         <property name="overflow-style" type="string" displayName="Overflow Style"></property>
     </category>
     <category name="Color">
-       <property name="color" type="string" displayName="Color" default="#000000"></property>
+        <property name="color" type="string" displayName="Color" default="#000000"></property>
         <property name="opacity" type="string" displayName="Opacity"></property>
     </category>
     <category name="Dimension">
 -->
     <!-- type & event type -->
     <!-- 
-       &tizen.css.types;
-        -->
+    &tizen.css.types;
+     -->
 </style>
index 953d976..f8f4ef3 100644 (file)
           <constant value="" displayName="(None)"/>
           <constant value="none" displayName="none"/>
           <constant value="inline" displayName="inline"/>
-       <constant value="initial" displayName="initial"/>
-       <constant value="inherit" displayName="inherit"/>
           <constant value="block" displayName="block"/>
           <constant value="flex" displayName="flex"/>
           <constant value="inline-block" displayName="inline-block"/>
           <constant value="table-cell" displayName="table-cell"/>
           <constant value="table-column" displayName="table-column"/>
           <constant value="table-row" displayName="table-row"/>
+          <constant value="initial" displayName="initial"/>
+       <constant value="inherit" displayName="inherit"/>
+       </type>
+       <type id="overflow@overflow">
+          <constant value="" displayName="(None)"/>
+          <constant value="visible" displayName="visible"/>
+          <constant value="hidden" displayName="hidden"/>
+          <constant value="scroll" displayName="scroll"/>
+          <constant value="auto" displayName="auto"/>
+          <constant value="initial" displayName="initial"/>
+          <constant value="inherit" displayName="inherit"/>
+       </type>
+       <type id="visibility@visibility">
+          <constant value="" displayName="(None)"/>
+          <constant value="visible" displayName="visible"/>
+          <constant value="hidden" displayName="hidden"/>
+          <constant value="collapse" displayName="collapse"/>
+          <constant value="initial" displayName="initial"/>
+          <constant value="inherit" displayName="inherit"/>
        </type>
 
        <type id="background@repeat">
                <constant value="text" displayName=""/>
                <constant value="attr" displayName="href"/>
        </type>
+       
+       <type id="integer@style">
+          <constant value="auto" displayName="auto"/>
+          <constant value="initial" displayName="initial"/>
+          <constant value="inherit" displayName="inherit"/>
+       </type>
 </types>
\ No newline at end of file
index eab1931..d673f58 100644 (file)
@@ -28,6 +28,8 @@
        <property name="data-style" type="tizen.listdivider@style" displayName="Style" default="normal"
                tooltip="Sets the style of the list divider"/>
 
+       <property name="data-bind" type="text@databinding" displayName="Data Binding" default="" initValue=""/>
+
        <event name="ontap" displayName="Tap" eventType="event.defaultevent" />
        <event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
        <event name="onswipe" displayName="Swipe" eventType="event.defaultevent" />
diff --git a/org.tizen.webuibuilder/res/icons/add_css_selector_hover.png b/org.tizen.webuibuilder/res/icons/add_css_selector_hover.png
new file mode 100644 (file)
index 0000000..08ae714
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/add_css_selector_hover.png differ
diff --git a/org.tizen.webuibuilder/res/icons/add_css_selector_nml.png b/org.tizen.webuibuilder/res/icons/add_css_selector_nml.png
new file mode 100644 (file)
index 0000000..041d423
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/add_css_selector_nml.png differ
diff --git a/org.tizen.webuibuilder/res/icons/add_css_selector_pushed.png b/org.tizen.webuibuilder/res/icons/add_css_selector_pushed.png
new file mode 100644 (file)
index 0000000..4dc00c6
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/add_css_selector_pushed.png differ
diff --git a/org.tizen.webuibuilder/res/icons/binded.gif b/org.tizen.webuibuilder/res/icons/binded.gif
deleted file mode 100644 (file)
index 5fd9c94..0000000
Binary files a/org.tizen.webuibuilder/res/icons/binded.gif and /dev/null differ
diff --git a/org.tizen.webuibuilder/res/icons/binding_hide.png b/org.tizen.webuibuilder/res/icons/binding_hide.png
new file mode 100644 (file)
index 0000000..aea393e
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/binding_hide.png differ
diff --git a/org.tizen.webuibuilder/res/icons/binding_show.png b/org.tizen.webuibuilder/res/icons/binding_show.png
new file mode 100644 (file)
index 0000000..21758ea
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/binding_show.png differ
diff --git a/org.tizen.webuibuilder/res/icons/databinding.png b/org.tizen.webuibuilder/res/icons/databinding.png
new file mode 100644 (file)
index 0000000..acf630a
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/databinding.png differ
diff --git a/org.tizen.webuibuilder/res/icons/datamodel_add.png b/org.tizen.webuibuilder/res/icons/datamodel_add.png
new file mode 100644 (file)
index 0000000..527a8ec
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/datamodel_add.png differ
diff --git a/org.tizen.webuibuilder/res/icons/datamodel_delete.png b/org.tizen.webuibuilder/res/icons/datamodel_delete.png
new file mode 100644 (file)
index 0000000..2baf85a
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/datamodel_delete.png differ
diff --git a/org.tizen.webuibuilder/res/icons/datasource_add.png b/org.tizen.webuibuilder/res/icons/datasource_add.png
new file mode 100644 (file)
index 0000000..c620c52
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/datasource_add.png differ
diff --git a/org.tizen.webuibuilder/res/icons/datasource_delete.png b/org.tizen.webuibuilder/res/icons/datasource_delete.png
new file mode 100644 (file)
index 0000000..40609d2
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/datasource_delete.png differ
diff --git a/org.tizen.webuibuilder/res/icons/datasource_open.png b/org.tizen.webuibuilder/res/icons/datasource_open.png
new file mode 100644 (file)
index 0000000..4b29dcf
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/datasource_open.png differ
diff --git a/org.tizen.webuibuilder/res/icons/delete.png b/org.tizen.webuibuilder/res/icons/delete.png
new file mode 100644 (file)
index 0000000..ab0aaad
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/delete.png differ
diff --git a/org.tizen.webuibuilder/res/icons/hide_bind.gif b/org.tizen.webuibuilder/res/icons/hide_bind.gif
deleted file mode 100644 (file)
index c610608..0000000
Binary files a/org.tizen.webuibuilder/res/icons/hide_bind.gif and /dev/null differ
diff --git a/org.tizen.webuibuilder/res/icons/link.png b/org.tizen.webuibuilder/res/icons/link.png
new file mode 100644 (file)
index 0000000..346329e
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/link.png differ
diff --git a/org.tizen.webuibuilder/res/icons/link_image.png b/org.tizen.webuibuilder/res/icons/link_image.png
new file mode 100644 (file)
index 0000000..6aade9c
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/link_image.png differ
diff --git a/org.tizen.webuibuilder/res/icons/modelitem_add.png b/org.tizen.webuibuilder/res/icons/modelitem_add.png
new file mode 100644 (file)
index 0000000..ca1eafb
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/modelitem_add.png differ
diff --git a/org.tizen.webuibuilder/res/icons/remove_css_selector_hover.png b/org.tizen.webuibuilder/res/icons/remove_css_selector_hover.png
new file mode 100644 (file)
index 0000000..3714983
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/remove_css_selector_hover.png differ
diff --git a/org.tizen.webuibuilder/res/icons/remove_css_selector_nml.png b/org.tizen.webuibuilder/res/icons/remove_css_selector_nml.png
new file mode 100644 (file)
index 0000000..3ee6fc0
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/remove_css_selector_nml.png differ
diff --git a/org.tizen.webuibuilder/res/icons/remove_css_selector_pushed.png b/org.tizen.webuibuilder/res/icons/remove_css_selector_pushed.png
new file mode 100644 (file)
index 0000000..4bfb397
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/remove_css_selector_pushed.png differ
diff --git a/org.tizen.webuibuilder/res/icons/rename.png b/org.tizen.webuibuilder/res/icons/rename.png
new file mode 100644 (file)
index 0000000..2179cbb
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/rename.png differ
diff --git a/org.tizen.webuibuilder/res/icons/reset_css_selector_hover.png b/org.tizen.webuibuilder/res/icons/reset_css_selector_hover.png
new file mode 100644 (file)
index 0000000..58637f0
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/reset_css_selector_hover.png differ
diff --git a/org.tizen.webuibuilder/res/icons/reset_css_selector_nml.png b/org.tizen.webuibuilder/res/icons/reset_css_selector_nml.png
new file mode 100644 (file)
index 0000000..614e558
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/reset_css_selector_nml.png differ
diff --git a/org.tizen.webuibuilder/res/icons/reset_css_selector_pushed.png b/org.tizen.webuibuilder/res/icons/reset_css_selector_pushed.png
new file mode 100644 (file)
index 0000000..28842e5
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/reset_css_selector_pushed.png differ
diff --git a/org.tizen.webuibuilder/res/icons/second_folding_closed.png b/org.tizen.webuibuilder/res/icons/second_folding_closed.png
new file mode 100644 (file)
index 0000000..0604b56
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/second_folding_closed.png differ
diff --git a/org.tizen.webuibuilder/res/icons/second_folding_opened.png b/org.tizen.webuibuilder/res/icons/second_folding_opened.png
new file mode 100644 (file)
index 0000000..b219582
Binary files /dev/null and b/org.tizen.webuibuilder/res/icons/second_folding_opened.png differ
diff --git a/org.tizen.webuibuilder/res/icons/show_bind.gif b/org.tizen.webuibuilder/res/icons/show_bind.gif
deleted file mode 100644 (file)
index d8d7fad..0000000
Binary files a/org.tizen.webuibuilder/res/icons/show_bind.gif and /dev/null differ
index b6d6e33..05d233a 100644 (file)
@@ -249,6 +249,7 @@ public class BuilderConstants {
        public static final String REGULAREXPRESSION = "^[a-zA-Z]+[a-zA-Z0-9_]*$"; //$NON-NLS-1$
        public static final String ID_PATTERN = "^[a-zA-Z]+[a-zA-Z0-9]*$"; //$NON-NLS-1$
        public static final String INTEGERVALUE = "^[0-9-]?+[0-9]*$"; //$NON-NLS-1$
+       public static final String FLOATVALUE = "^[0-9-]?+[.?0-9]*$"; //$NON-NLS-1$
        public static final String SIZEVALUE = "^[0-9-]+[0-9]*(?:px|%|cm|em)$"; //$NON-NLS-1$
        public static final String SIZEPATTERN = "(^[0-9]?+[0-9]*)?(px|%|cm|em)?$"; //$NON-NLS-1$
        public static final String UNITPATTERN = "(px|%|cm|em)?$"; //$NON-NLS-1$
@@ -260,8 +261,19 @@ public class BuilderConstants {
        public static final String DATABINDING_TYPE_STATIC = "Static"; //$NON-NLS-1$
        public static final String DATABINDING_TYPE_REMOTECALL = "Remote Call"; //$NON-NLS-1$
        public static final String DATABINDING_ARRAY_ICON = "temp.png"; //$NON-NLS-1$
-       public static final String DATABINDING_BINDING_ICON = "binded.gif"; //$NON-NLS-1$
+       public static final String DATABINDING_BINDING_ICON = "link.png"; //$NON-NLS-1$
+       public static final String DATABINDING_BINDING_IMAGE = "link_image.png"; //$NON-NLS-1$
+       public static final String DATABINDING_HIDE_ICON = "binding_hide.png"; //$NON-NLS-1$
+       public static final String DATABINDING_SHOW_ICON = "binding_show.png"; //$NON-NLS-1$
+       public static final String DATABINDING_RENAME_ICON = "rename.png"; //$NON-NLS-1$
        public static final String DATABINDING_STRING_ICON = "empty.png"; //$NON-NLS-1$
+       public static final String DATABINDING_DATASOURCE_DIALOG_ICON = "datasource_open.png"; //$NON-NLS-1$
+       public static final String DATABINDING_DATASOURCE_ADD_ICON = "datasource_add.png"; //$NON-NLS-1$
+       public static final String DATABINDING_DATASOURCE_DELETE_ICON = "datasource_delete.png"; //$NON-NLS-1$
+       public static final String DATABINDING_VIEWMODEL_ADD_ICON = "datamodel_add.png"; //$NON-NLS-1$
+       public static final String DATABINDING_VIEWMODEL_DELETE_ICON = "datamodel_delete.png"; //$NON-NLS-1$
+       public static final String DATABINDING_VIEWMODELITEM_ADD_ICON = "modelitem_add.png"; //$NON-NLS-1$
+       public static final String DATABINDING_DELETE_ICON = "delete.png"; //$NON-NLS-1$
        
        // HandlerCodeWriter
        public static final String FILENAME = "%FileName%"; //$NON-NLS-1$
@@ -312,8 +324,4 @@ public class BuilderConstants {
     public static final String PROFILE_MOBILE = "mobile"; //$NON-NLS-1$
     public static final String PROFILE_WEARABLE = "wearable"; //$NON-NLS-1$
     public static final String PROFILE_TV = "tv"; //$NON-NLS-1$
-
-    public static final String PROFILE_MOBILE_2_3 = PROFILE_MOBILE + DASH + "2.3"; //$NON-NLS-1$
-    public static final String PROFILE_WEARABLE_2_3 = PROFILE_WEARABLE + DASH + "2.3"; //$NON-NLS-1$
-
 }
index 8d97640..217c336 100644 (file)
 
 package org.tizen.webuibuilder.animator.gef.command;
 
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Queue;
 
 import org.eclipse.gef.commands.Command;
 import org.tizen.webuibuilder.animator.model.AnimatorFrame;
@@ -52,6 +54,7 @@ public class AnimationCreateAndChangeFrameCommand extends Command {
     private List<String> names = null;
     private boolean isPredefined = false;
     private AnimatorFrame frame = null;
+    private Queue<AnimatorKeyframe> removedKeyframes = null;
 
     /**
      * Constructor
@@ -69,6 +72,7 @@ public class AnimationCreateAndChangeFrameCommand extends Command {
         this.properties = properties;
         this.origin = origin;
         this.names = currentSelector.getAnimatorKeyframeNames();
+        this.removedKeyframes = new LinkedList<AnimatorKeyframe>();
     }
 
     /*
@@ -118,9 +122,10 @@ public class AnimationCreateAndChangeFrameCommand extends Command {
                                }
                        }
                }
-       
+
                oldProperties = frame.getCopiedProperties();
-               frame.addOrEditProperties(properties);
+               removedKeyframes.clear();
+               frame.addOrEditProperties(properties, removedKeyframes);
                isPredefined = frame.isPredefined();
                frame.setPredefined(false);
                currentSelector.updateSelectorTime();
@@ -199,7 +204,7 @@ public class AnimationCreateAndChangeFrameCommand extends Command {
        if (frame != null) {
                AnimatorKeyframe keyframe = (AnimatorKeyframe)frame.getParent();
                if (keyframe != null) {
-                       frame.removeOrReplaceProperties(animatorModelManager.getModelFactory(), oldProperties, properties);
+                       frame.removeOrEditProperties(animatorModelManager.getModelFactory(), oldProperties, properties, removedKeyframes);
                        
                        //It is possible that keyframe has been changed in removeOrReplaceProperties
                        keyframe = (AnimatorKeyframe)frame.getParent();
index fdef029..7f29eef 100644 (file)
@@ -139,6 +139,8 @@ public class AnimationCreateCommand extends Command {
        
                if(!currentSelector.isExistKeyframe(keyframe)) {
                        currentSelector.addChild(keyframe);
+                       animatorModelManager.fireEvent(true, currentSelector,
+                               AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe);
                }
                
                currentSelector.updateSelectorTime();
@@ -147,11 +149,12 @@ public class AnimationCreateCommand extends Command {
                oldSelector = currentSelector.cloneAnimatorSelector(animatorModelManager.getModelFactory(), false);
        }
                isMerged = currentSelector.mergeOrSplitKeyframe(animatorModelManager.getModelFactory(), removedKeyframes);
-       
-       //if(!isMerged) {
-               animatorModelManager.fireEvent(true, currentSelector,
-                       AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe);
-    // }
+//     if(!isMerged) {
+//             animatorModelManager.fireEvent(true, currentSelector,
+//                     AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe);
+//     } else {
+//             animatorModelManager.fireEvent(AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe);
+//     }
     }
 
     /*
@@ -197,8 +200,7 @@ public class AnimationCreateCommand extends Command {
        currentSelector.updateSelectorTime();
        currentSelector.setKeyframeNames(names);
        
-       animatorModelManager.fireEvent(true, currentSelector,
-                       AnimatorModelEvent.EventType.KEYFRAME_REMOVE, origin, keyframe);
+       animatorModelManager.fireEvent(AnimatorModelEvent.EventType.KEYFRAME_REMOVE, origin, keyframe);
        
     }
 }
\ No newline at end of file
index 9ab2f55..20e463d 100644 (file)
@@ -75,6 +75,9 @@ public class AnimationLockCommand extends Command {
         AnimatorProperty animatorProperty = new AnimatorProperty("LOCK", isLock);
         manager.fireEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
                           animatorProperty);
+        animatorWidget.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
+                                                        animatorProperty));
+
     }
 
     /*
@@ -89,5 +92,7 @@ public class AnimationLockCommand extends Command {
         AnimatorProperty animatorProperty = new AnimatorProperty("LOCK", !isLock);
         manager.fireEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
                           animatorProperty);
+        animatorWidget.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
+                                                        animatorProperty));
     }
 }
index 2d7b5d8..59ad71e 100644 (file)
@@ -75,6 +75,8 @@ public class AnimationMakeInvisibleCommand extends Command {
         AnimatorProperty animatorProperty = new AnimatorProperty("VISIBLE", visibility);
         manager.fireEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
                           animatorProperty);
+        animatorWidget.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
+                                                        animatorProperty));
     }
 
     /*
@@ -90,5 +92,7 @@ public class AnimationMakeInvisibleCommand extends Command {
         AnimatorProperty animatorProperty = new AnimatorProperty("VISIBLE", !visibility);
         manager.fireEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
                           animatorProperty);
+        animatorWidget.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.PROPERTY_CHANGE, origin, animatorWidget,
+                                                        animatorProperty));
     }
 }
index f36fae0..b963552 100644 (file)
 
 package org.tizen.webuibuilder.animator.gef.command;
 
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Queue;
+
 import org.eclipse.draw2d.geometry.Point;
 import org.tizen.webuibuilder.animator.model.AnimationPathCurve;
+import org.tizen.webuibuilder.animator.model.AnimatorKeyframe;
 
 
 /**
@@ -33,6 +38,8 @@ import org.tizen.webuibuilder.animator.model.AnimationPathCurve;
 public class AnimationPathMoveCommand extends AnimationPathCommand {
     private Point oldPoint = null;
     private AnimationPathCurve oldCurve = null;
+    private Map<String, String> oldProperties = null;
+    private Queue<AnimatorKeyframe> removedKeyframes = new LinkedList<AnimatorKeyframe>();
 
     public void execute() {
 //     AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); 
@@ -68,7 +75,10 @@ public class AnimationPathMoveCommand extends AnimationPathCommand {
        if (getCurveIndex() == null) {
             Point p = getLocation();
             setOldPoint(getModel().getKeyFrameLocationFromModel(getIndex()));
-            getModel().setKeyFrameToModel(getIndex(), p.x, p.y);
+//            getModel().setKeyFrameToModel(getIndex(), p.x, p.y);
+            oldProperties =  getModel().getAnimatorFrame(getIndex()).getCopiedProperties();
+            removedKeyframes.clear();
+            getModel().addKeyFrameToModel(getIndex(), p.x, p.y, removedKeyframes);
         } else {
             setOldCurve(getModel().getCurveFromModel(getIndex(), getCurveIndex()));
             AnimationPathCurve curve = getModel().getCurve(getIndex(), getCurveIndex());
@@ -108,7 +118,8 @@ public class AnimationPathMoveCommand extends AnimationPathCommand {
         Point p = getOldPoint();
         AnimationPathCurve curve = getOldCurve();
         if (p != null) {
-            getModel().setKeyFrameToModel(getIndex(), p.x, p.y);
+//            getModel().setKeyFrameToModel(getIndex(), p.x, p.y);
+               getModel().removeKeyFrameToModel(getIndex(), p.x, p.y, oldProperties, removedKeyframes);
         } else if (curve != null) {
             getModel().setCurveToModel(getIndex(), getCurveIndex(), curve);
         }
index b7d7c6c..a80c143 100644 (file)
 package org.tizen.webuibuilder.animator.gef.command;
 
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.Map;
+import java.util.Queue;
 
 import org.eclipse.gef.commands.Command;
 import org.tizen.webuibuilder.animator.model.AnimatorFrame;
+import org.tizen.webuibuilder.animator.model.AnimatorKeyframe;
 import org.tizen.webuibuilder.animator.model.AnimatorModelEvent;
 import org.tizen.webuibuilder.animator.model.AnimatorModelEvent.Origin;
 import org.tizen.webuibuilder.animator.model.AnimatorModelManager;
@@ -40,9 +43,9 @@ import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
 public class AnimationPropertyChangeCommand extends Command {
 
     private AnimatorFrame frame;
-    private String Key;
-    private String oldValue;
+    private Map<String, String> oldProperties = null;
     private Map<String, String> properties = new HashMap<String, String>();
+    private Queue<AnimatorKeyframe> removedKeyframes = null;
 
     /**
      * Constructor
@@ -66,9 +69,9 @@ public class AnimationPropertyChangeCommand extends Command {
     public AnimationPropertyChangeCommand(AnimatorFrame frame, String key, String value,
             boolean undoable) {
         this.frame = frame;
-        this.Key = key;
-        this.oldValue = frame.getProperty(key);
+        this.oldProperties = frame.getCopiedProperties();
         this.properties.put(key, value);
+        this.removedKeyframes = new LinkedList<AnimatorKeyframe>();
     }
 
     /*
@@ -102,7 +105,8 @@ public class AnimationPropertyChangeCommand extends Command {
        
        AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
        
-        frame.addOrEditProperties(properties);
+       removedKeyframes.clear();
+        frame.addOrEditProperties(properties, removedKeyframes);
         animatorModelManager.fireEvent(AnimatorModelEvent.EventType.FRAME_EDIT, Origin.PROPERTY,
                                        frame);
     }
@@ -132,7 +136,8 @@ public class AnimationPropertyChangeCommand extends Command {
                        AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.PROPERTY, currentSelector);*/
        
        AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
-        frame.removeOrReplaceProperty(animatorModelManager.getModelFactory(), Key, oldValue);
+       frame.removeOrEditProperties(animatorModelManager.getModelFactory(), oldProperties, properties, removedKeyframes);
+       
         animatorModelManager.fireEvent(AnimatorModelEvent.EventType.FRAME_EDIT, Origin.PROPERTY,
                                        frame);
     }
index ea3afc4..d860736 100644 (file)
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Queue;
 import java.util.Set;
 
 import org.eclipse.draw2d.geometry.Dimension;
@@ -341,48 +342,83 @@ public class AnimationPathModel implements IPropertySource {
         return points;
     }
 
-    /**
-     * Sets the key frame to model.
-     * 
-     * @param frameIndex
-     *            the frame index
-     * @param x
-     *            the x
-     * @param y
-     *            the y
-     */
-    public void setKeyFrameToModel(int frameIndex, Integer x, Integer y) {
-        CssValueForLocation css = getLastCss(frameIndex);
-
-        Point widgetPoint =
-                calculateWidgetPoint(x, y, css.width, css.height, css.originX, css.originY);
-
-        AnimatorFrame editingFrame = keyframes.get(frameIndex).getFrameForModel();
-
-        // editingFrame.addProperty("left",
-        // AnimatorUtils.convertPixToString(getWebPosX(widgetPoint.x)));
-        // editingFrame.addProperty("top",
-        // AnimatorUtils.convertPixToString(getWebPosY(widgetPoint.y)));
-
-        // String transform = editingFrame.getProperty("-webkit-transform");
-        // transform = AnimatorUtils.replaceTranslate(transform, getWebPosX(widgetPoint.x) -
-        // getCssPositionInDesigner("left"),
-        // getWebPosY(widgetPoint.y) - getCssPositionInDesigner("top"));
-        // editingFrame.addProperty("-webkit-transform", transform);
-
-        Point p = translateToModel(widgetPoint);
+//    /**
+//     * Sets the key frame to model.
+//     * 
+//     * @param frameIndex
+//     *            the frame index
+//     * @param x
+//     *            the x
+//     * @param y
+//     *            the y
+//     */
+//    public void setKeyFrameToModel(int frameIndex, Integer x, Integer y) {
+//        CssValueForLocation css = getLastCss(frameIndex);
+//
+//        Point widgetPoint =
+//                calculateWidgetPoint(x, y, css.width, css.height, css.originX, css.originY);
+//
+//        AnimatorFrame editingFrame = keyframes.get(frameIndex).getFrameForModel();
+//
+//        // editingFrame.addProperty("left",
+//        // AnimatorUtils.convertPixToString(getWebPosX(widgetPoint.x)));
+//        // editingFrame.addProperty("top",
+//        // AnimatorUtils.convertPixToString(getWebPosY(widgetPoint.y)));
+//
+//        // String transform = editingFrame.getProperty("-webkit-transform");
+//        // transform = AnimatorUtils.replaceTranslate(transform, getWebPosX(widgetPoint.x) -
+//        // getCssPositionInDesigner("left"),
+//        // getWebPosY(widgetPoint.y) - getCssPositionInDesigner("top"));
+//        // editingFrame.addProperty("-webkit-transform", transform);
+//
+//        Point p = translateToModel(widgetPoint);
+//        Map<String, String> properties = new HashMap<String, String>();
+//        properties.put(Constants.translateX, AnimatorUtils.convertPixToString(p.x));
+//        properties.put(Constants.translateY, AnimatorUtils.convertPixToString(p.y));
+//
+//        editingFrame.editProperties(AnimatorUtils.getAppManager().getAnimatorModelManager().getModelFactory(), properties);
+//
+//        // editingFrame.addProperty(Constants.translateX,
+//        // AnimatorUtils.convertPixToString(p.x));
+//        // editingFrame.addProperty(Constants.translateY,
+//        // AnimatorUtils.convertPixToString(p.y));
+//
+//        fireModelChangeEvent(editingFrame, false);
+//    }
+    
+    public Map<String, String> calculateProperties(int frameIndex, Integer x, Integer y) {
+       CssValueForLocation css = getLastCss(frameIndex);
+       Point widgetPoint =
+                 calculateWidgetPoint(x, y, css.width, css.height, css.originX, css.originY);
+        
+       Point p = translateToModel(widgetPoint);
         Map<String, String> properties = new HashMap<String, String>();
         properties.put(Constants.translateX, AnimatorUtils.convertPixToString(p.x));
         properties.put(Constants.translateY, AnimatorUtils.convertPixToString(p.y));
-
-        editingFrame.editProperties(AnimatorUtils.getAppManager().getAnimatorModelManager().getModelFactory(), properties);
-
-        // editingFrame.addProperty(Constants.translateX,
-        // AnimatorUtils.convertPixToString(p.x));
-        // editingFrame.addProperty(Constants.translateY,
-        // AnimatorUtils.convertPixToString(p.y));
-
-        fireModelChangeEvent(editingFrame, false);
+        
+        return properties;
+    }
+    
+    public AnimatorFrame getAnimatorFrame(int frameIndex) {
+       return keyframes.get(frameIndex).getFrameForModel();
+    }
+    
+    public void addKeyFrameToModel(int frameIndex, Integer x, Integer y, Queue<AnimatorKeyframe> removedKeyframes) {
+       
+       AnimatorFrame editingFrame = keyframes.get(frameIndex).getFrameForModel();
+       
+       editingFrame.addOrEditProperties(calculateProperties(frameIndex, x, y), removedKeyframes);
+       
+       fireModelChangeEvent(editingFrame, false);
+    }
+    
+    public void removeKeyFrameToModel(int frameIndex, Integer x, Integer y, Map<String, String> oldProperties, Queue<AnimatorKeyframe> removedKeyframes) {
+       
+       AnimatorFrame editingFrame = keyframes.get(frameIndex).getFrameForModel();
+       
+       editingFrame.removeOrEditProperties(modelFactory, oldProperties, calculateProperties(frameIndex, x, y), removedKeyframes);
+       
+       fireModelChangeEvent(editingFrame, false);
     }
 
     /**
index 8aa47a9..c62111e 100644 (file)
@@ -30,6 +30,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Queue;
 import java.util.Set;
 
 import org.eclipse.draw2d.geometry.Point;
@@ -340,7 +341,7 @@ public class AnimatorFrame extends AnimatorModel {
      * 
      * @param properties
      */
-    public boolean addOrEditProperties(Map<String, String> properties) {
+    public boolean addOrEditProperties(Map<String, String> properties, Queue<AnimatorKeyframe> removedKeyframes) {
        boolean result = false;
         boolean needToCheck = false;
         Iterator<Entry<String, String>> editingPropertiesIterator =
@@ -360,7 +361,7 @@ public class AnimatorFrame extends AnimatorModel {
         AnimatorKeyframe keyframe = (AnimatorKeyframe) getParent();
         AnimatorSelector selector = (AnimatorSelector) keyframe.getParent();
         if (needToCheck) {// value was changed
-               result = keyframe.mergeKeyframe(this);
+               result = keyframe.mergeKeyframe(this, removedKeyframes);
         }
 
         selector.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.FRAME_EDIT, this));
@@ -388,6 +389,25 @@ public class AnimatorFrame extends AnimatorModel {
         AnimatorKeyframe keyframe = (AnimatorKeyframe) getParent();
         AnimatorSelector selector = (AnimatorSelector) keyframe.getParent();
         AnimatorFrame nextFrame = (AnimatorFrame) keyframe.getNextChild(this);
+        AnimatorFrame previousFrame = (AnimatorFrame) keyframe.getPrevChild(this);
+        if (previousFrame != null) {
+            if (previousFrame.hasSamePropertyValue(this)) {
+                AnimatorKeyframe previousKeyframe =
+                        selector.createKeyframe(modelFactory, "custom", previousFrame.getFrameTime());
+                keyframe.splitFrame(previousKeyframe, this, true);
+                selector.addChild(previousKeyframe);
+            }
+        } else {
+            AnimatorKeyframe previousKeyframe = (AnimatorKeyframe) selector.getPrevChild(keyframe);
+            if (previousKeyframe != null) {
+                AnimatorFrame lastFrame = previousKeyframe.getLastFrame();
+                if (!lastFrame.hasSamePropertyValue(this)) {
+                       previousKeyframe.mergeFrame(this, true);
+                }
+            }
+        }
+        
+        keyframe = (AnimatorKeyframe)getParent();
         if (nextFrame != null) {
             if (nextFrame.hasSamePropertyValue(this)) {
                 AnimatorKeyframe nextKeyframe =
@@ -405,23 +425,7 @@ public class AnimatorFrame extends AnimatorModel {
             }
         }
 
-        AnimatorFrame previousFrame = (AnimatorFrame) keyframe.getPrevChild(this);
-        if (previousFrame != null) {
-            if (previousFrame.hasSamePropertyValue(this)) {
-                AnimatorKeyframe previousKeyframe =
-                        selector.createKeyframe(modelFactory, "custom", previousFrame.getFrameTime());
-                keyframe.splitFrame(previousKeyframe, this, true);
-                selector.addChild(previousKeyframe);
-            }
-        } else {
-            AnimatorKeyframe previousKeyframe = (AnimatorKeyframe) selector.getPrevChild(keyframe);
-            if (previousKeyframe != null) {
-                AnimatorFrame lastFrame = previousKeyframe.getLastFrame();
-                if (!lastFrame.hasSamePropertyValue(this)) {
-                    keyframe.mergeFrame(lastFrame, true);
-                }
-            }
-        }
+       
 
         selector.fireEvent(new AnimatorModelEvent(AnimatorModelEvent.EventType.FRAME_EDIT, this));
     }
@@ -435,24 +439,24 @@ public class AnimatorFrame extends AnimatorModel {
         this.properties.remove(key);
     }
 
-    /**
-     * Remove or replace property
-     * 
-     * @param key
-     * @param oldValue
-     */
-    public void removeOrReplaceProperty(AnimatorModelFactory modelFactory, String key, String oldValue) {
-        AnimatorKeyframe keyframe = (AnimatorKeyframe) getParent();
-        String currentValue = getProperty(key);
-
-        if (oldValue == null)
-            removeProperty(key);
-        else
-            addProperty(key, oldValue);
-
-        if (currentValue != null)
-            keyframe.splitKeyframe(modelFactory, this);
-    }
+//    /**
+//     * Remove or replace property
+//     * 
+//     * @param key
+//     * @param oldValue
+//     */
+//    public void removeOrReplaceProperty(AnimatorModelFactory modelFactory, String key, String oldValue) {
+//        AnimatorKeyframe keyframe = (AnimatorKeyframe) getParent();
+//        String currentValue = getProperty(key);
+//
+//        if (oldValue == null)
+//            removeProperty(key);
+//        else
+//            addProperty(key, oldValue);
+//
+//        if (currentValue != null)
+//            keyframe.splitKeyframe(modelFactory, this);
+//    }
 
     /**
      * Remove of replace properties
@@ -460,9 +464,10 @@ public class AnimatorFrame extends AnimatorModel {
      * @param oldProperties
      * @param properties
      */
-    public void removeOrReplaceProperties(AnimatorModelFactory modelFactory,
+    public void removeOrEditProperties(AnimatorModelFactory modelFactory,
                                                                          Map<String, String> oldProperties,
-                                          Map<String, String> properties) {
+                                          Map<String, String> properties,
+                                          Queue<AnimatorKeyframe> removedKeyframes) {
         AnimatorKeyframe keyframe = (AnimatorKeyframe) getParent();
         Iterator<Entry<String, String>> editingPropertiesIterator =
                 properties.entrySet().iterator();
@@ -479,7 +484,7 @@ public class AnimatorFrame extends AnimatorModel {
             } else
                 removeProperty(editingPropertyKey);
         }
-        keyframe.splitKeyframe(modelFactory, this);
+        keyframe.splitKeyframe(modelFactory, this, removedKeyframes);
     }
 
     /**
@@ -626,40 +631,40 @@ public class AnimatorFrame extends AnimatorModel {
                 .parseInt(new CSSProperty(key, getProperty(key)).getValue());
     }
     
-    /**
-     * Get computed properties for predefined animation
-     * 
-     * @param css3 key
-     * @param widget property value
-     * @return value for input key
-     */
-    public String getComputedPropertyforPredefinedAnimationFromPreviousKeyframe(String key, String widgetProperty) {
-       String computedProperty = null;
-       
-       String previousProperty = getComputedPropertiesFromPreviousKeyframe(key);
-               if(previousProperty == null) {
-                       previousProperty = widgetProperty;
-               } 
-               if(containsKey(key)) {
-                       if (key.equals("translateX") || key.equals("translateY")) {
-                               computedProperty =  AnimatorUtils.convertPixToString(getCalculatedPropertyForPercentage(key)
-                          /*+ Integer.parseInt(new CSSProperty(key, previousProperty)
-                                  .getValue())*/);
-                       } else if ( key.equals("rotateZ") || key.equals("skewX") || key.equals("skewY")) {
-                               computedProperty =  AnimatorUtils.convertDegToString(getCalculatedPropertyForPercentage(key)
-                                  /*+ Integer.parseInt(new CSSProperty(key, previousProperty)
-                                          .getValue())*/);
-                       } else if(key.equals("scaleX") || key.equals("scaleY")) {
-                               computedProperty = getProperty(key);
-                       } else {
-                               computedProperty = getProperty(key);
-                       }
-               } else {
-                       computedProperty = previousProperty;
-               }
-
-               return computedProperty;
-       }
+//    /**
+//     * Get computed properties for predefined animation
+//     * 
+//     * @param css3 key
+//     * @param widget property value
+//     * @return value for input key
+//     */
+//    public String getComputedPropertyforPredefinedAnimationFromPreviousKeyframe(String key, String widgetProperty) {
+//     String computedProperty = null;
+//     
+//     String previousProperty = getComputedPropertiesFromPreviousKeyframe(key);
+//             if(previousProperty == null) {
+//                     previousProperty = widgetProperty;
+//             } 
+//             if(containsKey(key)) {
+//                     if (key.equals("translateX") || key.equals("translateY")) {
+//                             computedProperty =  AnimatorUtils.convertPixToString(getCalculatedPropertyForPercentage(key)
+//                        /*+ Integer.parseInt(new CSSProperty(key, previousProperty)
+//                                .getValue())*/);
+//                     } else if ( key.equals("rotateZ") || key.equals("skewX") || key.equals("skewY")) {
+//                             computedProperty =  AnimatorUtils.convertDegToString(getCalculatedPropertyForPercentage(key)
+//                                /*+ Integer.parseInt(new CSSProperty(key, previousProperty)
+//                                        .getValue())*/);
+//                     } else if(key.equals("scaleX") || key.equals("scaleY")) {
+//                             computedProperty = getProperty(key);
+//                     } else {
+//                             computedProperty = getProperty(key);
+//                     }
+//             } else {
+//                     computedProperty = previousProperty;
+//             }
+//
+//             return computedProperty;
+//     }
     
     /**
      * Get computed properties for predefined animation from previous custom frame
@@ -696,28 +701,28 @@ public class AnimatorFrame extends AnimatorModel {
                return computedProperty;
        }
     
-    /**
-     * Get computed properties from previous keyframes
-     * 
-     * @param css3 key
-     * @return value for input key
-     */
-       public String getComputedPropertiesFromPreviousKeyframe(String key) {           
-               AnimatorKeyframe keyframe = (AnimatorKeyframe)getParent();
-               AnimatorSelector selector = (AnimatorSelector)keyframe.getParent();
-               AnimatorKeyframe previousKeyframe = (AnimatorKeyframe)selector.getPrevChild(keyframe);
-               while(previousKeyframe != null) {
-                       if(previousKeyframe.getLastFrame() != null) {
-                               String value = previousKeyframe.getLastFrame().getProperty(key);
-                       if(value != null) {
-                               return value;
-                       }
-                       }
-               previousKeyframe = (AnimatorKeyframe)selector.getPrevChild(previousKeyframe);
-       }
-       
-       return null;            
-    }
+//    /**
+//     * Get computed properties from previous keyframes
+//     * 
+//     * @param css3 key
+//     * @return value for input key
+//     */
+//     public String getComputedPropertiesFromPreviousKeyframe(String key) {           
+//             AnimatorKeyframe keyframe = (AnimatorKeyframe)getParent();
+//             AnimatorSelector selector = (AnimatorSelector)keyframe.getParent();
+//             AnimatorKeyframe previousKeyframe = (AnimatorKeyframe)selector.getPrevChild(keyframe);
+//             while(previousKeyframe != null) {
+//                     if(previousKeyframe.getLastFrame() != null) {
+//                             String value = previousKeyframe.getLastFrame().getProperty(key);
+//                     if(value != null) {
+//                             return value;
+//                     }
+//                     }
+//             previousKeyframe = (AnimatorKeyframe)selector.getPrevChild(previousKeyframe);
+//     }
+//     
+//     return null;            
+//    }
 
     /**
      * Get computed properties from previous frames
index 82d6535..4780310 100644 (file)
@@ -23,8 +23,8 @@
 
 package org.tizen.webuibuilder.animator.model;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.Queue;
 
 import org.tizen.webuibuilder.animator.AnimatorConstants;
 import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
@@ -205,35 +205,46 @@ public class AnimatorKeyframe extends AnimatorModel {
      * 
      * @return Return last frame
      */
-    public AnimatorFrame getLastFrame() {
-        AnimatorFrame result = null;
-        for (AnimatorModel model : getChildren()) {
-            AnimatorFrame frame = (AnimatorFrame) model;
-
-            if (Double.compare(frame.getFrameTime(), duration) == 0)
-                result = frame;
-        }
-        return result;
+//    public AnimatorFrame getLastFrame() {
+//        AnimatorFrame result = null;
+//        for (AnimatorModel model : getChildren()) {
+//            AnimatorFrame frame = (AnimatorFrame) model;
+//
+//            if (Double.compare(frame.getFrameTime(), duration) == 0)
+//                result = frame;
+//        }
+//        return result;
+//    }
+    
+    public AnimatorFrame getLastFrame() {      
+       return (AnimatorFrame)getChild(getChildrenSize() -1);
     }
-
-    /**
-     * Get First frame from list
-     * 
-     * @return Return first frame
-     */
+    
     public AnimatorFrame getFirstFrame() {
-        AnimatorFrame result = null;
-        for (AnimatorModel model : getChildren()) {
-            AnimatorFrame frame = (AnimatorFrame) model;
-
-            if (Double.compare(frame.getFrameTime(), 0.0) == 0) {
-                result = frame;
-                break;
-            }
-        }
-        return result;
+       if(getChildrenSize() != 0) {
+               return (AnimatorFrame)getChild(0);
+       }
+       return null;
     }
 
+//    /**
+//     * Get First frame from list
+//     * 
+//     * @return Return first frame
+//     */
+//    public AnimatorFrame getFirstFrame() {
+//        AnimatorFrame result = null;
+//        for (AnimatorModel model : getChildren()) {
+//            AnimatorFrame frame = (AnimatorFrame) model;
+//
+//            if (Double.compare(frame.getFrameTime(), 0.0) == 0) {
+//                result = frame;
+//                break;
+//            }
+//        }
+//        return result;
+//    }
+
     /**
      * Update duration, delay and children's frame time assume that frame is going to be added at
      * current time
@@ -414,7 +425,7 @@ public class AnimatorKeyframe extends AnimatorModel {
      * @param frame
      *            my frame for checking
      */
-    public boolean mergeKeyframe(AnimatorFrame frame) {
+    public boolean mergeKeyframe(AnimatorFrame frame, Queue<AnimatorKeyframe> removedKeyframes) {
        boolean result = false;
         AnimatorSelector selector = (AnimatorSelector) getParent();
         AnimatorKeyframe previousParent = (AnimatorKeyframe) selector.getPrevChild(this);
@@ -429,13 +440,11 @@ public class AnimatorKeyframe extends AnimatorModel {
                         previousParent.mergeFrame(frame, true);
                         merged = true;
                         result = true;
+                        removedKeyframes.add(this);
                     }
                 }
                 if (nextParent != null) {
                     AnimatorFrame nextFrame = nextParent.getFirstFrame();
-//                    assert !nextFrame.hasSamePropertyValue(frame) : "This should be always true, if not previous logic is corrupt";
-                    // if (!nextFrame.hasSamePropertyValue(this)) {// doesn't need to, because
-                    // always true; confirmation required
                     if (!nextFrame.hasSamePropertyValue(frame)) {
                        if (merged) {
                                previousParent.mergeFrame(nextFrame, true);
@@ -443,6 +452,7 @@ public class AnimatorKeyframe extends AnimatorModel {
                                        mergeFrame(nextFrame, true);
                                }
                        result = true;
+                       removedKeyframes.add(nextParent);
                     }
                 }
             }
@@ -454,19 +464,21 @@ public class AnimatorKeyframe extends AnimatorModel {
                     if (!previousFrame.hasSamePropertyValue(frame)) {
                         previousParent.mergeFrame(frame, true);
                         result = true;
+                        removedKeyframes.add(this);
                     }
                 }
-                // TODO check right
-            } else if (getChildIndex(frame) == (keyframeChildrenSize - 1)) { // case 2.2 (right most
-                                                                            // case)
-                // merge next frame
+            } else if (getChildIndex(frame) == (keyframeChildrenSize - 1)) { // case 2.2 (right most case)
+               // merge next frame
                 if (nextParent != null) {
                     AnimatorFrame nextFrame = nextParent.getFirstFrame();
-                    mergeFrame(nextFrame, true);
-                    result = true;
+                    if (!nextFrame.hasSamePropertyValue(frame)) {
+                       mergeFrame(nextFrame, true);
+                       result = true;
+                       removedKeyframes.add(nextParent);
+                    }
                 }
             } else {// case 2.3 (inside case)
-                // check left and right(rare case) TODO later
+                // check left and right(rare case)
             }
         } else {
             throw new RuntimeException(
@@ -482,8 +494,6 @@ public class AnimatorKeyframe extends AnimatorModel {
      * @param frame
      */
     public void mergeFrame(AnimatorFrame frame, boolean needToFire) {
-        AnimatorKeyframe keyframe = (AnimatorKeyframe) frame.getParent();
-        addName(keyframe.getName());
         mergeFrame(frame);
 
         if (needToFire) {
@@ -516,27 +526,48 @@ public class AnimatorKeyframe extends AnimatorModel {
      * 
      * @param frame
      */
-    public void splitKeyframe(AnimatorModelFactory modelFactory, AnimatorFrame frame) {
+    public void splitKeyframe(AnimatorModelFactory modelFactory, AnimatorFrame frame, Queue<AnimatorKeyframe> removedKeyframes) {
+       boolean isSplited = false;
         AnimatorSelector selector = (AnimatorSelector) getParent();
-        AnimatorFrame nextFrame = (AnimatorFrame) getNextChild(frame);
-        if (nextFrame != null) {
-            if (nextFrame.hasSamePropertyValue(frame)) {
-                AnimatorKeyframe nextKeyframe =
-                        selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
-                splitFrame(nextKeyframe, nextFrame, true);
-                selector.addChild(nextKeyframe);
-            }
-        }
-
         AnimatorFrame previousFrame = (AnimatorFrame) getPrevChild(frame);
+        AnimatorFrame nextFrame = (AnimatorFrame) getNextChild(frame);
         if (previousFrame != null) {
             if (previousFrame.hasSamePropertyValue(frame)) {
-                AnimatorKeyframe currentKeyframe =
-                        selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
+//                AnimatorKeyframe currentKeyframe =
+//                        selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
+               AnimatorKeyframe currentKeyframe = null;
+               if(!removedKeyframes.isEmpty()) {
+                       currentKeyframe = removedKeyframes.poll();
+               } else {
+                       currentKeyframe = selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
+               }
                 splitFrame(currentKeyframe, frame, true);
                 selector.addChild(currentKeyframe);
+                isSplited = true;
             }
         }
+        
+        if (nextFrame != null) {
+            if (nextFrame.hasSamePropertyValue(frame)) {
+//                AnimatorKeyframe nextKeyframe =
+//                        selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
+               AnimatorKeyframe nextKeyframe = null;
+               if(!removedKeyframes.isEmpty()) {
+                       nextKeyframe = removedKeyframes.poll();
+               } else {
+                       nextKeyframe = selector.createKeyframe(modelFactory, "custom", frame.getFrameTime());
+               }
+               if(isSplited) {
+                       AnimatorKeyframe currentKeyframe = (AnimatorKeyframe)frame.getParent();
+                       currentKeyframe.splitFrame(nextKeyframe, nextFrame, true);
+               } else {
+                       splitFrame(nextKeyframe, nextFrame, true);
+               }
+                selector.addChild(nextKeyframe);
+            }
+        }
+
+       
     }
 
     /**
index f8a34c4..23e8360 100644 (file)
@@ -403,14 +403,13 @@ public class TimelineContentContainer extends Composite {
         } else {
             hScroll.setMaximum(lastTimeSel + TimelineConstants.DEFAULT_HSCROLL_EXPANSION);
         }
-
+        
         if (scrollMove == 1 || scrollMove == 2) {
-            int increment = lastTimeSel / TimelineConstants.DEFAULT_HSCROLL_SELECTION_INTERVAL;
-            hScroll.setSelection(increment * TimelineConstants.DEFAULT_HSCROLL_SELECTION_INTERVAL);
+            hScroll.setSelection(lastTimeSel - TimelineConstants.DEFAULT_HSCROLL_EXPANSION);
         }
         
         // start Time
-        if ((path == 0 && (startTime <= 0)) || ((pointTime <= MINT_TIMEPOINT) && scrollMove == 2)) {
+        if ((path == 0 && (startTime <= MINT_TIMEPOINT)) || ((pointTime <= MINT_TIMEPOINT) && scrollMove == 2)) {
             startTime = 0;
             hScroll.setSelection(0);
         } else if (scrollMove == 2) {
@@ -422,7 +421,6 @@ public class TimelineContentContainer extends Composite {
         }
 
         if (scrollMove == 1 || scrollMove == 2) {
-
             timeBar.setStartTime(startTime);
             timeBar.redraw();
 
index 094f260..860a635 100644 (file)
@@ -39,6 +39,7 @@ public class TimelineFrameEditCommand extends Command {
     private AnimatorFrame frame = null;
     private double afterFrameTime = 0.0;
     private double beforeFrameTime = 0.0;
+    private double beforeDelayTime = 0.0;
 
     /**
      * Construct
@@ -50,9 +51,10 @@ public class TimelineFrameEditCommand extends Command {
      */
     public TimelineFrameEditCommand(AnimatorFrame frame, double afterTime) {
         this.frame = frame;
-        this.keyframe = (AnimatorKeyframe)frame.getParent();
+        this.keyframe = (AnimatorKeyframe) frame.getParent();
         this.afterFrameTime = afterTime;
         this.beforeFrameTime = frame.getFrameTime();
+        this.beforeDelayTime = keyframe.getDelay();
     }
 
     /*
@@ -62,39 +64,45 @@ public class TimelineFrameEditCommand extends Command {
      */
     @Override
     public void execute() {
-//     AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
-//     
-//     if(oldSelector == null  || oldSelector == null) {
-//             oldSelector = currentSelector.cloneAnimatorSelector();
-//             currentSelector.replaceAll(currentSelector.cloneAnimatorSelector());
-//             //Change new keyframe and frame from currentSelector
-//             keyframe = currentSelector.findAnimatorKeyframe(keyframe);
-//             frame = keyframe.getFrameByCurrentTime(keyframe.getDelay() + frame.getFrameTime());
-//             
-//             frame.setFrameTime(afterFrameTime);
-//            keyframe.removeChild(frame, false);
-//            keyframe.addChild(frame, false);
-//            
-//            currentSelector.updateSelectorTime();
-//            newSelector = currentSelector.cloneAnimatorSelector();
-//     } else {
-//             currentSelector.replaceAll(newSelector);
-//     }
-//     
-//     animatorModelManager.fireEvent(true, currentSelector,
-//                     AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector);
-       
-       
-       AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
-       
-       keyframe = (AnimatorKeyframe)frame.getParent();
-        frame.setFrameTime(afterFrameTime);
-        keyframe.removeChild(frame, false);
-        keyframe.addChild(frame, false);
-
-        animatorModelManager.fireEvent(true, frame.getParent().getParent(),
-                                       AnimatorModelEvent.EventType.FRAME_EDIT,
-                                       AnimatorModelEvent.Origin.TIMELINE, frame);
+        // AnimatorModelManager animatorModelManager =
+        // AnimatorUtils.getAppManager().getAnimatorModelManager();
+        //
+        // if(oldSelector == null || oldSelector == null) {
+        // oldSelector = currentSelector.cloneAnimatorSelector();
+        // currentSelector.replaceAll(currentSelector.cloneAnimatorSelector());
+        // //Change new keyframe and frame from currentSelector
+        // keyframe = currentSelector.findAnimatorKeyframe(keyframe);
+        // frame = keyframe.getFrameByCurrentTime(keyframe.getDelay() + frame.getFrameTime());
+        //
+        // frame.setFrameTime(afterFrameTime);
+        // keyframe.removeChild(frame, false);
+        // keyframe.addChild(frame, false);
+        //
+        // currentSelector.updateSelectorTime();
+        // newSelector = currentSelector.cloneAnimatorSelector();
+        // } else {
+        // currentSelector.replaceAll(newSelector);
+        // }
+        //
+        // animatorModelManager.fireEvent(true, currentSelector,
+        // AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE,
+        // currentSelector);
+
+        AnimatorModelManager animatorModelManager =
+                AnimatorUtils.getAppManager().getAnimatorModelManager();
+
+        keyframe = (AnimatorKeyframe) frame.getParent();
+        if (keyframe.getFirstFrame().equals(frame)) {
+            computeFrameTime(afterFrameTime);
+        } else {
+            frame.setFrameTime(afterFrameTime);
+            keyframe.removeChild(frame, false);
+            keyframe.addChild(frame, false);
+            animatorModelManager.fireEvent(true, frame.getParent().getParent(),
+                                           AnimatorModelEvent.EventType.FRAME_EDIT,
+                                           AnimatorModelEvent.Origin.TIMELINE, frame);
+        }
+        
     }
 
     /*
@@ -114,23 +122,64 @@ public class TimelineFrameEditCommand extends Command {
      */
     @Override
     public void undo() {
-//     AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
-//        currentSelector.replaceAll(oldSelector);
-//        
-//     animatorModelManager.fireEvent(true, currentSelector,
-//                     AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector);
-       
-       
-       AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager();
-       
-       AnimatorKeyframe keyframe = (AnimatorKeyframe)frame.getParent();
-       
-        frame.setFrameTime(beforeFrameTime);
-        keyframe.removeChild(frame, false);
-        keyframe.addChild(frame, false);
-
-        animatorModelManager.fireEvent(true, frame.getParent().getParent(),
-                                       AnimatorModelEvent.EventType.FRAME_EDIT,
-                                       AnimatorModelEvent.Origin.TIMELINE, frame);
+        // AnimatorModelManager animatorModelManager =
+        // AnimatorUtils.getAppManager().getAnimatorModelManager();
+        // currentSelector.replaceAll(oldSelector);
+        //
+        // animatorModelManager.fireEvent(true, currentSelector,
+        // AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE,
+        // currentSelector);
+
+        AnimatorModelManager animatorModelManager =
+                AnimatorUtils.getAppManager().getAnimatorModelManager();
+
+        AnimatorKeyframe keyframe = (AnimatorKeyframe) frame.getParent();
+
+        if (keyframe.getFirstFrame().equals(frame)) {
+            computeFrameTime(beforeDelayTime);
+        } else {
+            frame.setFrameTime(beforeFrameTime);
+            keyframe.removeChild(frame, false);
+            keyframe.addChild(frame, false);
+
+            animatorModelManager.fireEvent(true, frame.getParent().getParent(),
+                                           AnimatorModelEvent.EventType.FRAME_EDIT,
+                                           AnimatorModelEvent.Origin.TIMELINE, frame);
+        }
+    }
+    
+    /**
+     * Compute Frames Time
+     * 
+     * @param changedDelayTime
+     */
+    private void computeFrameTime(double changedDelayTime) {
+        double delayTime = keyframe.getDelay();
+        double duration = keyframe.getDuration();
+        double computeTime = changedDelayTime - delayTime;
+        double durationComputeTime = duration - computeTime;
+        
+        keyframe.setDelay(changedDelayTime);
+        keyframe.setDuration(durationComputeTime);
+
+        for(int i = 1; i < keyframe.getChildren().size(); ++i) {
+            AnimatorFrame currentframe = (AnimatorFrame) keyframe.getChildren().get(i);
+            double frameTime = currentframe.getFrameTime();
+            double frameComputedTime = frameTime - computeTime;
+            
+            currentframe.setFrameTime(frameComputedTime);
+        }
+
+        for(int i = 1; i < keyframe.getChildren().size()-1; ++i) {
+            AnimatorFrame currentframe = (AnimatorFrame) keyframe.getChildren().get(i);
+            keyframe.removeChild(currentframe, false);
+            keyframe.addChild(currentframe, false);
+        }
+        
+        AnimatorModelManager animatorModelManager =
+                AnimatorUtils.getAppManager().getAnimatorModelManager();
+        animatorModelManager.fireEvent(true, keyframe.getParent(),
+                                       AnimatorModelEvent.EventType.KEYFRAME_EDIT,
+                                       AnimatorModelEvent.Origin.TIMELINE, keyframe);
     }
 }
index 5f8322d..257c7cf 100644 (file)
@@ -37,13 +37,15 @@ public class TimelineConstants {
     public static final int DEFAULT_LIFE_WIDGET_WIDTH = 100;
     public static final int DEFAULT_LIFE_WIDGET_MIN_WIDTH = 10;
 
+    public static final int DEFAULT_KEYFRAME_CONTROL_HEIGHT = 5;
+
     public static final int DEFAULT_FRAME_WIDGET_WIDTH = 13;
     public static final int DEFAULT_FRAME_WIDGET_HEIGHT = 13;
     public static final int DEFAULT_FRAME_WIDGET_HALF_WIDTH = 6;
     public static final int DEFAULT_FRAME_WIDGET_CENTER_POINT = 7;
     public static final int DEFAULT_FRAME_WIDGET_MARGIN = DEFAULT_KEYFRAME_MARGIN + 1 ;
     public static final int DEFAULT_FRAME_WIDGET_MARGIN_LINUX = DEFAULT_KEYFRAME_MARGIN_LINUX + 1 ;
-    
+
     public static final int DEFAULT_TIMELINE_LEFT_MARGIN = 3;
     public static final int DEFAULT_TIMEBAR_HEIGHT = 26;
     public static final int DEFAULT_SECOND_CELL_WIDTH = 100;
index b90e244..c0e9a7a 100644 (file)
@@ -51,6 +51,7 @@ import org.tizen.webuibuilder.animator.model.AnimatorModel;
 import org.tizen.webuibuilder.animator.model.AnimatorModelEvent;
 import org.tizen.webuibuilder.animator.model.AnimatorModelListenerAdapter;
 import org.tizen.webuibuilder.animator.model.AnimatorModelManager;
+import org.tizen.webuibuilder.animator.model.AnimatorProperty;
 import org.tizen.webuibuilder.animator.model.AnimatorSelector;
 import org.tizen.webuibuilder.animator.model.AnimatorWidget;
 import org.tizen.webuibuilder.animator.ui.views.timeline.TimelineViewer;
@@ -1145,6 +1146,7 @@ public class TimelineEditPart extends AbstractTreeEditPart {
                     ((TimelineEditPart) childEditPart.get(i)).refreshSelectorId();
                 }
 
+                getOutlineElement().redraw();
             }
 
         }
@@ -1212,7 +1214,30 @@ public class TimelineEditPart extends AbstractTreeEditPart {
 
                 viewer.setLastSelectedKeyframeComponent(null);
             }
+        }
+        
+        @Override
+        public void propertyChange(AnimatorModelEvent e) {
+
+            AnimatorModel model = e.getModel();
 
+            if (model != null && model instanceof AnimatorWidget) {
+                AnimatorProperty property = e.getAnimatorProperty();
+                if (property != null) {
+                    String propertyName = property.getPropertyName();
+                    if (propertyName.equals(TimelineMessages.LOCK)) {
+                        boolean isLockable = (Boolean) property.getPropertyValue();
+                        getOutlineElement().setLockable(isLockable);
+                        applyLock();
+                    } else if (propertyName.equals(TimelineMessages.VISIBLE)) {
+                        boolean isVisibleElement = (Boolean) property.getPropertyValue();
+                        getOutlineElement().setVisibleElement(isVisibleElement);
+                        getOutlineElement().redraw();
+                    } else {
+                        // Logger.trace("other property");
+                    }
+                }
+            }
         }
     }
 }
index 0da44ca..0f1b987 100644 (file)
@@ -705,7 +705,7 @@ public class TimelineToolbar extends Composite implements IAnimationListener {
             
             int timelinePoint = (int) (timeBar.getScale() * TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL);
             double pointTime = Formatter.computeTimeTotime(millSecond);
-            int timePoint = Formatter.timeToComputeTime(millSecond);
+            //int timePoint = Formatter.timeToComputeTime(millSecond);
             
             marker.setPositionMarker((int) (pointTime * timelinePoint));
             marker.setCurrentPointTime(millSecond);
@@ -717,8 +717,8 @@ public class TimelineToolbar extends Composite implements IAnimationListener {
                 marker.draw(true);
             }
 
-            double markerTime = marker.getPlayHeaderTime();
-            String time = AnimatorUtils.convertTimetoTimeText(markerTime);
+            //double markerTime = marker.getPlayHeaderTime();
+            String time = AnimatorUtils.convertTimetoTimeText(pointTime);
 
             setCurrentTime(time);
             timeText.redraw();
index 463bba2..b1b0e04 100644 (file)
@@ -63,7 +63,6 @@ import org.tizen.webuibuilder.animator.ui.views.timeline.header.TimelineKeyframe
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrame;
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrameComponent;
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrameUnit;
-import org.tizen.webuibuilder.utility.Platform;
 
 
 /**
@@ -72,7 +71,6 @@ import org.tizen.webuibuilder.utility.Platform;
  */
 public class TimeTreeElement extends Canvas implements ISelectionProvider {
 
-    private int DEFAULT_KEYFRAME_MARGINE = 4;
     private int visibleStartTime = 0;
 
     private Composite treeContainer = null;
@@ -86,6 +84,7 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
     private int extendsPoint = 0;
     private int mouseMoveReleasePoint = 0;
     private int beforeMouseDownPoint = 0;
+    private boolean isSelectedControl = false;
 
     // keyframeunit, keyframe UI
     private KeyFrameUnit selectedKeyFrameUnit = null;
@@ -127,12 +126,6 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
         addListener(SWT.MouseMove, mouseListener);
         addListener(SWT.MouseDoubleClick, mouseListener);
 
-        if (Platform.getOS().equals(Platform.OS_WIN32)) {
-            DEFAULT_KEYFRAME_MARGINE = TimelineConstants.DEFAULT_KEYFRAME_MARGIN;
-        } else if (Platform.getOS().equals(Platform.OS_LINUX)
-                || Platform.getOS().equals(Platform.OS_MACOSX)) {
-            DEFAULT_KEYFRAME_MARGINE = TimelineConstants.DEFAULT_KEYFRAME_MARGIN_LINUX;
-        }
     }
 
     /*
@@ -349,6 +342,20 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                 // System.out.println("inside keyframeUnit true");
             }
 
+            Rectangle extensionS = child.getStartKeyFrameUnitControl();
+            Rectangle extensionE = child.getEndKeyFrameUnitControl();
+            if (extensionS != null && extensionE != null) {
+                isSelectedControl = extensionS.contains(xPoint, yPoint);
+                if (isSelectedControl == true) {
+                    yPoint += TimelineConstants.DEFAULT_KEYFRAME_CONTROL_HEIGHT;
+                } else {
+                    isSelectedControl = extensionE.contains(xPoint, yPoint);
+                    if (isSelectedControl == true) {
+                        yPoint += TimelineConstants.DEFAULT_KEYFRAME_CONTROL_HEIGHT;
+                    }
+                }
+            }
+
             List<KeyFrame> keyframeList = child.getKeyframelist();
             for (KeyFrame keyframe : keyframeList) {
                 isSelectedKeyFrame = keyframe.getKeyframe().contains(xPoint, yPoint);
@@ -358,10 +365,13 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                     break;
                 }
             }
+
             if (isSelectedKeyFrame == true || isSelectedKeyFrameUnit == true) {
                 break;
             }
+
         }
+
         return keyframeComponent;
     }
 
@@ -395,16 +405,15 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                 timelineContentContainer.getContentHeaderContainer();
         TimeBar timebar = contentHeaderContainer.getKeyframeHeader().getTimeBar();
         int positionTime = 0;
-        if (isSelected == true) {
-            positionTime =
-                    selectedKeyFrame.getKeyFrameUnit().getKeyFrameUnitModelXpoint()
-                            + selectedKeyFrame.getKeyFrameModelXpoint()
-                            - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
-            // - getVisibleStartTimePoint();
-        } else {
-            positionTime = mouseDownPoint - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
-            // + getVisibleStartTimePoint();
-        }
+        // if (isSelected == true) {
+        positionTime =
+                selectedKeyFrame.getKeyFrameUnit().getKeyFrameUnitModelXpoint()
+                        + selectedKeyFrame.getKeyFrameModelXpoint()
+                        - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN
+                        - getVisibleStartTimePoint();
+        // } else {
+        // positionTime = mouseDownPoint - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+        // }
         timebar.setPosition(positionTime * TimelineConstants.DEFAULT_CONVERTTIME_POSITION_INTERVAL);
         timebar.redraw();
 
@@ -443,7 +452,6 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
         keyframeUnit.setKeyframeUnitStartTime(startTime);
         keyframeUnit.setKeyframeUnitDurationTime(durationTime);
 
-        // System.out.println("startTime " + startTime + " durationTime " + durationTime);
         Command animationPropertyChange =
                 new TimelineKeyframeEditCommand(keyframeUnit.getModel(), startTime, durationTime);
 
@@ -457,20 +465,42 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
      * @param keyframe
      *            {@link KeyFrame}
      */
-    private void updateKeyFrameModel(KeyFrame keyframe) {
-
+    private void updateKeyFrameModel(KeyFrame keyframe, boolean isInline) {
         double scale = getScale();
         double timelineScalePoint = scale * TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL;
-        double currentSecond =
-                (double) (keyframe.getAfterPoint() - keyframe.getKeyFrameUnit().getKeyframeUnit().x + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH)
-                        / (timelineScalePoint);
-        // System.out.println("current Second " + currentSecond);
+        double currentSecond = 0.0;
 
-        AnimatorFrame model = keyframe.getModel();
-        Command animationPropertyChange = new TimelineFrameEditCommand(model, currentSecond);
+        if (isInline == true) {
+            currentSecond =
+                    (double) (keyframe.getAfterPoint()
+                            - keyframe.getKeyFrameUnit().getKeyframeUnit().x + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH)
+                            / (timelineScalePoint);
+            // System.out.println("current Second " + currentSecond);
 
-        TimelineViewer viewer = getEditpart().getViewer();
-        viewer.getEditDomain().getCommandStack().execute(animationPropertyChange);
+            AnimatorFrame model = keyframe.getModel();
+            Command animationPropertyChange = new TimelineFrameEditCommand(model, currentSecond);
+
+            TimelineViewer viewer = getEditpart().getViewer();
+            viewer.getEditDomain().getCommandStack().execute(animationPropertyChange);
+        } else {
+            int type = keyframe.getKeyFrameType();
+            if (type == KeyFrame.START_FRAME) {
+                int afterPointTime = keyframe.getAfterPoint() * TimelineConstants.DEFAULT_TIME_INTERVAL;
+                int visibleTime = (int) (getVisibleStartTime() * scale);
+                int currentSecondTime = (afterPointTime + visibleTime) / TimelineConstants.DEFAULT_TIME_INTERVAL;
+                currentSecond = (double) (currentSecondTime / timelineScalePoint);
+            } else {
+                currentSecond =
+                        (double) (keyframe.getAfterPoint() - keyframe.getKeyFrameUnit()
+                                .getKeyframeUnit().x) / (timelineScalePoint);
+            }
+
+            AnimatorFrame model = keyframe.getModel();
+            Command animationPropertyChange = new TimelineFrameEditCommand(model, currentSecond);
+
+            TimelineViewer viewer = getEditpart().getViewer();
+            viewer.getEditDomain().getCommandStack().execute(animationPropertyChange);
+        }
     }
 
     /**
@@ -666,8 +696,7 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
      */
     public int getPointToTime(int point) {
         double scale = getScale();
-        return (int) (((point / scale) + (visibleStartTime / TimelineConstants.DEFAULT_TIME_INTERVAL)));// /
-                                                                   // TimelineConstants.DEFAULT_TIME_MILLISECOND;
+        return (int) (((point * TimelineConstants.DEFAULT_TIME_INTERVAL / scale) + (visibleStartTime)));
     }
 
     /**
@@ -706,20 +735,24 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
      * @param keyframe
      *            {@link KeyFrame}
      */
-    public void updateModel(KeyFrame keyframe) {
+    public void updateKeyFrameModel(KeyFrame keyframe) {
         boolean isUpdate = false;
         isUpdate = isChnagedKeyFrameModel(keyframe);
         if (isUpdate == true) {
             int keyFrameType = selectedKeyFrame.getKeyFrameType();
             switch (keyFrameType) {
                 case KeyFrame.COMMON_FRAME: {
-                    updateKeyFrameModel(selectedKeyFrame);
+                    updateKeyFrameModel(selectedKeyFrame, true);
                 }
                     break;
                 case KeyFrame.START_FRAME:
                 case KeyFrame.END_FRAME: {
-                    KeyFrameUnit keyframeUnit = selectedKeyFrame.getKeyFrameUnit();
-                    updateKeyFrameUnitModel(keyframeUnit);
+                    if (isSelectedControl == true) {
+                        KeyFrameUnit keyframeUnit = selectedKeyFrame.getKeyFrameUnit();
+                        updateKeyFrameUnitModel(keyframeUnit);
+                    } else {
+                        updateKeyFrameModel(selectedKeyFrame, false);
+                    }
                 }
                     break;
                 default:
@@ -747,9 +780,16 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                 setBackground(ColorResource.CHILD_TREEITEM);
             }
 
-            e.gc.drawRectangle(timeElementClientArea.x, timeElementClientArea.y,
-                               timeElementClientArea.width - 1, timeElementClientArea.height - 1);
-
+/*            e.gc.drawRectangle(timeElementClientArea.x, timeElementClientArea.y,
+                               timeElementClientArea.width -1, timeElementClientArea.height );*/
+            
+            e.gc.drawLine(timeElementClientArea.x, timeElementClientArea.height-1,
+                          timeElementClientArea.width*2, timeElementClientArea.height );
+            e.gc.drawLine(timeElementClientArea.x , timeElementClientArea.y , timeElementClientArea.x,
+                          timeElementClientArea.height -1);
+            e.gc.drawLine(timeElementClientArea.width -1 , timeElementClientArea.y , timeElementClientArea.width ,
+                          timeElementClientArea.height *2);
+            
             e.gc.setForeground(ColorResource.LATTICE);
 
             refreshVisibleTime();
@@ -780,278 +820,338 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
 
         @Override
         public void handleEvent(Event event) {
-
-            // Mouse Down
             if (event.type == SWT.MouseDown) {
+                // Mouse Down
                 boolean isLock = getEditpart().isLock();
                 if (isLock == true) {
                     return;
                 }
-
-                KeyFrameComponent keyframeComponent = findKeyFrameComponent(event.x, event.y);
-                if (keyframeComponent != null) {
-                    if (keyframeComponent instanceof KeyFrameUnit) {
-                        isKeyFrameUnitMouseDown = true;
-                        selectedKeyFrameUnit = (KeyFrameUnit) keyframeComponent;
-                    } else if (keyframeComponent instanceof KeyFrame) {
-                        isKeyFrameMouseDown = true;
-                        selectedKeyFrame = (KeyFrame) keyframeComponent;
-                    }
-                }
-
                 mouseDownPoint = event.x;
                 beforeMouseDownPoint = event.x;
-                if (isKeyFrameMouseDown == true || isKeyFrameUnitMouseDown == true) {
+                selectKeyFrameComponent(event.x, event.y);
 
-                    if (isKeyFrameMouseDown == true) {
-                        int currentPoint = (int) (selectedKeyFrame.getKeyframe().x);
+            } else if (event.type == SWT.MouseUp) {
+                // Mouse Up
+                updateModel();
+                refreshValue();
 
-                        selectedKeyFrame.setBeforePoint(currentPoint);
-                        selectedKeyFrame.setAfterPoint(currentPoint);
-                        extendsPoint = mouseDownPoint - selectedKeyFrame.getKeyframe().x;
-                        moveCurrentTimeMarker(true);
+            } else if (event.type == SWT.MouseMove) {
+                // Mouse Move
+                if (isKeyFrameMouseDown == true || isKeyFrameUnitMouseDown == true) {
+                    if (isKeyFrameMouseDown == true) {
+                        moveKeyFrame(event.x);
                     } else {
-                        extendsPoint = mouseDownPoint - selectedKeyFrameUnit.getKeyframeUnit().x;
-                        moveCurrentTimeMarker(false);
+                        moveKeyFrameUnit(event.x);
                     }
+                    refreshScroll();
                 } else {
-                    moveCurrentTimeMarker(false);
+                    // do nothing
                 }
 
-                // Mouse Up
-            } else if (event.type == SWT.MouseUp) {
-
-                if (selectedKeyFrame != null) {
-                    KeyFrameUnit keyframeUnit = selectedKeyFrame.getKeyFrameUnit();
-                    double exPoint = getPointToTime(keyframeUnit.getKeyframeUnit().x);
-                    if (exPoint < 0) {
-                        keyframeUnit.getKeyframeUnit().x = DEFAULT_KEYFRAME_MARGINE;
-                        int beforekeyframeEndPoint =
-                                keyframeUnit.getKeyFrameUnitModelXpoint()
-                                        + keyframeUnit.getKeyFrameUnitModelWidth();
-                        // - getVisibleStartTimePoint();
-                        keyframeUnit.refresh(keyframeUnit.getKeyframeUnit().x,
-                                             beforekeyframeEndPoint);
-                        redraw();
-                    }
+            } else if (event.type == SWT.MouseDoubleClick) {
+                // Mouse DoubleClick
+                if (isKeyFrameMouseDown == true) {
+                    moveCurrentTimeMarker(true);
+                }
+            }
+        }
 
-                    updateModel(selectedKeyFrame);
+        private void refreshScroll() {
+            // refresh scroll
+            Rectangle parent = getBounds();
+            int currentTime = getPointToTime(mouseDownPoint);
+            if ((parent.width - TimelineConstants.DEFAULT_TIME_INTERVAL < mouseDownPoint)
+                    && (beforeMouseDownPoint < mouseDownPoint)) {
+                TimelineContentContainer container = findTimelineContentContainer();
+                container.refreshHScroll(currentTime, 1, 1, 1);
+            } else if ((TimelineConstants.DEFAULT_TIME_INTERVAL > mouseDownPoint)
+                    && (beforeMouseDownPoint > mouseDownPoint)) {
+                TimelineContentContainer container = findTimelineContentContainer();
+                container.refreshHScroll(currentTime, 0, -1, 1);
+            }
+            beforeMouseDownPoint = mouseDownPoint;
+        }
 
-                } else if (selectedKeyFrameUnit != null) {
-                    double exPoint = getPointToTime(selectedKeyFrameUnit.getKeyframeUnit().x);
-                    if (exPoint < 0) {
-                        selectedKeyFrameUnit.getKeyframeUnit().x = DEFAULT_KEYFRAME_MARGINE;
+        private void moveKeyFrameUnit(int xPoint) {
+            setMouseMoveReleasePoint(selectedKeyFrameUnit.getKeyframeUnit().x, xPoint);
+            int keyFrameUnitReleasePoint =
+                    (selectedKeyFrameUnit.getKeyframeUnit().x - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH)
+                            - (mouseDownPoint - xPoint);
 
-                    }
-                    if (mouseMoveReleasePoint != 0
-                            && selectedKeyFrameUnit.getKeyFrameUnitModelXpoint() != mouseMoveReleasePoint) {
-                        // System.out.println("mouseMoveReleasePoint " + mouseMoveReleasePoint);
-                        updateKeyFrameUnitModel(selectedKeyFrameUnit);
-                    }
-                } else {
-                    // do nothing
-                }
+            if (keyFrameUnitReleasePoint + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN < 0
+                    && getVisibleStartTime() == 0) {
+                selectedKeyFrameUnit.getKeyframeUnit().x =
+                        TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
 
                 isKeyFrameMouseDown = false;
                 isKeyFrameUnitMouseDown = false;
-                mouseDownPoint = 0;
-                extendsPoint = 0;
-                mouseMoveReleasePoint = 0;
-                beforeMouseDownPoint = 0;
-                selectedKeyFrameUnit = null;
-                selectedKeyFrame = null;
-
-                // Mouse Move
-            } else if (event.type == SWT.MouseMove) {
-                if (isKeyFrameMouseDown == true || isKeyFrameUnitMouseDown == true) {
-                    if (isKeyFrameMouseDown == true) {
-                        KeyFrameUnit parentUnit = selectedKeyFrame.getKeyFrameUnit();
-                        Rectangle parentArea = parentUnit.getKeyframeUnit();
-                        Rectangle currentArea = selectedKeyFrame.getKeyframe();
-
-                        // Just one Keyframe
-                        if (parentUnit.getModel().getChildrenSize() == 1) {
-                            double exPoint = getPointToTime(parentArea.x);
-                            if (exPoint < 0.0 && getVisibleStartTime() == 0) {
-                                parentArea.x = DEFAULT_KEYFRAME_MARGINE;
-
-                                selectedKeyFrame
-                                        .setAfterPoint(TimelineConstants.DEFAULT_TIMELINE_TIMEBAR_0);
-
-                                isKeyFrameMouseDown = false;
-                                isKeyFrameUnitMouseDown = false;
-                                redraw();
-                                updateModel(selectedKeyFrame);
-                                return;
-                            }
-
-                            mouseMoveReleasePoint = parentArea.x - (mouseDownPoint - event.x);
-                            selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
-                            parentUnit.refresh(mouseMoveReleasePoint, 0);
-                            redraw();
-                            // System.out.println("===========================================");
-
-                            mouseDownPoint = currentArea.x + extendsPoint;
-                        } else {
-
-                            int KeyFrameType = selectedKeyFrame.getKeyFrameType();
-                            switch (KeyFrameType) {
-                                case KeyFrame.START_FRAME: {
-                                    double exPoint = getPointToTime(parentArea.x);
-
-                                    mouseMoveReleasePoint =
-                                            parentArea.x - (mouseDownPoint - event.x);
-                                    selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
-
-                                    int beforekeyframeEndPoint =
-                                            parentUnit.getKeyFrameUnitModelXpoint()
-                                                    + parentUnit.getKeyFrameUnitModelWidth()
-                                                    - getVisibleStartTimePoint();
-                                    int afterkeyframeWidth =
-                                            beforekeyframeEndPoint - mouseMoveReleasePoint;
+                updateKeyFrameUnitModel(selectedKeyFrameUnit);
+                redraw();
+                return;
+            }
 
-                                    if (parentArea.width < TimelineConstants.DEFAULT_LIFE_WIDGET_MIN_WIDTH) {
-                                        parentArea.width =
-                                                TimelineConstants.DEFAULT_LIFE_WIDGET_MIN_WIDTH;
+            int afterSize = selectedKeyFrameUnit.getKeyframeUnit().width;
+            selectedKeyFrameUnit.refresh(mouseMoveReleasePoint, afterSize);
 
-                                        parentUnit.refresh(parentArea.x, parentArea.width);
+            redraw();
+            mouseDownPoint = selectedKeyFrameUnit.getKeyframeUnit().x + extendsPoint;
+        }
 
-                                        redraw();
-                                        isKeyFrameMouseDown = false;
-                                        isKeyFrameUnitMouseDown = false;
-                                        return;
-                                    } else if (exPoint < 0.0) {
-                                        parentArea.x = DEFAULT_KEYFRAME_MARGINE;
+        private void moveKeyFrame(int xPoint) {
+            KeyFrameUnit parentUnit = selectedKeyFrame.getKeyFrameUnit();
+            Rectangle parentArea = parentUnit.getKeyframeUnit();
+            Rectangle currentArea = selectedKeyFrame.getKeyframe();
 
-                                        selectedKeyFrame
-                                                .setAfterPoint(TimelineConstants.DEFAULT_START_KEYFRAME_POINT);
+            // Just one Keyframe
+            if (parentUnit.getModel().getChildrenSize() == 1) {
+                setMouseMoveReleasePoint(currentArea.x, xPoint);
 
-                                        afterkeyframeWidth =
-                                                beforekeyframeEndPoint - DEFAULT_KEYFRAME_MARGINE;
-                                        parentUnit.refresh(parentArea.x, afterkeyframeWidth);
+                if (mouseMoveReleasePoint + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN < 0
+                        && getVisibleStartTime() == 0) {
+                    parentArea.x = TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+                    refreshSingleKeyFramePolicy();
+                    return;
+                }
 
-                                        if (getVisibleStartTime() == 0) {
-                                            isKeyFrameMouseDown = false;
-                                            isKeyFrameUnitMouseDown = false;
-                                            updateModel(selectedKeyFrame);
-                                        }
+                selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
+                parentUnit.refresh(mouseMoveReleasePoint
+                        + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH, 0);
 
-                                        redraw();
+                redraw();
+                mouseDownPoint = currentArea.x + extendsPoint;
+            } else {
 
-                                        return;
-                                    }
+                int KeyFrameType = selectedKeyFrame.getKeyFrameType();
+                switch (KeyFrameType) {
+                    case KeyFrame.START_FRAME: {
+                        setMouseMoveReleasePoint(currentArea.x, xPoint);
+                        
+                        int beforekeyframeEndPoint =
+                                parentUnit.getKeyFrameUnitModelXpoint()
+                                        + parentUnit.getKeyFrameUnitModelWidth()
+                                        - getVisibleStartTimePoint();
+
+                        if (mouseMoveReleasePoint + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN < 0
+                                && getVisibleStartTime() == 0) {
+                            parentArea.x = TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+                            refreshKeyFrameUnitPolicy(parentUnit, beforekeyframeEndPoint);
+                            return;
+                        }
 
-                                    parentUnit.refresh(mouseMoveReleasePoint, afterkeyframeWidth);
-                                    redraw();
-                                }
+                        selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint+ TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
+                        int afterkeyframeWidth = beforekeyframeEndPoint - mouseMoveReleasePoint;
 
-                                    break;
-                                case KeyFrame.END_FRAME: {
-                                    if (parentArea.width < TimelineConstants.DEFAULT_LIFE_WIDGET_MIN_WIDTH) {
-                                        parentArea.width =
-                                                TimelineConstants.DEFAULT_LIFE_WIDGET_MIN_WIDTH;
-
-                                        currentArea.x =
-                                                parentArea.x
-                                                        + parentArea.width
-                                                        - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
-                                        parentUnit.refresh(currentArea.x, parentArea.width);
-                                        redraw();
-                                        isKeyFrameMouseDown = false;
-                                        isKeyFrameUnitMouseDown = false;
-                                        return;
-                                    }
-
-                                    selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
-
-                                    int keyframeXpoint =
-                                            parentUnit.getKeyFrameUnitModelXpoint()
-                                                    - getVisibleStartTimePoint();
-                                    int afterSize = parentArea.width + (event.x - mouseDownPoint);
-
-                                    parentUnit.refresh(keyframeXpoint, afterSize);
-                                    redraw();
-                                }
-                                    break;
-                                case KeyFrame.COMMON_FRAME: {
-                                    int startPoint =
-                                            parentArea.x
-                                                    - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
-                                    int endPoint =
-                                            parentArea.x
-                                                    + parentArea.width
+                        if (isSelectedControl == true) {
+                            if (afterkeyframeWidth <= TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH) {
+                                mouseMoveReleasePoint =
+                                        selectedKeyFrameUnit.getLastKeyFrameTime()
+                                                - (TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
+                                selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
+                                afterkeyframeWidth = TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH;
+                            }
+                            parentUnit.refresh(mouseMoveReleasePoint, afterkeyframeWidth);
+                        } else {
+                            Rectangle nextKeyFrameBounds =
+                                    selectedKeyFrameUnit.findNextKeyFrameBounds();
+                            if (nextKeyFrameBounds != null) {
+                                if (mouseMoveReleasePoint > (nextKeyFrameBounds.x - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH)) {
+                                    mouseMoveReleasePoint =
+                                            nextKeyFrameBounds.x
                                                     - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
-                                    int currentPoint = currentArea.x;
-                                    /*
-                                     * System.out.println("startPoint " + startPoint + " current " +
-                                     * currentArea.x);
-                                     */
-                                    if (startPoint > currentPoint) {
-                                        mouseMoveReleasePoint = startPoint + 2;
-                                        isKeyFrameMouseDown = false;
-                                        isKeyFrameUnitMouseDown = false;
-                                    } else if (endPoint < currentPoint) {
-                                        mouseMoveReleasePoint = endPoint - 2;
-                                        isKeyFrameMouseDown = false;
-                                        isKeyFrameUnitMouseDown = false;
-                                    } else {
-                                        mouseMoveReleasePoint =
-                                                (currentArea.x - (mouseDownPoint - event.x));
-                                    }
-
-                                    selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
-                                    selectedKeyFrame.refresh(mouseMoveReleasePoint);
-                                    redraw();
+                                    selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint
+                                            + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
+                                    afterkeyframeWidth =
+                                            beforekeyframeEndPoint - mouseMoveReleasePoint;
                                 }
-                                    break;
-                                default:
-                                    break;
                             }
-                            mouseDownPoint = currentArea.x + extendsPoint;
-
+                            selectedKeyFrameUnit.getKeyframeUnit().x =
+                                    mouseMoveReleasePoint
+                                            + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                            selectedKeyFrameUnit.getKeyframeUnit().width =
+                                    afterkeyframeWidth
+                                            - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                            selectedKeyFrame.getKeyframe().x = mouseMoveReleasePoint;
+                            selectedKeyFrameUnit.refreshFrame(true);
                         }
-                    } else {
-                        double exPoint = getPointToTime(selectedKeyFrameUnit.getKeyframeUnit().x);
-                        if (exPoint < 0.0 && getVisibleStartTime() == 0) {
-                            selectedKeyFrameUnit.getKeyframeUnit().x = DEFAULT_KEYFRAME_MARGINE;
-
+                        redraw();
+                    }
+                        break;
+                    case KeyFrame.END_FRAME: {
+                        setMouseMoveReleasePoint(currentArea.x, xPoint);
+                        selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint
+                                + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH);
+
+                        int keyframeXpoint =
+                                parentUnit.getKeyFrameUnitModelXpoint()
+                                        - getVisibleStartTimePoint();
+
+                        int afterkeyframeWidth =
+                                mouseMoveReleasePoint - keyframeXpoint
+                                        + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+
+                        if (isSelectedControl == true) {
+                            if (afterkeyframeWidth <= TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH) {
+                                mouseMoveReleasePoint =
+                                        (int) (selectedKeyFrameUnit.getKeyFrameUnitModelXpoint() + TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH);
+                                selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
+                                afterkeyframeWidth = TimelineConstants.DEFAULT_FRAME_WIDGET_WIDTH;
+                            }
+                            parentUnit.refresh(keyframeXpoint, afterkeyframeWidth);
+                        } else {
+                            Rectangle beforeKeyFrameBounds =
+                                    selectedKeyFrameUnit.findBeforeKeyFrameBounds();
+                            if (beforeKeyFrameBounds != null) {
+                                if (mouseMoveReleasePoint < (beforeKeyFrameBounds.x + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH)) {
+                                    mouseMoveReleasePoint =
+                                            beforeKeyFrameBounds.x
+                                                    + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                                    selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint
+                                            + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH);
+                                    afterkeyframeWidth =
+                                            mouseMoveReleasePoint
+                                                    - keyframeXpoint
+                                                    + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                                }
+                            }
+                            selectedKeyFrameUnit.getKeyframeUnit().x = keyframeXpoint;
+                            selectedKeyFrameUnit.getKeyframeUnit().width = afterkeyframeWidth;
+                            selectedKeyFrame.getKeyframe().x = mouseMoveReleasePoint;
+                            selectedKeyFrameUnit.refreshFrame(false);
+                        }
+                        redraw();
+                    }
+                        break;
+                    case KeyFrame.COMMON_FRAME: {
+                        int startPoint =
+                                parentArea.x - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                        int endPoint =
+                                parentArea.x + parentArea.width
+                                        - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                        int currentPoint = currentArea.x;
+
+                        if (startPoint > currentPoint) {
+                            mouseMoveReleasePoint =
+                                    startPoint + TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
                             isKeyFrameMouseDown = false;
                             isKeyFrameUnitMouseDown = false;
-                            updateKeyFrameUnitModel(selectedKeyFrameUnit);
-
-                            redraw();
-                            return;
+                        } else if (endPoint < currentPoint) {
+                            mouseMoveReleasePoint =
+                                    endPoint - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH;
+                            isKeyFrameMouseDown = false;
+                            isKeyFrameUnitMouseDown = false;
+                        } else {
+                            setMouseMoveReleasePoint(currentArea.x, xPoint);
                         }
 
-                        mouseMoveReleasePoint =
-                                selectedKeyFrameUnit.getKeyframeUnit().x
-                                        - (mouseDownPoint - event.x);
-                        int afterSize = selectedKeyFrameUnit.getKeyframeUnit().width;
-                        selectedKeyFrameUnit.refresh(mouseMoveReleasePoint, afterSize);
+                        selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint);
+                        selectedKeyFrame.refresh(mouseMoveReleasePoint);
                         redraw();
-
-                        mouseDownPoint = selectedKeyFrameUnit.getKeyframeUnit().x + extendsPoint;
                     }
+                        break;
+                    default:
+                        break;
+                }
+                mouseDownPoint = currentArea.x + extendsPoint;
+            }
 
-                    // refresh scroll
-                    Rectangle parent = getBounds();
-                    int currentTime = getPointToTime(mouseDownPoint);
-                    if ((parent.width - 10 < mouseDownPoint)
-                            && (beforeMouseDownPoint < mouseDownPoint)) {
-                        TimelineContentContainer container = findTimelineContentContainer();
-                        container.refreshHScroll(currentTime, 1, 1, 1);
-                    } else if ((10 > mouseDownPoint) && (beforeMouseDownPoint > mouseDownPoint)) {
-                        TimelineContentContainer container = findTimelineContentContainer();
-                        container.refreshHScroll(currentTime, 0, -1, 1);
-                    }
-                    beforeMouseDownPoint = mouseDownPoint;
+        }
+
+        private void refreshKeyFrameUnitPolicy(KeyFrameUnit parentUnit, int beforekeyframeEndPoint) {
+            selectedKeyFrame.setAfterPoint(0);
+
+            int afterkeyframeWidth =
+                    beforekeyframeEndPoint - TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+
+            if (isSelectedControl == true) {
+                parentUnit.refresh(TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN,
+                                   afterkeyframeWidth);
+            } else {
+                selectedKeyFrameUnit.getKeyframeUnit().x =
+                        TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+                selectedKeyFrameUnit.getKeyframeUnit().width = afterkeyframeWidth;
+                selectedKeyFrame.getKeyframe().x = -TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
+            }
+
+            isKeyFrameMouseDown = false;
+            isKeyFrameUnitMouseDown = false;
+            redraw();
+            updateKeyFrameModel(selectedKeyFrame);
+        }
+
+        private void refreshSingleKeyFramePolicy() {
+            selectedKeyFrame.setAfterPoint(TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
+
+            isKeyFrameMouseDown = false;
+            isKeyFrameUnitMouseDown = false;
+            redraw();
+            updateKeyFrameUnitModel(selectedKeyFrame.getKeyFrameUnit());
+        }
+
+        private void setMouseMoveReleasePoint(int currentAreaX, int xPoint) {
+            mouseMoveReleasePoint = currentAreaX - (mouseDownPoint - xPoint);
+        }
 
-                    // System.out.println("=================================");
+        private void refreshValue() {
+            if (selectedKeyFrame != null) {
+                selectedKeyFrame.setBeforePoint(0);
+                selectedKeyFrame.setAfterPoint(0);
+            }
+            isKeyFrameMouseDown = false;
+            isKeyFrameUnitMouseDown = false;
+            mouseDownPoint = 0;
+            extendsPoint = 0;
+            mouseMoveReleasePoint = 0;
+            beforeMouseDownPoint = 0;
+            selectedKeyFrameUnit = null;
+            selectedKeyFrame = null;
+            isSelectedControl = false;
+        }
+
+        private void updateModel() {
+            if (selectedKeyFrame != null) {
+                if (selectedKeyFrameUnit != null
+                        && selectedKeyFrameUnit.getKeyframelist().size() == 1) {
+                    updateKeyFrameUnitModel(selectedKeyFrameUnit);
+                } else {
+                    updateKeyFrameModel(selectedKeyFrame);
                 }
-            } else if (event.type == SWT.MouseDoubleClick) {
+            } else if (selectedKeyFrameUnit != null) {
+                if (mouseMoveReleasePoint != 0
+                        && selectedKeyFrameUnit.getKeyFrameUnitModelXpoint() != mouseMoveReleasePoint) {
+                    updateKeyFrameUnitModel(selectedKeyFrameUnit);
+                }
+            } else {
+                // do nothing
+            }
+        }
+
+        private void selectKeyFrameComponent(int xPoint, int yPoint) {
+            KeyFrameComponent keyframeComponent = findKeyFrameComponent(xPoint, yPoint);
+            if (keyframeComponent != null) {
+                if (keyframeComponent instanceof KeyFrameUnit) {
+                    isKeyFrameUnitMouseDown = true;
+                    selectedKeyFrameUnit = (KeyFrameUnit) keyframeComponent;
+                } else if (keyframeComponent instanceof KeyFrame) {
+                    isKeyFrameMouseDown = true;
+                    selectedKeyFrame = (KeyFrame) keyframeComponent;
+                    selectedKeyFrameUnit = selectedKeyFrame.getKeyFrameUnit();
+                }
+            }
+
+            if (isKeyFrameMouseDown == true || isKeyFrameUnitMouseDown == true) {
                 if (isKeyFrameMouseDown == true) {
-                    moveCurrentTimeMarker(true);
+                    int currentPoint = (int) (selectedKeyFrame.getKeyframe().x);
+                    selectedKeyFrame.setBeforePoint(currentPoint);
+                    selectedKeyFrame.setAfterPoint(currentPoint);
+                    extendsPoint = mouseDownPoint - selectedKeyFrame.getKeyframe().x;
+                    // moveCurrentTimeMarker(true);
+                } else {
+                    extendsPoint = mouseDownPoint - selectedKeyFrameUnit.getKeyframeUnit().x;
+                    // moveCurrentTimeMarker(false);
                 }
+                selectedKeyFrameUnit.createKeyFrameUnitControl();
+            } else {
+                // moveCurrentTimeMarker(false);
             }
         }
     };
index 1297255..9e80176 100644 (file)
@@ -27,8 +27,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.PaintEvent;
@@ -49,17 +47,13 @@ import org.tizen.webuibuilder.animator.gef.command.AnimationLockCommand;
 import org.tizen.webuibuilder.animator.gef.command.AnimationMakeInvisibleCommand;
 import org.tizen.webuibuilder.animator.model.AnimatorModel;
 import org.tizen.webuibuilder.animator.model.AnimatorModelEvent;
-import org.tizen.webuibuilder.animator.model.AnimatorModelListenerAdapter;
-import org.tizen.webuibuilder.animator.model.AnimatorProperty;
 import org.tizen.webuibuilder.animator.model.AnimatorSelector;
 import org.tizen.webuibuilder.animator.model.AnimatorWidget;
 import org.tizen.webuibuilder.animator.model.part.AnimatorPagePart;
-import org.tizen.webuibuilder.animator.model.part.AnimatorPart;
 import org.tizen.webuibuilder.animator.model.part.AnimatorWidgetPart;
 import org.tizen.webuibuilder.animator.ui.views.timeline.TimelineViewer;
 import org.tizen.webuibuilder.animator.ui.views.timeline.command.TimelineFrameCreateCommand;
 import org.tizen.webuibuilder.animator.ui.views.timeline.common.ColorResource;
-import org.tizen.webuibuilder.animator.ui.views.timeline.common.TimelineMessages;
 import org.tizen.webuibuilder.animator.ui.views.timeline.editpart.TimelineEditPart;
 import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
 import org.tizen.webuibuilder.model.Part;
@@ -98,8 +92,6 @@ public class TimelineOutlineElement extends Canvas {
     private int elementType = 0; // elementType 0 : AnimatorWidget,
                                  // elementType 1: AnimatorSelector
 
-    private AnimatorModelOutlineAdapter animatorModelOutlineAdapter = null;
-
     /**
      * Construct
      * 
@@ -137,13 +129,9 @@ public class TimelineOutlineElement extends Canvas {
         }
 
         createControls();
-
+        
         if (elementType == 0) {
             setBackground(ColorResource.PARENT_TREEITEM);
-            animatorModelOutlineAdapter = new AnimatorModelOutlineAdapter();
-
-            Part rootPart = editpart.getViewer().getPage().getRootPart();
-            ((AnimatorPart) rootPart).addAnimatorModelListener(animatorModelOutlineAdapter);
         } else {
             this.setBackground(ColorResource.CHILD_TREEITEM);
         }
@@ -155,15 +143,7 @@ public class TimelineOutlineElement extends Canvas {
         }
         addPaintListener(outlineElementPaintListener);
 
-        addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-
-                Part rootPart = getEditPart().getViewer().getPage().getRootPart();
-                ((AnimatorPart) rootPart).removeAnimatorModelListener(animatorModelOutlineAdapter);
-            }
-        });
-    }
+   }
 
     /**
      * Create Controls
@@ -208,36 +188,6 @@ public class TimelineOutlineElement extends Canvas {
         redraw();
     }
 
-    /*****************************************************************************
-     * AnimatorModelOutlineAdapter
-     *****************************************************************************/
-    private class AnimatorModelOutlineAdapter extends AnimatorModelListenerAdapter {
-        @Override
-        public void propertyChange(AnimatorModelEvent e) {
-
-            AnimatorProperty property = e.getAnimatorProperty();
-            AnimatorModel model = e.getModel();
-            Object currentmodel = getEditPart().getModel();
-
-            if (model.equals(currentmodel)) {
-                if (property != null) {
-                    String propertyName = property.getPropertyName();
-
-                    if (propertyName.equals(TimelineMessages.LOCK)) {
-                        isLockable = (Boolean) property.getPropertyValue();
-                        redraw();
-                        getEditPart().applyLock();
-                    } else if (propertyName.equals(TimelineMessages.VISIBLE)) {
-                        isVisibleElement = (Boolean) property.getPropertyValue();
-                        redraw();
-                    } else {
-                        // Logger.trace("other property");
-                    }
-                }
-            }
-        }
-    }
-
     /**********************************************************************************************
      * Class Method
      **********************************************************************************************/
@@ -577,8 +527,14 @@ public class TimelineOutlineElement extends Canvas {
 
             drawOutlineElement(e.gc, clientArea);
 
-            e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width - 1,
-                               clientArea.height - 1);
+            /*e.gc.drawRectangle(clientArea.x , clientArea.y, clientArea.width -1,
+                               clientArea.height );*/
+            e.gc.drawLine(clientArea.x , clientArea.height - 1 , clientArea.width*2,
+                               clientArea.height);
+            e.gc.drawLine(clientArea.x , clientArea.y , clientArea.x,
+                          clientArea.height -1);
+            e.gc.drawLine(clientArea.width -1 , clientArea.y , clientArea.width ,
+                          clientArea.height *2);
         }
 
         private void drawOutlineElement(GC gc, Rectangle clientArea) {
index 96f9364..acf36c0 100644 (file)
@@ -201,9 +201,16 @@ public class TimelineWidgetElement extends Canvas {
 
             }
             drawImageAndText(e.gc);
-            e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width - 1,
-                               clientArea.height - 1);
-        }
+            /*e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width -1,
+                               clientArea.height -1);*/
+            
+            e.gc.drawLine(clientArea.x , clientArea.height - 1 , clientArea.width*2,
+                        clientArea.height);
+            e.gc.drawLine(clientArea.x , clientArea.y , clientArea.x,
+                   clientArea.height -1);
+            e.gc.drawLine(clientArea.width -1 , clientArea.y , clientArea.width ,
+                   clientArea.height *2);
+            }
 
         private void drawImageAndText(GC gc) {
             int animationsMargine = 10;
index 959184a..a8d265e 100644 (file)
@@ -147,7 +147,7 @@ public class KeyFrame extends KeyFrameComponent {
      */
     public int getKeyFrameModelXpoint() {
         double scale = getKeyFrameUnit().getTimeTreeElement().getScale();
-        return (int) (getModel().getFrameTime() * scale * (double) TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL);
+        return (int) (getModel().getFrameTime() * scale * TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL);
     }
 
     /*******************************************************************************
index 12f5594..9136778 100644 (file)
@@ -31,6 +31,8 @@ public class KeyFrameUnit extends KeyFrameComponent {
     private AnimatorKeyframe keyframeModel = null;
     private List<KeyFrame> keyframelist = new ArrayList<KeyFrame>();
     private Rectangle keyframeUnit = null;
+    private Rectangle startKeyFrameUnitControl = null;
+    private Rectangle endKeyFrameUnitControl = null;
 
     private double keyframeUnitStartTime = 0.0;
     private double keyframeUnitDurationTime = 0.0;
@@ -76,7 +78,23 @@ public class KeyFrameUnit extends KeyFrameComponent {
             }
             getKeyframelist().add(keyframeWidget);
         }
+    }
 
+    /**
+     * Create KeyFrameUnitControl
+     */
+    public void createKeyFrameUnitControl() {
+        
+        int frameSize = keyframelist.size();
+        if(frameSize > 1){
+            int startPoint = keyframeUnit.x;
+            int endPoint = startPoint + keyframeUnit.width;
+            if(startKeyFrameUnitControl == null) 
+                startKeyFrameUnitControl = new Rectangle(startPoint - 3, 0, 5, 5);
+            if(endKeyFrameUnitControl == null)
+                endKeyFrameUnitControl = new Rectangle(endPoint - 3, 0, 5, 5);
+            
+        }
     }
 
     /**
@@ -141,18 +159,41 @@ public class KeyFrameUnit extends KeyFrameComponent {
             } else if (component != null && component.equals(this)) {
                 // selected
                 gc.setForeground(ColorResource.BLACK);
+                refreshKeyFrameUnitControl(gc);
             } else {
                 // none selected
+                gc.setForeground(ColorResource.BLACK);
+                if(component instanceof KeyFrame) {
+                    KeyFrameUnit keyFrameUnit = ((KeyFrame) component).getKeyFrameUnit();
+                    if(this.equals(keyFrameUnit)) {
+                        refreshKeyFrameUnitControl(gc);
+                    }
+                } else {
+                    startKeyFrameUnitControl = null;
+                    endKeyFrameUnitControl = null;
+                }
                 gc.setForeground(ColorResource.LIFE_WIDGET_BORDER);
             }
-
             gc.drawRectangle(getKeyframeUnit());
+            
         }
 
         for (KeyFrame child : getKeyframelist()) {
             child.redraw(gc);
         }
     }
+    
+    private void refreshKeyFrameUnitControl(GC gc) {
+        if(startKeyFrameUnitControl != null) {
+            startKeyFrameUnitControl.x = keyframeUnit.x - 4; 
+            gc.drawRectangle(startKeyFrameUnitControl);
+        }
+            
+        if(endKeyFrameUnitControl != null) {
+            endKeyFrameUnitControl.x = keyframeUnit.x + keyframeUnit.width - 2;
+            gc.drawRectangle(endKeyFrameUnitControl);
+        }
+    }
 
     /**
      * Refresh
@@ -180,6 +221,36 @@ public class KeyFrameUnit extends KeyFrameComponent {
         }
 
     }
+    
+    /**
+     * Refresh
+     * 
+     * @param startPoint
+     * @param width
+     */
+    public void refreshFrame(boolean isStart) {
+        int size = keyframelist.size();
+        //Rectangle firstTime = keyframelist.get(0).getKeyframe();
+        if(isStart == true) {
+            for (int i = 1; i < size  ; ++i ) {
+                KeyFrame keyFrame = keyframelist.get(i);
+
+                keyFrame.getKeyframe().x =
+                        getKeyFrameUnitModelXpoint() + keyFrame.getKeyFrameModelXpoint()
+                                - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH
+                                - timeTreeElement.getVisibleStartTimePoint();
+            }
+        } else {
+            for (int i = 0; i < size - 1 ; ++i ) {
+                KeyFrame keyFrame = keyframelist.get(i);
+                keyFrame.getKeyframe().x =
+                        getKeyFrameUnitModelXpoint() + keyFrame.getKeyFrameModelXpoint()
+                                - TimelineConstants.DEFAULT_FRAME_WIDGET_HALF_WIDTH
+                                - timeTreeElement.getVisibleStartTimePoint();
+            }
+        }
+        
+    }
 
     /**
      * Check Child KeyFrame
@@ -273,7 +344,7 @@ public class KeyFrameUnit extends KeyFrameComponent {
      */
     public int getKeyFrameUnitModelXpoint() {
         double scale = getTimeTreeElement().getScale();
-        return (int) (getModel().getDelay() * scale * (double) TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL)
+        return (int) (getModel().getDelay() * scale * TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL)
                 + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN;
     }
 
@@ -284,7 +355,7 @@ public class KeyFrameUnit extends KeyFrameComponent {
      */
     public int getKeyFrameUnitModelWidth() {
         double scale = getTimeTreeElement().getScale();
-        return (int) (getModel().getDuration() * scale * (double) TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL);
+        return (int) (getModel().getDuration() * scale * TimelineConstants.DEFAULT_TIME_POSITION_INTERVAL);
     }
 
     /**
@@ -302,6 +373,58 @@ public class KeyFrameUnit extends KeyFrameComponent {
         timeTreeElement.getKeyframeUnits().add(this);
     }
 
+    /**
+     * Get Last KeyFrameTime
+     */
+    public int getLastKeyFrameTime() {
+        int size = keyframelist.size();
+        int fullTime = (int) (getModel().getDelay() * 100 + getModel().getDuration() * 100);
+        return fullTime;
+    }
+
+    /**
+     * Find Next KeyFrame bounds
+     */
+    public Rectangle findNextKeyFrameBounds() {
+        KeyFrame findKeyFrame = null;
+        int size = keyframeModel.getChildrenSize();
+        if(size > 1) {
+            AnimatorFrame keyFrame = (AnimatorFrame) keyframeModel.getChild(1);
+            findKeyFrame = findCurrentKeyFrame(keyFrame);
+            return findKeyFrame.getKeyframe();
+        }
+        return null;
+    }
+
+    /**
+     * Find Before KeyFrame bounds
+     */
+    public Rectangle findBeforeKeyFrameBounds() {
+        KeyFrame findKeyFrame = null;
+        int size = keyframeModel.getChildrenSize();
+        if(size > 1) {
+            AnimatorFrame keyFrame = (AnimatorFrame) keyframeModel.getChild(size -2);
+            findKeyFrame = findCurrentKeyFrame(keyFrame);
+            return findKeyFrame.getKeyframe();
+        }
+        
+        return null;
+    }
+
+    /**
+     * Find Current KeyFrame bounds
+     */
+    public KeyFrame findCurrentKeyFrame(AnimatorFrame keyFrame) {
+        KeyFrame findKeyFrame = null;
+        for(KeyFrame currentkeyFrame : keyframelist) {
+            if(currentkeyFrame.getModel().equals(keyFrame)) {
+                findKeyFrame = currentkeyFrame;
+                break;
+            }
+        }
+        return findKeyFrame;
+    }
+
     /*******************************************************************************
      * Getter, Setter
      *******************************************************************************/
@@ -423,4 +546,20 @@ public class KeyFrameUnit extends KeyFrameComponent {
     public void setTimeTreeElement(TimeTreeElement timeTreeElement) {
         this.timeTreeElement = timeTreeElement;
     }
+
+    public Rectangle getStartKeyFrameUnitControl() {
+        return startKeyFrameUnitControl;
+    }
+
+    public void setStartKeyFrameUnitControl(Rectangle startKeyFrameUnitControl) {
+        this.startKeyFrameUnitControl = startKeyFrameUnitControl;
+    }
+
+    public Rectangle getEndKeyFrameUnitControl() {
+        return endKeyFrameUnitControl;
+    }
+
+    public void setEndKeyFrameUnitControl(Rectangle endKeyFrameUnitControl) {
+        this.endKeyFrameUnitControl = endKeyFrameUnitControl;
+    }
 }
index 0a14baf..a1b7932 100644 (file)
@@ -40,23 +40,28 @@ abstract public class ChangeCssSelectorCommand extends Command {
     private Part model;
     private String selectorName;
     private PageData pageData;
-    private CssFile appliedCssFile;
+    private CssFile cssFile;
     private CssSelector newSelector = null;
 
     public ChangeCssSelectorCommand(Object model, PageData pageData, String selectorName) {
-        setModel(model);
+        this.model = (Part) model;
         this.pageData = pageData;
         this.selectorName = selectorName;
     }
-
-    public void setModel(Object model) {
-        this.model = (Part) model;
-    }
-
     abstract public void execute2();
-
     abstract public void undo2();
-
+    
+    
+    @Override
+    public boolean canExecute() {
+        if (pageData == null || model == null || selectorName == null || selectorName.isEmpty()) {
+            return false;
+        } else {
+            cssFile = pageData.getCurrentCssFile();
+            return true;
+        }
+    }
+    
     /**
      * Do not override this method. You must override execute2().
      */
@@ -69,37 +74,10 @@ abstract public class ChangeCssSelectorCommand extends Command {
             // create selector
             selector = new CssSelector(selectorName);
             selectorMap.put(selectorName, selector);
-            appliedCssFile = pageData.getCurrentCssFile();
-            appliedCssFile.addCssSelector(selector);
+            cssFile.addCssSelector(selector);
             newSelector = selector;
-
         }
-
-        // Setting all selector of Part
-        // List<CssFile> appliedCssFileList = pageData.getAppliedCssFiles();
-        // int index = appliedCssFileList.indexOf(appliedCssFile);
-        // int size = appliedCssFileList.size();
-        // Map<String, CssSelector> allMap = model.getAllSelectorMap();
-        // boolean skip = false;
-        // CssSelector cloneSelector = selector.cloneCssSelector(selectorName);
-        // if (size - 1 == index) {
-        // allMap.put(selectorName, cloneSelector);
-        // } else {
-        // for (int i = index + 1; i <= size - 1; i++) {
-        // CssSelector targetSelector = allMap.get(selectorName);
-        // if (targetSelector != null) {
-        // for (CssStyle style : selector.getStyles()) {
-        // targetSelector.getStyleMap().put(style.getKey(), style);
-        // }
-        // skip = true;
-        // break;
-        // }
-        // }
-        // if (!skip) {
-        // allMap.put(selectorName, cloneSelector);
-        // }
-        // }
-
+        
         execute2();
 
         if (NScreenUtil.isLogEnabled()) {
@@ -116,7 +94,7 @@ abstract public class ChangeCssSelectorCommand extends Command {
         if (newSelector != null) {
             model.getEditSelectorMap().remove(newSelector);
             model.getAllSelectorMap().remove(newSelector);
-            appliedCssFile.removeCssSelector(newSelector);
+            cssFile.removeCssSelector(newSelector);
         }
     }
 
index a9635af..58199ac 100644 (file)
@@ -30,52 +30,45 @@ import org.tizen.webuibuilder.model.css.CssSelector;
 import org.tizen.webuibuilder.model.page.PageData;
 
 
-public class CreateCssSelectorCommand extends ChangeCssSelectorCommand {
+public class CreateCssSelectorCommand extends Command {
 
-    public CreateCssSelectorCommand(PageData pageData, Part model, String selectorName) {
-        super(model, pageData, selectorName);
+    private Part model;
+    private String selectorName;
+    private PageData pageData;
+    private CssSelector selector;
+    private CssFile cssFile;
+    
+    public CreateCssSelectorCommand(Part model, PageData pageData, String selectorName) {
+        this.pageData = pageData;
+        this.model = model;
+        this.selectorName = selectorName;
     }
 
     @Override
     public boolean canExecute() {
-        Part model = getModel();
-        if (getSelectorName() != null && !getSelectorName().isEmpty() && model != null) {
-            return true;
+        if (selectorName != null && !selectorName.isEmpty() && model != null) {
+            if (model.getSelector(selectorName) == null) {
+                cssFile = pageData.getCurrentCssFile();
+                return true;
+            } else {
+                return false;
+            }
         } else {
             return false;
         }
     }
 
-//    @Override
-//    public void execute() {
-//        if (selector == null) {
-//            selector = new CssSelector(selectorName);
-//        }
-//
-//        cssFile.addCssSelector(selector);
-//        part.addSelector(selector.getSelectorName(), selector);
-//    }
-//
-//    @Override
-//    public void undo() {
-//        cssFile.removeCssSelector(selector);
-//        part.removeSelector(selector.getSelectorName());
-//    }
-
     @Override
-    public void execute2() {
-        String selectorName = getSelectorName();
-        CssSelector selector = new CssSelector(selectorName);
-        Part model = getModel();
+    public void execute() {
+        selector = new CssSelector(selectorName);
         model.addSelector(selectorName, selector);
+        cssFile.addCssSelector(selector);
     }
 
     @Override
-    public void undo2() {
-        // TODO Auto-generated method stub
-        String selectorName = getSelectorName();
-        Part model = getModel();
+    public void undo() {
         model.removeSelector(selectorName);
+        cssFile.removeCssSelector(selector);
     }
 
 }
diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ReloadCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/gef/commands/ReloadCommand.java
new file mode 100644 (file)
index 0000000..56d7f62
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * UI Builder
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.webuibuilder.gef.commands;
+
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.commands.Command;
+import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.model.Part;
+import org.tizen.webuibuilder.model.app.AppManager;
+import org.tizen.webuibuilder.model.app.AppManagerForHTML;
+import org.tizen.webuibuilder.model.filedata.PageFileData;
+import org.tizen.webuibuilder.model.html.io.HtmlReader;
+import org.tizen.webuibuilder.model.page.PageData;
+import org.tizen.webuibuilder.model.page.PageDataForHTML;
+import org.tizen.webuibuilder.model.page.PageDataPaths;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * The command to delete {@link Part}s.
+ */
+public class ReloadCommand extends Command {
+
+    private AppManagerForHTML appManager;
+    private String htmlText;
+    
+    private Document document;
+    private Part baseRootPart;
+    private List<PageData> pages;
+    
+    /**
+     * Constructs a {@link ReloadCommand}.
+     * 
+     * @param child
+     *            a List containing {@link Part} which is removed
+     */
+    public ReloadCommand(AppManager appManager, String htmlText) {
+        this.htmlText = htmlText;
+        if(appManager instanceof AppManagerForHTML) {
+               this.appManager = (AppManagerForHTML) appManager;
+               init();
+        }
+        
+    }
+    
+    public void init() {
+        PageFileData pageFileData = HtmlReader.loadHtmlStream(appManager, new ByteArrayInputStream(htmlText.getBytes()));
+        
+        if(pageFileData != null) {
+               
+               // get New document 
+               this.document = pageFileData.getDocument();
+               
+               // get New baseRootPart
+               this.baseRootPart = pageFileData.getBaseRootPart();
+               
+               // get New pages
+               this.pages = new ArrayList<PageData>();
+            String pageFileName = appManager.getPageFileName();
+            String path = pageFileName.substring(0, pageFileName.lastIndexOf("/", pageFileName.length()-1));
+
+            if (pageFileData != null && pageFileData.getRootPartList() != null) {
+                for (int i = 0; i < pageFileData.getRootPartList().size(); i++) {
+                       PageDataPaths paths =
+                            new PageDataPaths(path, null, null, null, null, null);
+                    PageData pageData =
+                            new PageDataForHTML(BuilderConstants.EMPTY, pageFileData, i,
+                                                pageFileData.getDocument(), appManager.getDescriptorManager(),
+                                                paths);
+                    if (pageData != null) {
+//                        appManager.addPage(pageData);
+                       pages.add(pageData);
+                    }
+                }
+            }
+        }
+    }
+    
+    public void swap() {
+        // old document
+        Document document = appManager.getDocument();
+        // old baseRootPart
+        Part baseRootPart = appManager.getPageDataSet().getBaseRootPart();
+        // old pages
+        List<PageData> pages = appManager.getPages();
+        
+
+        
+        // set new document
+       appManager.setDocument(this.document);
+       
+       // set new meta
+       NodeList metaList = this.document.getElementsByTagName("meta");
+        for (int i = 0; i < metaList.getLength(); i++) {
+            Element elm = (Element) metaList.item(i);
+            if (elm.getAttribute("name").equals("viewport")) {
+                String metaContent = elm.getAttribute("content");
+                String[] kvPairs = metaContent.split(",");
+                for (String kvPair : kvPairs) {
+                    String[] kv = kvPair.split("=");
+                    if (kv[0].equals("width")) {
+                        appManager.setFrameworkScale(kv[1]);
+                        break;
+                    }
+                }
+            }
+        }
+
+        // set new Pages
+        appManager.getPageDataSet().setPages(this.pages);
+        
+       // set new baseRootPart with ALL_PAGES_RESETED event
+       appManager.getPageDataSet().setBaseRootPart(this.baseRootPart);
+        
+        // swap - this datas will be old.
+        this.document = document;
+        this.baseRootPart = baseRootPart;
+        this.pages = pages;
+    }
+
+    /**
+     * Checks whether a {@link ReloadCommand} can be executed.
+     * 
+     * @return <code>true</code> if a {@link ReloadCommand} can be executed, and
+     *         <code>false</code> otherwise
+     */
+    @Override
+    public boolean canExecute() {
+       return (appManager != null);
+    }
+
+    /**
+     * Executes a {@link ReloadCommand}.
+     */
+    @Override
+    public void execute() {
+        if (!canExecute()) {
+            return;
+        }
+
+//        ((AppManagerForHTML) appManager).load(new ByteArrayInputStream(htmlText.getBytes()));
+        
+        swap();
+    }
+
+    @Override
+    public void undo() {
+       swap();
+    }
+    
+}
\ No newline at end of file
index d9954d6..90d4fe9 100644 (file)
@@ -27,38 +27,34 @@ import org.eclipse.gef.commands.Command;
 import org.tizen.webuibuilder.model.Part;
 import org.tizen.webuibuilder.model.css.CssFile;
 import org.tizen.webuibuilder.model.css.CssSelector;
+import org.tizen.webuibuilder.model.page.PageData;
 
 
 public class RemoveCssSelectorCommand extends Command {
 
-    private CssFile cssFile;
-    private CssSelector selector;
+    private Part model;
     private String selectorName;
-    private Part part;
+    private PageData pageData;
+    private CssSelector selector;
+    private CssFile cssFile;
 
-    public RemoveCssSelectorCommand(CssFile cssFile, Part part, CssSelector selector) {
-        this.cssFile = cssFile;
-        this.part = part;
-        this.selector = selector;
-    }
 
-    public RemoveCssSelectorCommand(CssFile cssFile, Part part, String selectorName) {
-        this.cssFile = cssFile;
-        this.part = part;
+    public RemoveCssSelectorCommand(Part part, PageData pageData, String selectorName) {
+        this.pageData = pageData;
+        this.model = part;
         this.selectorName = selectorName;
     }
 
     @Override
     public boolean canExecute() {
-        if (cssFile == null || part == null) {
+        if (pageData == null || model == null || selectorName == null || selectorName.isEmpty()) {
             return false;
-        } else if (selector != null) {
-            return true;
         } else {
-            selector = cssFile.getSelector(selectorName);
+            selector = model.getSelector(selectorName);
             if (selector == null) {
                 return false;
             } else {
+                cssFile = pageData.getCurrentCssFile();
                 return true;
             }
         }
@@ -66,15 +62,13 @@ public class RemoveCssSelectorCommand extends Command {
 
     @Override
     public void execute() {
-        if (selector != null) {
-            cssFile.removeCssSelector(selector);
-            part.removeSelector(selector.getSelectorName());
-        }
+        cssFile.removeCssSelector(selector);
+        model.removeSelector(selectorName);
     }
 
     @Override
     public void undo() {
         cssFile.addCssSelector(selector);
-        part.addSelector(selector.getSelectorName(), selector);
+        model.addSelector(selectorName, selector);
     }
 }
index 3984ae6..824a0ab 100644 (file)
@@ -29,9 +29,11 @@ import org.tizen.webuibuilder.model.Part;
 import org.tizen.webuibuilder.model.css.CssFile;
 import org.tizen.webuibuilder.model.css.CssSelector;
 import org.tizen.webuibuilder.model.css.CssStyle;
+import org.tizen.webuibuilder.model.page.PageData;
 
 public class ResetCssSelectorCommand extends Command {
     
+    private PageData pageData;
     private CssFile cssFile;
     private CssSelector selector;
     private String selectorName;
@@ -39,48 +41,35 @@ public class ResetCssSelectorCommand extends Command {
     private Collection<CssStyle> styles;
     
 
-    public ResetCssSelectorCommand(CssFile cssFile, Part part, CssSelector selector) {
-        this.cssFile = cssFile;
-        this.part = part;
-        this.selector = selector;
-    }
-
-    public ResetCssSelectorCommand(CssFile cssFile, Part part, String selectorName) {
-        this.cssFile = cssFile;
+    public ResetCssSelectorCommand(Part part, PageData pageData, String selectorName) {
+        this.pageData = pageData;
         this.part = part;
         this.selectorName = selectorName;
     }
 
     @Override
     public boolean canExecute() {
-        if (cssFile == null || part == null) {
+        if (pageData == null || part == null || selectorName == null || selectorName.isEmpty()) {
             return false;
-        } else if (selector != null) {
-            selectorName = selector.getSelectorName();
-            if (selectorName == null || selectorName.isEmpty()) {
-                return false;
-            } else {
-                return true;
-            }
         } else {
-            selector = cssFile.getSelector(selectorName);
+            selector = part.getSelector(selectorName);
             if (selector == null) {
                 return false;
-            } else {
-                return true;
             }
+            cssFile = pageData.getCurrentCssFile();
+            return true;
         }
     }
 
     @Override
     public void execute() {
-        styles = cssFile.resetCssSelector(selectorName);
+        CssSelector clonedSelector = selector.cloneCssSelector(selectorName);
+        styles = clonedSelector.getStyles();
         part.resetSelector(selectorName);
     }
 
     @Override
     public void undo() {
-        selector.setStyles(styles);
         part.setSelectorStyles(selectorName, styles);
     }
 }
index 2a62728..3b9df46 100644 (file)
@@ -191,6 +191,9 @@ public class DesignerEditPart extends HoverViewerEditPart {
             PageData pageData = ((HoverBrowserViewer) getViewer()).getPageData();
             Part model = (Part) getModel();
             CssSelector selector = model.getSelector(selectorName);
+            if (selector == null) {
+                return;
+            }
             List<CssFile> appliedCssFileList = pageData.getAppliedCssFiles();
             int index = appliedCssFileList.indexOf(pageData.getCurrentCssFile());
             int size = appliedCssFileList.size();
index f974604..8443c9f 100644 (file)
@@ -56,7 +56,10 @@ import org.tizen.webuibuilder.model.IPartListener;
 import org.tizen.webuibuilder.model.Part;
 import org.tizen.webuibuilder.model.PartEvent;
 import org.tizen.webuibuilder.model.css.CssEvent;
+import org.tizen.webuibuilder.model.css.CssFile;
+import org.tizen.webuibuilder.model.css.CssSelector;
 import org.tizen.webuibuilder.model.css.ICssListener;
+import org.tizen.webuibuilder.model.page.PageData;
 import org.tizen.webuibuilder.ui.editor.ruler.DesignerGuide;
 
 
@@ -232,6 +235,24 @@ public class HoverViewerEditPart extends AbstractGraphicalEditPart implements IP
 
     @Override
     public void cssSelectorRemoved(CssEvent event) {
+        String selectorName = event.getSelectorName();
+        if (selectorName == null || selectorName.isEmpty()) {
+            return;
+        } else {
+            PageData pageData = ((HoverBrowserViewer) getViewer()).getPageData();
+            Part model = (Part) getModel();
+            
+            model.getAllSelectorMap().remove(selectorName);
+            
+            List<CssFile> appliedCssFileList = pageData.getAppliedCssFiles();
+            for (int i = 0; i < appliedCssFileList.size(); i++) {
+                CssFile cssFile = appliedCssFileList.get(i);
+                CssSelector selector = cssFile.getSelector(selectorName);
+                if (selector != null) {
+                    model.addSelectorWhenReadCss(selector);
+                }
+            }
+        }
         ((HoverBrowserViewer) getViewer()).updateStyle();
 
     }
index def69d5..570f99b 100644 (file)
@@ -121,7 +121,7 @@ public class WidgetFigure extends PartFigure implements MouseMotionListener {
 
         // data binding icon check
         if (isBinded()) {
-            Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "binded.gif");
+            Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_BINDING_IMAGE);
             if (null == img) {
                 Rectangle r = new Rectangle(getBounds().x + 5, getBounds().y + 5, 10, 15);
                 graphics.setAlpha(90);
index d853647..cc14cef 100644 (file)
@@ -1096,7 +1096,7 @@ public class Part implements ISerializer {
         return new WidgetValidator().canSetPropertyValue(condition, value, comparerValue,
                                                          displayName);
     }
-
+    
     /**
      * Sets property value corresponding property name.
      * 
@@ -1104,9 +1104,11 @@ public class Part implements ISerializer {
      *            a property name
      * @param value
      *            a property value
+     * @param isFireEvent
+     *                           <code>true</code> if firing event is required, and <code>false</code> otherwise
      */
-    public void setPropertyValue(String propertyName, String value) {
-        PartProperty property = properties.get(propertyName);
+    public void setPropertyValue(String propertyName, String value, boolean isFireEvent) {
+       PartProperty property = properties.get(propertyName);
         if (property == null || value == null) {
             return;
         }
@@ -1191,7 +1193,21 @@ public class Part implements ISerializer {
             }
         }
 
-        fireEvent(new PartEvent(PartEvent.EventType.PROPERTY_CHANGED, this, propertyName, oldValue));
+        if(isFireEvent) {
+               fireEvent(new PartEvent(PartEvent.EventType.PROPERTY_CHANGED, this, propertyName, oldValue));
+        }
+    }
+
+    /**
+     * Sets property value corresponding property name.
+     * 
+     * @param propertyName
+     *            a property name
+     * @param value
+     *            a property value
+     */
+    public void setPropertyValue(String propertyName, String value) {
+       setPropertyValue(propertyName, value, true);
     }
 
     /**
@@ -1584,7 +1600,6 @@ public class Part implements ISerializer {
 
         CssSelector cssSelector = getSelector(selectorName);
         editSelectorMap.remove(selectorName);
-        allSelectorMap.remove(selectorName);
 
         fireEvent(new CssEvent(EventType.CSS_SELECTOR_REMOVED, this, cssSelector.getSelectorName(),
                                null, null));
@@ -1608,7 +1623,6 @@ public class Part implements ISerializer {
             removeSelector(selectorName);
         } else {
             editSelectorMap.remove(selectorName);
-            allSelectorMap.remove(selectorName);
         }
     }
 
@@ -2253,15 +2267,9 @@ public class Part implements ISerializer {
                 idIndex++;
             }
             
-            String newId = id + String.valueOf(idIndex);
-            
-            if(child.getElement() != null) {
-               child.getElement().setAttribute(PROPERTY_ID, newId);
-            }
-            
-            child.setPropertyValue(PROPERTY_ID, newId);
+            child.setPropertyValue(PROPERTY_ID, id + String.valueOf(idIndex), false);
         } else {
-            child.setPropertyValue(PROPERTY_ID, propertyId);
+            child.setPropertyValue(PROPERTY_ID, propertyId, false);
         }
 
         // Adds child.
index 2ec5e45..15af7ff 100644 (file)
@@ -29,6 +29,7 @@ import java.util.List;
 import org.eclipse.osgi.util.NLS;
 import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.model.descriptors.ConditionDescriptor;
+import org.tizen.webuibuilder.model.descriptors.ConstantDescriptor;
 import org.tizen.webuibuilder.model.descriptors.EventDescriptor;
 import org.tizen.webuibuilder.model.descriptors.PropertyConditionDescriptor;
 import org.tizen.webuibuilder.model.descriptors.PropertyDescriptor;
@@ -249,10 +250,26 @@ public class WidgetValidator {
             case CSS_FONT_SIZE:
                 return checkSizeValue(value);
             case INTEGER:
+                if (!checkIntegerValue(value)) {
+                    return BuilderMessages.ERROR_INTEGER_VALUE;
+                }
+                break;
+            case SIZE_INTEGER:
+                if (!checkIntegerValue(value)) {
+                    List<ConstantDescriptor> items = descriptor.getTypeDescriptor().getAvailableConstant();
+                    for (ConstantDescriptor item : items) {
+                        if (value.equals(item.getValue())) {
+                            return OK;
+                        }
+                    }
+                    return ERROR;
+                }
+                break;
             case STRING:
                 if (!checkStringValue(value)) {
                     return BuilderMessages.ERROR_STRING_VALUE;
                 }
+                break;
             case BOOLEAN:
             case URL:
             case IMAGE:
index 13d7e4d..ce5a2d8 100644 (file)
@@ -47,7 +47,6 @@ import org.tizen.webuibuilder.model.css.io.CssReader;
 import org.tizen.webuibuilder.model.descriptors.DescriptorManager;
 import org.tizen.webuibuilder.model.filedata.AppFileData;
 import org.tizen.webuibuilder.model.nscreen.NScreenModelManager;
-import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor;
 import org.tizen.webuibuilder.model.page.IPageDataSetListener;
 import org.tizen.webuibuilder.model.page.PageData;
 import org.tizen.webuibuilder.model.page.PageDataSet;
@@ -86,7 +85,6 @@ public class AppManager implements IPageDataSetListener, IAppListener {
     private String rootFullPath;
 
     private NScreenModelManager nscreenModelManger;
-    private NScreenDescriptor nscreenDescriptor;
 
     /**
      * Constructor.
@@ -100,7 +98,6 @@ public class AppManager implements IPageDataSetListener, IAppListener {
         this.descriptorManager = descriptorManager;
         partFactory = new PartFactory(descriptorManager);
         nscreenModelManger = new NScreenModelManager();
-        nscreenDescriptor = new NScreenDescriptor(this);
 
         pageDataSet = new PageDataSet();
         pageDataSet.addPageListener(this);
@@ -161,7 +158,7 @@ public class AppManager implements IPageDataSetListener, IAppListener {
     public List<PageData> getPages() {
         return pageDataSet.getPages();
     }
-
+    
     public void addPage(PageData page, boolean isExistsPagePart) {
         String path = null;
         if (page.getPagePath() != null) {
@@ -590,7 +587,7 @@ public class AppManager implements IPageDataSetListener, IAppListener {
     }
 
     public void removePage(int index) {
-        pageDataSet.removePage(index);
+        pageDataSet.removePage(index, true);
 
         if (index == startupPage) {
             if (getPages().size() > 0) {
@@ -876,10 +873,6 @@ public class AppManager implements IPageDataSetListener, IAppListener {
         return this.nscreenModelManger;
     }
 
-    public NScreenDescriptor getNScreenDescriptor() {
-        return this.nscreenDescriptor;
-    }
-
     public String getPlatform() {
         return this.projectManager.getPlatform();
     }
index 4031a39..5fb4a9e 100644 (file)
@@ -130,6 +130,7 @@ public class AppManagerForHTML extends AppManager {
                         // pageData.addPageListener(this);
                     }
                 }
+
             }
         } else {
             // appManager = new AppManager(projectManager, null);
@@ -228,7 +229,7 @@ public class AppManagerForHTML extends AppManager {
 
                 String projectFolder = projectManager.getProject().getLocation().toString();
                 for (NScreenModel model : nscreenModel) {
-                    getNScreenModelManger().addNScreenModel(model);
+                    getNScreenModelManger().insertNscreenModel(model);
                     // for ( String page : model.getEnalbePages() ) {
                     // String cssFileFullPath = projectFolder + IPath.SEPARATOR + page + "."
                     // +model.getFileName();
@@ -307,20 +308,21 @@ public class AppManagerForHTML extends AppManager {
 
         String page = "data-role=\"page\""; //$NON-NLS-1$
         String newHtml = null;
-               if (html.contains(page)) {
-                       String id = BuilderConstants.PROPERTY_ID + BuilderConstants.EQUAL
-                                       + BuilderConstants.QUOTATION_MARK;
-                       int startIndex = html.indexOf(id, html.indexOf(page)) + 4;
-                       String startHtml = html.substring(0, startIndex);
-                       int endIndex = html.indexOf(BuilderConstants.QUOTATION_MARK,
-                                       startIndex);
-                       String endHtml = html.substring(endIndex, html.length());
-                       newHtml = startHtml + pageName + endHtml;
-               }
-               return (newHtml != null) ? HtmlReader.loadHtmlStream(this,
-                               new ByteArrayInputStream(newHtml.getBytes())) : null;
-       }
-    
+        if (html.contains(page)) {
+            String id =
+                    BuilderConstants.PROPERTY_ID + BuilderConstants.EQUAL
+                            + BuilderConstants.QUOTATION_MARK;
+            int startIndex = html.indexOf(id, html.indexOf(page)) + 4;
+            String startHtml = html.substring(0, startIndex);
+            int endIndex = html.indexOf(BuilderConstants.QUOTATION_MARK, startIndex);
+            String endHtml = html.substring(endIndex, html.length());
+            newHtml = startHtml + pageName + endHtml;
+        }
+        return (newHtml != null) ? HtmlReader.loadHtmlStream(this,
+                                                             new ByteArrayInputStream(newHtml
+                                                                     .getBytes())) : null;
+    }
+
     @Override
     public void addPage(PageData page, boolean isExistsPagePart) {
         String path = null;
@@ -329,14 +331,15 @@ public class AppManagerForHTML extends AppManager {
                     getProjectManager().getProject().getFile(page.getPagePath())
                             .getProjectRelativePath().toString();
         } else {
-               path = pageFileName.substring(0,
-                               pageFileName.lastIndexOf("/", pageFileName.length()-1));
+            path =
+                    pageFileName
+                            .substring(0, pageFileName.lastIndexOf("/", pageFileName.length() - 1));
         }
-        
+
         pageDataSet.addPage(page, path, isExistsPagePart);
-        
-        if(isExistsPagePart) {
-               DomUtil.appendPageNode(document, DomUtil.BODY_ELEMENT, page.getPagePart().getElement());
+
+        if (isExistsPagePart) {
+            DomUtil.appendPageNode(document, DomUtil.BODY_ELEMENT, page.getPagePart().getElement());
         }
     }
 
@@ -348,18 +351,20 @@ public class AppManagerForHTML extends AppManager {
                     getProjectManager().getProject().getFile(page.getPagePath())
                             .getProjectRelativePath().toString();
         } else {
-               path = pageFileName.substring(0,
-                               pageFileName.lastIndexOf('/', pageFileName.length()-1));
+            path =
+                    pageFileName
+                            .substring(0, pageFileName.lastIndexOf('/', pageFileName.length() - 1));
         }
-        
-        if(isExistsPagePart) {
-               PageData refPageData = getPageByIndex(index); 
-               DomUtil.insertBeforePageNode(document, DomUtil.BODY_ELEMENT, page.getPagePart().getElement(), 
-                               (refPageData != null) ? refPageData.getPagePart().getElement() : null);
+
+        if (isExistsPagePart) {
+            PageData refPageData = getPageByIndex(index);
+            DomUtil.insertBeforePageNode(document, DomUtil.BODY_ELEMENT, page.getPagePart()
+                    .getElement(), (refPageData != null) ? refPageData.getPagePart().getElement()
+                    : null);
         }
         pageDataSet.addPage(index, page, path, isExistsPagePart);
     }
-    
+
     public void addPage(String html, String pageName) {
         if (html == null || pageName == null) {
             return;
@@ -410,21 +415,28 @@ public class AppManagerForHTML extends AppManager {
 
     @Override
     public void removePage(int index) {
-       
-       DomUtil.removePageNode(document, DomUtil.BODY_ELEMENT, getPageData(index).getPagePart().getElement());
-       
-       pageDataSet.removePageWithPart(index);
-
-               if (index == startupPage) {
-                       if (getPages().size() > 0) {
-                               if (index >= getPages().size()) {
-                                       index = getPages().size() - 1;
-                               }
-                               setStartupPage(index);
-                       } else {
-                               setStartupPage(-1);
-                       }
-               }
+
+        DomUtil.removePageNode(document, DomUtil.BODY_ELEMENT, getPageData(index).getPagePart()
+                .getElement());
+
+        pageDataSet.removePageWithPart(index);
+
+        if (index == startupPage) {
+            if (getPages().size() > 0) {
+                if (index >= getPages().size()) {
+                    index = getPages().size() - 1;
+                }
+                setStartupPage(index);
+            } else {
+                setStartupPage(-1);
+            }
+        }
+    }
+
+    @Override
+    public void removeAllPages() {
+        pageDataSet.removeAllPagesWithPart();
+        setStartupPage(-1);
     }
 
     private void addPageDocument(PageFileData pageFileData) {
@@ -479,6 +491,14 @@ public class AppManagerForHTML extends AppManager {
         return document;
     }
 
+    public void setDocument(Document document) {
+        this.document = document;
+    }
+
+    public String getPageFileName() {
+        return this.pageFileName;
+    }
+
     @Override
     public void save() {
         SyncDataToFileData();
@@ -577,6 +597,16 @@ public class AppManagerForHTML extends AppManager {
         newElm.setAttribute("src", "./tizen-ui-builder-tool/res/html/ground.js");
         head.appendChild(newElm);
 
+        elemList = head.getChildNodes();
+        for (int i = elemList.getLength(); i >= 0; i--) {
+            Node childNode = elemList.item(i);
+            if (childNode instanceof Element) {
+                if (childNode.getNodeName().equals("link")) {
+                    head.removeChild(childNode);
+                }
+            }
+        }
+        
         Element newElm2 = editDoc.createElement("style");
         newElm2.setAttribute("type", "text/css");
         newElm2.setAttribute("id", "page_style");
@@ -734,6 +764,7 @@ public class AppManagerForHTML extends AppManager {
         head.insertBefore(newElmBase, head.getFirstChild());
 
         String html = null;
+        String css = null;
         if (rootPart != null) {
             Part part = null;
             if (rootPart.isDocumentPart()) {
@@ -745,12 +776,19 @@ public class AppManagerForHTML extends AppManager {
             html =
                     CodeGenerator.generateCode(part, false, getDescriptorManager()
                             .getXsltDocument(), false);
+            css = CodeGenerator.generateCssCode(part);
         }
 
         Element newElm = editDoc.createElement("script");
         newElm.setAttribute("src", "./tizen-ui-builder-tool/res/html/preview.js");
         head.appendChild(newElm);
 
+        Element newElm2 = editDoc.createElement("style");
+        newElm2.setAttribute("type", "text/css");
+        newElm2.setAttribute("id", "page_style");
+        newElm2.setTextContent("%css%");
+        head.appendChild(newElm2);
+
         NodeList bodys = editDoc.getElementsByTagName("body");
         Element body = null;
         if (bodys == null) {
@@ -763,17 +801,21 @@ public class AppManagerForHTML extends AppManager {
         for (int i = 0; i < len; i++) {
             body.removeChild(body.getFirstChild());
         }
+        body.setTextContent("%html%");
 
         if (html == null) {
             html = "";
         }
-        body.setTextContent("%html%");
+        if (css == null) {
+            css = "";
+        }
 
         // String tempHtml =
         // HtmlWriter.writeToString((Element)editDoc.getFirstChild().getChildNodes().item(index));
         String tempHtml = HtmlWriter.writeToString(editDoc);
 
         tempHtml = tempHtml.replace("%html%", html);
+        tempHtml = tempHtml.replace("%css%", css);
 
         return tempHtml;
     }
index 6445b62..4a5722d 100644 (file)
@@ -148,33 +148,33 @@ public class HtmlMetaReader_ver_1 {
 
             model = new NScreenModel(name, type);
 
-            if (screen.getAttribute("device-width").length() > 0) {
+            if (!screen.getAttribute("device-width").isEmpty()) {
                 model.setDeviceWidth(Integer.parseInt(screen.getAttribute("device-width")));
             }
 
-            if (screen.getAttribute("device-height").length() > 0) {
+            if (!screen.getAttribute("device-height").isEmpty()) {
                 model.setDeviceHeight(Integer.parseInt(screen.getAttribute("device-height")));
             }
 
-            if (screen.getAttribute("device-pixel-ratio").length() > 0) {
+            if (!screen.getAttribute("device-pixel-ratio").isEmpty()) {
                 model.setDevicePixelRatio(Double.parseDouble(screen
                         .getAttribute("device-pixel-ratio")));
             }
 
-            if (screen.getAttribute("color").length() > 0)
+            if (!screen.getAttribute("color").isEmpty())
                 model.setColor(Integer.parseInt(screen.getAttribute("color")));
 
-            if (screen.getAttribute("color-index").length() > 0)
+            if (!screen.getAttribute("color-index").isEmpty())
                 model.setColor(Integer.parseInt(screen.getAttribute("color-index")));
 
-            if (screen.getAttribute("grid").length() > 0
+            if (!screen.getAttribute("grid").isEmpty()
                     && screen.getAttribute("grid").equals("true"))
                 model.setGrid(true);
 
-            if (screen.getAttribute("monochrome").length() > 0)
+            if (!screen.getAttribute("monochrome").isEmpty())
                 model.setMonochrome(Integer.parseInt(screen.getAttribute("monochrome")));
 
-            if (screen.getAttribute("orientation").length() > 0) {
+            if (!screen.getAttribute("orientation").isEmpty()) {
                 if (Orientation.LANDSCAPE.toString().toLowerCase()
                         .equals(screen.getAttribute("orientation")))
                     model.setOrientation(Orientation.LANDSCAPE);
@@ -182,28 +182,18 @@ public class HtmlMetaReader_ver_1 {
                     model.setOrientation(Orientation.PORTRAIT);
             }
 
-            if (screen.getAttribute("resolution").length() > 0)
+            if (!screen.getAttribute("resolution").isEmpty())
                 model.setResolution(screen.getAttribute("resolution"));
 
-            if (screen.getAttribute("scan").length() > 0) {
+            if (!screen.getAttribute("scan").isEmpty()) {
                 if (Scan.PROGRESSIVE.toString().toLowerCase().equals(screen.getAttribute("scan")))
                     model.setScan(Scan.PROGRESSIVE);
                 else
                     model.setScan(Scan.INTERLACE);
             }
 
-            // menu
-            if (screen.getAttribute("defaultInMenu").length() > 0) {
-                model.setDefaultInMenu(Boolean.parseBoolean(screen.getAttribute("defaultInMenu")));
-            }
-            if (screen.getAttribute("enableInMenu").length() > 0) {
-                model.setEnableInMenu(Boolean.parseBoolean(screen.getAttribute("enableInMenu")));
-            }
-            if (screen.getAttribute("linkInMenu").length() > 0) {
-                model.setLinkInMenu(Boolean.parseBoolean(screen.getAttribute("linkInMenu")));
-            }
-            if (screen.getAttribute("moveInMenu").length() > 0) {
-                model.setMoveInMenu(Boolean.parseBoolean(screen.getAttribute("moveInMenu")));
+            if (!screen.getAttribute("attributes").isEmpty()) {
+                model.setAttributes(Integer.parseInt(screen.getAttribute("attributes")));
             }
 
             NodeList nodeList = screen.getElementsByTagName("enablePage");
@@ -219,12 +209,12 @@ public class HtmlMetaReader_ver_1 {
                 }
             }
 
-            //TODO nscreen : link.
-//            if (screen.getAttribute("link").length() > 0
-//                    && Boolean.parseBoolean(screen.getAttribute("link")))
-//                model.setLink(screen.getAttribute("cssFileName"));
-//            else
-//                model.setFileName(screen.getAttribute("cssFileName"));
+            // TODO nscreen : link.
+            // if (screen.getAttribute("link").length() > 0
+            // && Boolean.parseBoolean(screen.getAttribute("link")))
+            // model.setLink(screen.getAttribute("cssFileName"));
+            // else
+            // model.setFileName(screen.getAttribute("cssFileName"));
 
             fileData.getNscreenModelList().add(model);
         }
index 0b4556f..e9f4a4a 100644 (file)
@@ -38,6 +38,7 @@ import org.tizen.webuibuilder.model.descriptors.TypeDescriptor;
 import org.tizen.webuibuilder.model.filedata.AppFileData;
 import org.tizen.webuibuilder.model.io.file.TizenFileFormatter;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
 import org.tizen.webuibuilder.model.page.PageData;
 import org.tizen.webuibuilder.ui.views.databinding.model.BindingData;
 import org.tizen.webuibuilder.ui.views.databinding.model.BindingObject;
@@ -150,78 +151,78 @@ public class HtmlMetaWriter_ver_1 {
 
     public static Element writeNScreen(Document doc, Element nscreenElement, AppManager appManager) {
         List<NScreenModel> list = appManager.getNScreenModelManger().getNScreenModels();
-        for ( NScreenModel nsModel : list ) {
-            Element screenElement = doc.createElement( "screen" );
-
-            screenElement.setAttribute("name", nsModel.getName());
-            screenElement.setAttribute("type", nsModel.getType().toString());
+        for (NScreenModel nsModel : list) {
+            Element screenElement = doc.createElement("screen");
+            if (nsModel.isEnagePages()) {
+                screenElement.setAttribute("name", nsModel.getName());
+                screenElement.setAttribute("type", nsModel.getType().toString());
+
+                if (nsModel.getDevicePixelRatio() > 0.0) {
+                    screenElement.setAttribute("device-pixel-ratio",
+                                               String.valueOf(nsModel.getDevicePixelRatio()));
+                }
 
-            if (nsModel.getDevicePixelRatio() > 0.0) {
-                screenElement.setAttribute("device-pixel-ratio",
-                                           String.valueOf(nsModel.getDevicePixelRatio()));
-            }
+                if (nsModel.getDeviceWidth() > -1) {
+                    screenElement.setAttribute("device-width",
+                                               String.valueOf(nsModel.getDeviceWidth()));
+                }
 
-            if (nsModel.getDeviceWidth() > -1) {
-                screenElement
-                        .setAttribute("device-width", String.valueOf(nsModel.getDeviceWidth()));
-            }
+                if (nsModel.getDeviceHeight() > -1) {
+                    screenElement.setAttribute("device-height",
+                                               String.valueOf(nsModel.getDeviceHeight()));
+                }
 
-            if (nsModel.getDeviceHeight() > -1) {
-                screenElement.setAttribute("device-height",
-                                           String.valueOf(nsModel.getDeviceHeight()));
-            }
+                if (nsModel.getColor() > 0)
+                    screenElement.setAttribute("color", String.valueOf(nsModel.getColor()));
 
-            if ( nsModel.getColor() > 0 )
-                screenElement.setAttribute( "color", String.valueOf( nsModel.getColor() ) );
+                if (nsModel.getColorIndex() > 0)
+                    screenElement.setAttribute("color-index",
+                                               String.valueOf(nsModel.getColorIndex()));
 
-            if ( nsModel.getColorIndex() > 0 )
-                screenElement.setAttribute( "color-index", String.valueOf( nsModel.getColorIndex() ) );
+                if (nsModel.getGrid())
+                    screenElement.setAttribute("grid", String.valueOf(true));
 
-            if ( nsModel.getGrid() )
-                screenElement.setAttribute( "grid", String.valueOf( true ) );
+                if (nsModel.getMonochrome() > 0)
+                    screenElement.setAttribute("monochrome",
+                                               String.valueOf(nsModel.getMonochrome()));
 
-            if ( nsModel.getMonochrome() > 0 )
-                screenElement.setAttribute( "monochrome", String.valueOf( nsModel.getMonochrome() ) );
+                if (nsModel.getOrientation() != null)
+                    screenElement.setAttribute("orientation", nsModel.getOrientation().toString()
+                            .toLowerCase());
 
-            if ( nsModel.getOrientation() != null )
-                screenElement.setAttribute( "orientation", nsModel.getOrientation().toString()
-                        .toLowerCase() );
+                if (nsModel.getResolution() != null)
+                    screenElement.setAttribute("resolution", nsModel.getResolution());
 
-            if ( nsModel.getResolution() != null )
-                screenElement.setAttribute( "resolution", nsModel.getResolution() );
+                if (nsModel.getScan() != null)
+                    screenElement.setAttribute("scan", nsModel.getScan().toString().toLowerCase());
 
-            if ( nsModel.getScan() != null )
-                screenElement.setAttribute( "scan", nsModel.getScan().toString().toLowerCase() );
+                if (nsModel.getAttributes() != 0)
+                    screenElement.setAttribute("attributes", String.valueOf(nsModel.getAttributes()));
 
-            for (int i = 0; i < appManager.getPageDataSet().getPages().size(); i++) {
-                String pageName = appManager.getPageDataSet().getPages().get(i).getName();
-                String enable = String.valueOf(nsModel.isEnablePage(pageName));
-                String link = "";
+                for (int i = 0; i < appManager.getPageDataSet().getPages().size(); i++) {
+                    String pageName = appManager.getPageDataSet().getPages().get(i).getName();
+                    String enable = String.valueOf(nsModel.isEnablePage(pageName));
+                    String link = "";
 
-                if (nsModel.getLink(pageName) != -666) {
-                    link = String.valueOf(nsModel.getLink(pageName));
-                }
+                    if (nsModel.getLink(pageName) != -666) {
+                        link = String.valueOf(nsModel.getLink(pageName));
+                    }
 
-                Element enablePageElement = doc.createElement("enablePage");
+                    Element enablePageElement = doc.createElement("enablePage");
 
-                if (!(enable.isEmpty()) || (!link.isEmpty())) {
-                    enablePageElement.setAttribute("name", pageName);
-                    enablePageElement.setAttribute("enable", enable);
-                    if (!link.isEmpty()) {
-                        enablePageElement.setAttribute("link", link);
+                    if (!(enable.isEmpty()) || (!link.isEmpty())) {
+                        enablePageElement.setAttribute("name", pageName);
+                        enablePageElement.setAttribute("enable", enable);
+                        if (!link.isEmpty()) {
+                            enablePageElement.setAttribute("link", link);
+                        }
+                        screenElement.appendChild(enablePageElement);
                     }
-                    screenElement.appendChild(enablePageElement);
                 }
-            }
-            screenElement.setAttribute("fineName", String.valueOf(nsModel.getFileName()));
-
-            // menu flag
-            screenElement.setAttribute("defaultInMenu", String.valueOf(nsModel.getDefaultInMenu()));
-            screenElement.setAttribute("enableInMenu", String.valueOf(nsModel.getEnableInMenu()));
-            screenElement.setAttribute("linkInMenu", String.valueOf(nsModel.getLinkInMenu()));
-            screenElement.setAttribute("moveInMenu", String.valueOf(nsModel.getMoveInMenu()));
+                screenElement.setAttribute("fineName", String.valueOf(nsModel.getFileName()));
 
-            nscreenElement.appendChild(screenElement);
+                nscreenElement.appendChild(screenElement);
+            }
         }
         return nscreenElement;
     }
index c2b8a5e..e056ec3 100644 (file)
@@ -36,7 +36,7 @@ public class TypeDescriptor {
      * A property type.
      */
     public enum Types {
-        UNKNOWN, STRING, BOOLEAN, INTEGER, URL, IMAGE, COLOR, COLOR2, DATE, TIME, AUDIO, VIDEO, HTMLSTRING, GROUP, GROUP_TEXT, GROUP_POSITION, CSS_COLOR, CSS_FONT_SIZE, CSS_FONT_STYLE, CSS_FONT_WEIGHT, CSS_TEXT_ALIGN, CSS_TEXT_DECORATION, SIZE_INTEGER, SIZE_PERCENT, SIZE_REAL, SIZE, SIZE_PIXEL, SIZE_ANGLE, ENUM, OPACITY, ICON, ICON_TEXT_ALIGN, ICON_FONT_WEIGHT, ICON_FONT_STYLE, ICON_TEXT_DECORATION, ICON_TEXT_TRANSFORM, TEXT_LETTER_SPACING, TEXT_LINE_HEIGHT, GROUP_TRANSFORM, GROUP_BORDER, SEPARATOR, EMPTY, CHECK, NEW_COLOR, COLOR_FILL, SCALE, SCALE_PIXEL, SCALE_PERCENT, SCALE_ANGLE, LISTITEM_CLASS, GROUP_FILTER, GROUP_VALUE, METRICS, CUSTOM_CSS, CLIP, GROUP_ICON, DATABINDING_TEXT, DATABINDING_VALUE, DATABINDING_FOREACH, DATABINDING_SLIDER, DATABINDING_TEXT_CHECK, DATABINDING_FOREACH_TEXT, DATABINDING_VALUE_TEXT, DATABINDING_ATTR_SRC, DATABINDING_ATTR_TEXT, DATABINDING_ATTR_HREF
+        UNKNOWN, STRING, BOOLEAN, INTEGER, URL, IMAGE, COLOR, COLOR2, DATE, TIME, AUDIO, VIDEO, HTMLSTRING, GROUP, GROUP_TEXT, GROUP_POSITION, CSS_COLOR, CSS_FONT_SIZE, CSS_FONT_STYLE, CSS_FONT_WEIGHT, CSS_TEXT_ALIGN, CSS_TEXT_DECORATION, SIZE_INTEGER, SIZE_PERCENT, SIZE_REAL, SIZE, SIZE_PIXEL, SIZE_ANGLE, ENUM, OPACITY, ICON, ICON_TEXT_ALIGN, ICON_FONT_WEIGHT, ICON_FONT_STYLE, ICON_TEXT_DECORATION, ICON_TEXT_TRANSFORM, TEXT_LETTER_SPACING, TEXT_LINE_HEIGHT, GROUP_TRANSFORM, GROUP_BORDER, SEPARATOR, EMPTY, CHECK, NEW_COLOR, COLOR_FILL, SCALE, SCALE_PIXEL, SCALE_PERCENT, SCALE_ANGLE, LISTITEM_CLASS, GROUP_FILTER, GROUP_VALUE, METRICS, CUSTOM_CSS, CLIP, GROUP_ICON, DATABINDING_TEXT, DATABINDING_VALUE, DATABINDING_FOREACH, DATABINDING_SLIDER, DATABINDING_TEXT_CHECK, DATABINDING_FOREACH_TEXT, DATABINDING_VALUE_TEXT, DATABINDING_ATTR_SRC, DATABINDING_ATTR_TEXT, DATABINDING_ATTR_HREF, INTEGER_STYLE
     }
 
     // Id of type
@@ -77,7 +77,7 @@ public class TypeDescriptor {
     public static final String ID_OF_CSS_TEXT_ALIGN = "css-text-align"; //$NON-NLS-1$
     public static final String ID_OF_CSS_TEXT_DECORATION = "css-text-decoration"; //$NON-NLS-1$
 
-    public static final String ID_OF_SIZE_INTEGER = "style@int"; //$NON-NLS-1$ //non unit
+    public static final String ID_OF_SIZE_INTEGER = "integer@style"; //$NON-NLS-1$     //non unit
     public static final String ID_OF_SIZE_PERCENT = "size@per"; //$NON-NLS-1$          //%
     public static final String ID_OF_SIZE_REAL = "size@real"; //$NON-NLS-1$            //0.0
     public static final String ID_OF_SIZE = "size"; //$NON-NLS-1$              //px, %
index 561a33c..5a27a14 100644 (file)
@@ -66,8 +66,8 @@ public class HtmlWriter {
      *            a writer
      */
     public static void writeTo(Element element, Writer writer) {
-        TransformerFactory transformerFactory = TransformerFactory.newInstance();
-        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
+        TransformerFactory transformerFactory = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl", null);
+//        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
         try {
             // String xslt =
             // "<xsl:stylesheet version='1.0'\n"
@@ -78,9 +78,18 @@ public class HtmlWriter {
             // Transformer transformer = transformerFactory.newTransformer(new
             // StreamSource(new StringBufferInputStream(xslt)));
             Transformer transformer = transformerFactory.newTransformer();
+            transformer.setOutputProperty(OutputKeys.VERSION, "4.0");
+            
+            transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/html");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}content-handler", "org.apache.xml.serializer.ToHTMLStream");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}entities", "org/apache/xml/serializer/HTMLEntities");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}use-url-escaping", BuilderConstants.YES);
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}omit-meta-tag", BuilderConstants.YES);
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "0");
+            
             transformer.setOutputProperty(OutputKeys.METHOD, BuilderConstants.HTML);
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, BuilderConstants.YES);
-            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.YES);
+            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.NO);
             DOMSource source = new DOMSource(element);
             StreamResult result = new StreamResult(writer);
             transformer.transform(source, result);
index 16031f3..62e507b 100644 (file)
@@ -36,6 +36,11 @@ public class NScreenModel {
     public static final int NONE = 0;
     public static final int DOWN = 1;
 
+    public static final int ATTRIBUTE_DEFAULT = 1 << 0;
+    public static final int ATTRIBUTE_ENABLE = 1 << 1;
+    public static final int ATTRIBUTE_LINK = 1 << 2;
+    public static final int ATTRIBUTE_MOVE = 1 << 3;
+
     public enum Orientation {
         LANDSCAPE, PORTRAIT;
     }
@@ -53,11 +58,7 @@ public class NScreenModel {
     private HashMap<String, Boolean> enablePages = new HashMap<String, Boolean>();
     private HashMap<String, Integer> link = new HashMap<String, Integer>();
     private String imageName = null;
-
-    private boolean defaultInMenu = false;
-    private boolean enableInMenu = false;
-    private boolean linkInMenu = false;
-    private boolean moveInMenu = false;
+    private int attributes = 0;
 
     // Media Feature
     private double devicePixelRatio = 0;
@@ -72,11 +73,6 @@ public class NScreenModel {
     private String resolution;
     private Scan scan = null;
     private boolean grid = false;
-    // TODO : Next Version.
-    // private int minDeviceHeight;
-    // private int maxDeviceHeight;
-    // private int minDeviceWidth;
-    // private int maxDeviceWidth;
 
     private String nscreenName;
 
@@ -323,36 +319,22 @@ public class NScreenModel {
         this.enablePages = enablePages;
     }
 
-    // NscreenView Menu
-    public boolean getDefaultInMenu() {
-        return defaultInMenu;
-    }
-
-    public void setDefaultInMenu(boolean defaultInMenu) {
-        this.defaultInMenu = defaultInMenu;
-    }
-
-    public boolean getEnableInMenu() {
-        return enableInMenu;
-    }
-
-    public void setEnableInMenu(boolean enableInMenu) {
-        this.enableInMenu = enableInMenu;
-    }
-
-    public boolean getLinkInMenu() {
-        return linkInMenu;
-    }
-
-    public void setLinkInMenu(boolean linkInMenu) {
-        this.linkInMenu = linkInMenu;
+    public boolean isEnagePages() {
+        boolean retValue = false;
+        for (String pageName : enablePages.keySet()) {
+            if (this.isEnablePage(pageName) == true) {
+                retValue = true;
+                break;
+            }
+        }
+        return retValue;
     }
 
-    public boolean getMoveInMenu() {
-        return moveInMenu;
+    public void setAttributes(int attributes) {
+        this.attributes = attributes;
     }
 
-    public void setMoveInMenu(boolean moveInMenu) {
-        this.moveInMenu = moveInMenu;
+    public int getAttributes() {
+        return attributes;
     }
 }
index 7cd5410..3c0428f 100644 (file)
@@ -28,39 +28,53 @@ import java.util.LinkedList;
 import java.util.List;
 
 import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.model.app.AppManager;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
+import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor;
 
 
 public class NScreenModelManager {
-    private List<NScreenModel> nscreenModels = new ArrayList<NScreenModel>();
+    private List<NScreenModel> nscreenDatas = new ArrayList<NScreenModel>();
+    private NScreenDescriptor descriptor = null;
 
     public NScreenModelManager() {
     }
 
     public NScreenModel createCommonNscreen() {
         NScreenModel model = new NScreenModel(BuilderConstants.NSCREENCOMMON, NScreenType.COMMON);
-        model.setDefaultInMenu(true);
-        model.setEnableInMenu(false);
-        model.setLinkInMenu(false);
-        model.setMoveInMenu(false);
-        this.addNScreenModel(model);
+        model.setAttributes(NScreenModel.ATTRIBUTE_DEFAULT);
+        addNScreenModel(model);
         return model;
     }
 
     public boolean addNScreenModel(NScreenModel model) {
         if (isValidNscreenModel(model)) {
-            this.nscreenModels.add(model);
+            nscreenDatas.add(model);
             return true;
         }
         return false;
     }
 
     public void removeNScreenModel(NScreenModel model) {
-        this.nscreenModels.remove(model);
+        nscreenDatas.remove(model);
+    }
+
+    public boolean insertNscreenModel(NScreenModel model) {
+        if (model == null) {
+            return false;
+        }
+
+        int targetIndex = getNScreenModelIndex(model.getName());
+        if (targetIndex == -1) {
+            return addNScreenModel(model);
+        }
+
+        nscreenDatas.set(targetIndex, model);
+        return true;
     }
 
     public List<NScreenModel> getNScreenModels() {
-        return this.nscreenModels;
+        return nscreenDatas;
     }
 
     public NScreenModel getNScreenModel(String nscreenName) {
@@ -74,13 +88,13 @@ public class NScreenModelManager {
             return null;
         }
 
-        if (nscreenModels.size() == 0) {
+        if (nscreenDatas.size() == 0) {
             return null;
         }
 
-        for (int i = 0; i < nscreenModels.size(); i++) {
-            if (nscreenName.equalsIgnoreCase(this.nscreenModels.get(i).getName())) {
-                model = this.nscreenModels.get(i);
+        for (int i = 0; i < nscreenDatas.size(); i++) {
+            if (nscreenName.equalsIgnoreCase(nscreenDatas.get(i).getName())) {
+                model = nscreenDatas.get(i);
                 break;
             }
         }
@@ -88,11 +102,35 @@ public class NScreenModelManager {
         return model;
     }
 
+    public int getNScreenModelIndex(String nscreenName) {
+        if (nscreenName == null) {
+            return -1;
+        }
+
+        if (nscreenName.isEmpty()) {
+            return -1;
+        }
+
+        if (nscreenDatas.size() == 0) {
+            return -1;
+        }
+
+        int index = -1;
+        for (int i = 0; i < nscreenDatas.size(); i++) {
+            if (nscreenName.equalsIgnoreCase(nscreenDatas.get(i).getName())) {
+                index = i;
+                break;
+            }
+        }
+
+        return index;
+    }
+
     public NScreenModel getCommonNscreen() {
-        if (nscreenModels.size() == 0) {
+        if (nscreenDatas.size() == 0) {
             return createCommonNscreen();
         }
-        return this.getNScreenModel(BuilderConstants.NSCREENCOMMON);
+        return getNScreenModel(BuilderConstants.NSCREENCOMMON);
     }
 
     public boolean isValidNscreenModel(NScreenModel model) {
@@ -116,7 +154,7 @@ public class NScreenModelManager {
 
         // Common
         if (type == NScreenType.COMMON) {
-            return this.getCommonNscreen();
+            return getCommonNscreen();
         }
 
         // Orientation
@@ -141,8 +179,8 @@ public class NScreenModelManager {
             }
             double pixelRatio = (Double) object;
 
-            for (int i = 0; i < this.nscreenModels.size(); i++) {
-                model = this.nscreenModels.get(i);
+            for (int i = 0; i < nscreenDatas.size(); i++) {
+                model = nscreenDatas.get(i);
                 if (model.getType() == type) {
                     if (model.getDevicePixelRatio() == pixelRatio) {
                         retValue = model;
@@ -160,7 +198,7 @@ public class NScreenModelManager {
         NScreenModel searchModel = null;
 
         // add Common Model.
-        list.add(this.getCommonNscreen());
+        list.add(getCommonNscreen());
 
         // add Orientation
         if (device.getOrientation() != null) {
@@ -182,8 +220,8 @@ public class NScreenModelManager {
 
         // add Resolution
         if ((device.getDeviceWidth() > 0) && (device.getDeviceHeight() > 0)) {
-            for (int i = 0; i < this.nscreenModels.size(); i++) {
-                NScreenModel model = this.nscreenModels.get(i);
+            for (int i = 0; i < nscreenDatas.size(); i++) {
+                NScreenModel model = nscreenDatas.get(i);
                 if (model.getDeviceWidth() == device.getDeviceWidth()) {
                     if (model.getDeviceHeight() == device.getDeviceHeight()) {
                         list.add(model);
@@ -194,4 +232,9 @@ public class NScreenModelManager {
 
         return list;
     }
+
+    public void load(AppManager appManager) {
+        descriptor = new NScreenDescriptor(appManager);
+        descriptor.load();
+    }
 }
index 7d5852e..6116279 100644 (file)
@@ -25,7 +25,6 @@ package org.tizen.webuibuilder.model.nscreen.descriptors;
 
 import java.util.List;
 
-import org.eclipse.core.resources.IFile;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.webuibuilder.BuilderConstants;
@@ -33,31 +32,31 @@ import org.tizen.webuibuilder.model.app.AppManager;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation;
+import org.tizen.webuibuilder.model.page.PageData;
+import org.tizen.webuibuilder.model.page.PageDataSet;
 
 
 public class NScreenDescriptor {
     Logger logger = LoggerFactory.getLogger(NScreenDescriptor.class);
 
-    private AppManager appManger = null;
+    private AppManager appManager = null;
     private List<NScreenModel> list = null;
 
-    public NScreenDescriptor(AppManager appManger) {
-        this.appManger = appManger;
-        this.list = this.appManger.getNScreenModelManger().getNScreenModels();
-        load();
-    }
-
-    private void load() {
-        IFile file = appManger.getProjectManager().getProject().getFile("index.meta.xml");
-        if (file.exists()) {
-            // read metafile.
-            return;
+    public NScreenDescriptor(AppManager appManager) {
+        if (appManager != null) {
+            this.appManager = appManager;
+            this.list = this.appManager.getNScreenModelManger().getNScreenModels();
+        } else {
+            logger.info("NScreen Descriptor is null");
         }
+    }
 
+    public void load() {
         createCommonNscreen();
         // createOrientationNscreen();
         // createPixelRatioNscreen();
         createDeviceNscreen();
+        setPagesForNscreenData();
     }
 
     public void createCommonNscreen() {
@@ -79,25 +78,13 @@ public class NScreenDescriptor {
     }
 
     public void createDeviceNscreen() {
-        if (BuilderConstants.PROFILE_WEARABLE_2_3.equalsIgnoreCase(appManger.getProjectManager()
-                .getPlatform())) {
-            addNscreenModel("Wearable 320x320 (1:1)", NScreenType.RESOLUTION, null, 0, 320, 320);
-            addNscreenModel("Wearable 360x480 (3:4)", NScreenType.RESOLUTION, null, 0, 360, 480);
-            addNscreenModel("Wearable 480x360 (4:3)", NScreenType.RESOLUTION, null, 0, 480, 360);
-
-        } else if (BuilderConstants.PROFILE_MOBILE_2_3.equalsIgnoreCase(appManger
-                .getProjectManager().getPlatform())) {
-            // addNscreenModel("Mobile 320x480 (2:3)", NScreenType.RESOLUTION, null, 0, 320, 480);
-            // addNscreenModel("Mobile 480x320 (3:2)", NScreenType.RESOLUTION, null, 0, 480, 320);
-
-            addNscreenModel("Mobile 360x640 (9:16)", NScreenType.RESOLUTION, null, 0, 720, 1280);
-            addNscreenModel("Mobile 640x360 (16:9)", NScreenType.RESOLUTION, null, 0, 1280, 720);
-            addNscreenModel("Mobile 800x1280 (10:16)", NScreenType.RESOLUTION, null, 0, 800, 1280);
-            addNscreenModel("Mobile 1280x800 (16:10)", NScreenType.RESOLUTION, null, 0, 1280, 800);
-
-        } else {
-            logger.info("Not support profile :" + appManger.getProjectManager().getPlatform());
-        }
+        addNscreenModel("320x320 (1:1)", NScreenType.RESOLUTION, null, 0, 320, 320);
+        addNscreenModel("360x480 (3:4)", NScreenType.RESOLUTION, null, 0, 360, 480);
+        addNscreenModel("480x360 (4:3)", NScreenType.RESOLUTION, null, 0, 480, 360);
+        addNscreenModel("360x640 (9:16)", NScreenType.RESOLUTION, null, 0, 720, 1280);
+        addNscreenModel("640x360 (16:9)", NScreenType.RESOLUTION, null, 0, 1280, 720);
+        addNscreenModel("800x1280 (10:16)", NScreenType.RESOLUTION, null, 0, 800, 1280);
+        addNscreenModel("1280x800 (16:10)", NScreenType.RESOLUTION, null, 0, 1280, 800);
     }
 
     public void addNscreenModel(String name, NScreenType type, Orientation orientation,
@@ -141,31 +128,20 @@ public class NScreenDescriptor {
         }
 
         if (model.getType() == NScreenType.COMMON) {
-            model.setDefaultInMenu(true);
-            model.setEnableInMenu(false);
-            model.setLinkInMenu(false);
-            model.setMoveInMenu(false);
+            model.setAttributes(NScreenModel.ATTRIBUTE_DEFAULT);
         }
 
         if (model.getType() == NScreenType.ORIENTATION) {
-            model.setDefaultInMenu(false);
-            model.setEnableInMenu(true);
-            model.setLinkInMenu(false);
-            model.setMoveInMenu(false);
+            model.setAttributes(NScreenModel.ATTRIBUTE_ENABLE);
         }
 
         if (model.getType() == NScreenType.PIXELRATIO) {
-            model.setDefaultInMenu(false);
-            model.setEnableInMenu(true);
-            model.setLinkInMenu(true);
-            model.setMoveInMenu(false);
+            model.setAttributes(NScreenModel.ATTRIBUTE_ENABLE | NScreenModel.ATTRIBUTE_LINK);
         }
 
         if (model.getType() == NScreenType.RESOLUTION) {
-            model.setDefaultInMenu(false);
-            model.setEnableInMenu(true);
-            model.setLinkInMenu(true);
-            model.setMoveInMenu(true);
+            model.setAttributes(NScreenModel.ATTRIBUTE_ENABLE | NScreenModel.ATTRIBUTE_LINK
+                    | NScreenModel.ATTRIBUTE_MOVE);
         }
 
         if (model.getType() == NScreenType.CUSTOM) {
@@ -173,4 +149,37 @@ public class NScreenDescriptor {
         }
     }
 
+    private void setPagesForNscreenData() {
+        PageDataSet pageDataset = this.appManager.getPageDataSet();
+
+        if (pageDataset == null) {
+            return;
+        }
+
+        for (PageData page : pageDataset.getPages()) {
+            String name = page.getName();
+            addPageForNscreenData(name);
+
+        }
+
+    }
+
+    private void addPageForNscreenData(String pageName) {
+        if (pageName == null) {
+            return;
+        }
+
+        if (pageName.isEmpty()) {
+            return;
+        }
+
+        for (NScreenModel model : this.list) {
+            if (model.getType() == NScreenType.COMMON) {
+                model.addEnablePage(pageName);
+            } else {
+                model.addDisablePage(pageName);
+            }
+        }
+    }
+
 }
index 611f65b..8fc0788 100644 (file)
@@ -174,14 +174,14 @@ public class PageDataForHTML extends PageData {
         Element element = writeElement(part);
 
         TransformerFactory transformerFactory = TransformerFactory.newInstance();
-        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
+//        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
         Transformer transformer = null;
         try {
             transformer =
                     transformerFactory.newTransformer(new DOMSource(getDescriptorManager()
                             .getXsltDocument()));
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, BuilderConstants.YES);
-            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.NO);
+            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.YES);
             transformer.setOutputProperty(OutputKeys.ENCODING, BuilderConstants.ENCODING);
             transformer.setOutputProperty(OutputKeys.METHOD, BuilderConstants.HTML);
         } catch (TransformerConfigurationException e) {
index d0bd91d..9a3ab09 100644 (file)
@@ -59,7 +59,11 @@ public class PageDataSet {
        public List<PageData> getPages() {
                return pages;
        }
-
+       
+       public void setPages(List<PageData> pages) {
+               this.pages = pages;
+       }
+       
        public void addPage(PageData page, String path, boolean isExistsPagePart) {
                if (hasPageName(page.getName())) {
                        return;
@@ -70,7 +74,7 @@ public class PageDataSet {
                if (isExistsPagePart) {
                        Part pagePart = page.getPagePart();
                        String orgPageName = page.getName();
-                       baseRootPart.addChild(pagePart, true);
+                       baseRootPart.addChild(pagePart, false);
                        String newPageName = pagePart.getIdPropertyValue();
                        if(!orgPageName.equals(newPageName)) {
                                page.setName(newPageName);
@@ -324,33 +328,45 @@ public class PageDataSet {
                return null;
        }
        
-       public void removePage(int index) {
+       public void removePage(int index, boolean needFireEvent) {
                PageData page = getPages().get(index);
 
-               getPages().get(0).fireEvent(new PageDataEvent(PageDataEventType.PAGE_PREDELETE, getPages().get(0)/*page*/));
-               fireEvent(new PageDataSetEvent(PageDataSetEventType.PAGE_PREDELETE,
-                               page, index, null));
+               if(needFireEvent) {
+                       page.fireEvent(new PageDataEvent(PageDataEventType.PAGE_PREDELETE, page));
+                       fireEvent(new PageDataSetEvent(PageDataSetEventType.PAGE_PREDELETE,
+                                       page, index, null));
+               }
 
                pages.remove(index);
 
-               fireEvent(new PageDataSetEvent(PageDataSetEventType.PAGE_REMOVED, page,
-                               index, null));
+               if(needFireEvent) {
+                       fireEvent(new PageDataSetEvent(PageDataSetEventType.PAGE_REMOVED, page,
+                                       index, null));
+               }
        }
 
        public void removePage(PageData page) {
                int index = getPages().indexOf(page);
-               removePage(index);
+               removePage(index, true);
        }
        
        public void removePageWithPart(int index) {
                baseRootPart.removeChild(getPageByIndex(index).getPagePart(), false);
-               removePage(index);
+               removePage(index, true);
        }
 
        public void removeAllPages() {
                for (int i = pages.size() - 1; i >= 0; i--) {
-                       removePage(i);
+                       removePage(i, true);
+               }
+       }
+       
+       public void removeAllPagesWithPart() {
+               for (int i = pages.size() - 1; i >= 0; i--) {
+                       baseRootPart.removeChild(getPageByIndex(i).getPagePart(), false);
+//                     removePage(i, false);
                }
+               pages.clear();
        }
 
 }
index b5fbe04..2a3694b 100644 (file)
@@ -57,6 +57,7 @@ public class ProjectManager {
 
        private IProject project;
        private AppManager defaultAppManager = null;
+       private String platform = null;
 
        private static boolean isRegisteredPerspectiveListener = false;
 
@@ -272,8 +273,13 @@ public class ProjectManager {
             return null;
         }
 
+        if (platform != null) {
+            return this.platform;
+        }
+
         TprojectHandler th = new TprojectHandler(project);
         TizenProjectDescription tpd = th.unmarshal();
-        return tpd.getPlatformName();
+        platform = tpd.getPlatformName();
+        return this.platform;
     }
 }
index ff23e13..30d9fa1 100644 (file)
@@ -165,7 +165,6 @@ import org.tizen.webuibuilder.outline.OutlinePage;
 import org.tizen.webuibuilder.outline.OutlineRenameAction;
 import org.tizen.webuibuilder.outline.OutlineViewEditPart;
 import org.tizen.webuibuilder.pagetemplate.action.CreateTemplateAction;
-import org.tizen.webuibuilder.pagetemplate.action.CssSelecotrAction;
 import org.tizen.webuibuilder.pagetemplate.action.ExportTemplateAction;
 import org.tizen.webuibuilder.pagetemplate.action.ImportTemplateAction;
 import org.tizen.webuibuilder.pagetemplate.action.NewPageAction;
@@ -174,6 +173,7 @@ import org.tizen.webuibuilder.ui.editor.dnd.listener.TemplateTransferDropTargetL
 import org.tizen.webuibuilder.ui.editor.ruler.DesignerRuler;
 import org.tizen.webuibuilder.ui.editor.ruler.DesignerRulerProvider;
 import org.tizen.webuibuilder.ui.editor.texteditor.TextEditor;
+import org.tizen.webuibuilder.ui.selector.CssSelecotrAction;
 import org.tizen.webuibuilder.ui.views.nscreen.NScreenHistory;
 import org.tizen.webuibuilder.ui.views.nscreen.NScreenItem;
 import org.tizen.webuibuilder.ui.views.nscreen.NScreenUtil;
index 93f227c..892bad1 100644 (file)
@@ -31,7 +31,6 @@ import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
@@ -167,7 +166,7 @@ public class PageDesignerForAppXML extends PageDesigner {
                     // }
                 }
 
-                appManager.getNScreenModelManger().addNScreenModel(model);
+                appManager.getNScreenModelManger().insertNscreenModel(model);
             }
 
             setCssFileToModel(pageData.getCurrentCssFile());
index ced52dc..cefa941 100644 (file)
@@ -25,7 +25,6 @@ package org.tizen.webuibuilder.ui.editor;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.StringBufferInputStream;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -47,6 +46,7 @@ import org.tizen.webuibuilder.animator.model.AnimatorModelManager;
 import org.tizen.webuibuilder.animator.model.io.AnimatorFileWriter;
 import org.tizen.webuibuilder.animator.model.part.AnimatorPagePart;
 import org.tizen.webuibuilder.animator.model.part.AnimatorPartFactory;
+import org.tizen.webuibuilder.gef.commands.ReloadCommand;
 import org.tizen.webuibuilder.gef.viewer.HoverBrowserViewer;
 import org.tizen.webuibuilder.model.app.AppManagerForHTML;
 import org.tizen.webuibuilder.model.css.CssFile;
@@ -67,7 +67,6 @@ import org.tizen.webuibuilder.ui.editor.texteditor.TextEditorForHTML;
 import com.phloc.commons.io.file.filter.FilenameFilterEndsWith;
 
 
-@SuppressWarnings("deprecation")
 public class PageDesignerForHTML extends PageDesigner implements ITextEditorListener {
 
     public static final String ID = PageDesignerForHTML.class.getName();
@@ -126,6 +125,7 @@ public class PageDesignerForHTML extends PageDesigner implements ITextEditorList
             filePath = input.getToolTipText();
         }
 
+        appManager.getNScreenModelManger().load(appManager);
         appManager.loadFullPath(filePath);
         // HtmlMetaReader.read(appManager, "index.meta.xml");
 
@@ -304,9 +304,11 @@ public class PageDesignerForHTML extends PageDesigner implements ITextEditorList
 
     @Override
     public void contentChanged(TextEditorEvent e) {
-        ((AppManagerForHTML) appManager).load(new StringBufferInputStream(textEditor
-                .getTextViewer().getDocument().get()));
-
+        String htmlText = textEditor
+                .getTextViewer().getDocument().get();
+                                    
+        designer.getEditDomain().getCommandStack().execute(new ReloadCommand(appManager, htmlText));
+        
         if (currentPageIndex < 0) {
             if (appManager.getNumberOfPages() > 0) {
                 currentPageIndex = 0;
index 5e8aa1b..54a169f 100644 (file)
@@ -23,8 +23,8 @@
 
 package org.tizen.webuibuilder.ui.editor.texteditor;
 
+import java.io.ByteArrayInputStream;
 import java.io.InputStream;
-import java.io.StringBufferInputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -54,7 +54,7 @@ import org.tizen.webuibuilder.model.page.PageData;
 import org.tizen.webuibuilder.ui.editor.MemoryEditorInput;
 
 
-@SuppressWarnings({ "deprecation", "restriction" })
+@SuppressWarnings({ "restriction" })
 public class TextEditor extends StructuredTextEditor implements IPartListener, FocusListener {
     public static final String ID = TextEditor.class.getName();
 
@@ -73,7 +73,7 @@ public class TextEditor extends StructuredTextEditor implements IPartListener, F
         this.appManager = appManager;
 
         code = BuilderConstants.EMPTY;
-        inputstream = new StringBufferInputStream(code);
+        inputstream = new ByteArrayInputStream(code.getBytes());
 
         IEditorInput edInput = new MemoryEditorInput("MemFile", inputstream);
         try {
@@ -172,12 +172,12 @@ public class TextEditor extends StructuredTextEditor implements IPartListener, F
     public void prepareToShow(String code) {
         this.code = code;
 
-        inputstream = new StringBufferInputStream(code);
+        inputstream = new ByteArrayInputStream(code.getBytes());
 
         IEditorInput edInput = new MemoryEditorInput("MemFile", inputstream);
         setInput(edInput);
     }
-
+    
     public ISourceViewer getSourceViewer2() {
         return getSourceViewer();
     }
@@ -254,7 +254,9 @@ public class TextEditor extends StructuredTextEditor implements IPartListener, F
     }
 
     private BasicCommandStack getBasicCommandStack() {
+    
         IDocument doc = getDocumentProvider().getDocument(getEditorInput());
+        
         if (doc instanceof IStructuredDocument) {
             IStructuredTextUndoManager manager = ((IStructuredDocument) doc).getUndoManager();
             org.eclipse.emf.common.command.CommandStack stack = manager.getCommandStack();
index 43f8cbb..0eb22da 100644 (file)
@@ -80,7 +80,7 @@ public class CSSSelectorDialog extends BaseMessageBox {
 
             SelectorElement se = (SelectorElement) selected.getData();
 
-            if (null == goingBridge) {
+            if (null == goingBridge || null == se) {
                 return;
             }
             String id = null;
@@ -1,9 +1,10 @@
 
 
-package org.tizen.webuibuilder.pagetemplate.action;
+package org.tizen.webuibuilder.ui.selector;
 
 import java.util.List;
 
+import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.commands.Command;
@@ -20,8 +21,6 @@ import org.tizen.webuibuilder.model.Part;
 import org.tizen.webuibuilder.ui.actions.WebUIBuilderActionConstants;
 import org.tizen.webuibuilder.ui.contextmenu.Messages;
 import org.tizen.webuibuilder.ui.editor.PageDesigner;
-import org.tizen.webuibuilder.ui.selector.CSSSelectorDialog;
-import org.tizen.webuibuilder.ui.selector.CSSSelectorUtil;
 
 
 public class CssSelecotrAction extends SelectionAction {
@@ -50,8 +49,8 @@ public class CssSelecotrAction extends SelectionAction {
                 EditPart editpart = (EditPart) object;
                 Object model = editpart.getModel();
 
-                if (!(model instanceof Part) || ((Part)model).isDocumentPart()) {
-                    enabled =  false;
+                if (!(model instanceof Part) || ((Part) model).isDocumentPart()) {
+                    enabled = false;
                     break;
                 }
             }
@@ -71,20 +70,24 @@ public class CssSelecotrAction extends SelectionAction {
             DesignerEditPart selectionDesignerPart = selectionParts.get(0);
             Control control = designEditPartViewer.getControl();
 
-            Rectangle rect = selectionDesignerPart.getFigure().getBounds();
-
             Part part = (Part) selectionDesignerPart.getModel();
             String id = part.getIdPropertyValue();
 
+            Rectangle rect = selectionDesignerPart.getFigure().getBounds();
             org.eclipse.swt.graphics.Point p = control.toDisplay(rect.x, rect.y);
 
-            int x = p.x + rect.width, y = p.y;
+            Figure f = (Figure) designEditPartViewer.getCurrentPage().getFigure();
+            Rectangle fr = f.getBounds();
+            Rectangle frc = fr.getCopy();
+            f.translateToAbsolute(frc);
 
             Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-
             CSSSelectorDialog selector = new CSSSelectorDialog(shell, id);
             selector.setGoingBridge(designEditPartViewer.getGoingBridge());
 
+            // 5 means margin between figure and dialog
+            int x = p.x + rect.width + frc.x + 5, y = p.y;
+
             selector.setPosition(x, y);
             String obj = (String) selector.open();
             if (obj == null || obj.isEmpty()) {
@@ -95,8 +98,7 @@ public class CssSelecotrAction extends SelectionAction {
 
             CommandStack commandStack = designEditPartViewer.getEditDomain().getCommandStack();
             Command command =
-                    new CreateCssSelectorCommand(designEditPartViewer.getPageData(),
-                             part, result);
+                    new CreateCssSelectorCommand(part, designEditPartViewer.getPageData(), result);
             commandStack.execute(command);
         }
     }
index 459fd21..e2d2cbb 100644 (file)
@@ -1121,8 +1121,8 @@ public class DataBindingPage extends Page implements IBindingDataSetListener {
         editDataModelAction = new EditDataSourceAction("EDIT", dataBindingView);
         addViewModelAction = new AddViewModelAction("ADD", dataBindingView);
         addViewModelItemAction = new AddViewModelItemAction("ADD ITEM", dataBindingView);
-        setTargetAction = new SetTargetAction("SET TARGET", dataBindingView);
-        getSourceAction = new GetSourceAction("GET SOURCE", dataBindingView);
+//        setTargetAction = new SetTargetAction("SET TARGET", dataBindingView);
+//        getSourceAction = new GetSourceAction("GET SOURCE", dataBindingView);
 
         addDataSourceAction = new AddDataSourceAction("ADD", dataBindingView);
         removeDataSourceAction = new RemoveDataSourceAction("REMOVE", dataBindingView);
@@ -1231,8 +1231,8 @@ public class DataBindingPage extends Page implements IBindingDataSetListener {
         ToolBar toolBar = new ToolBar(panel, SWT.FLAT);
         viewModelToolBarManager = new ToolBarManager(toolBar);
 
-        viewModelToolBarManager.add(setTargetAction);
-        viewModelToolBarManager.add(getSourceAction);
+//        viewModelToolBarManager.add(setTargetAction);
+//        viewModelToolBarManager.add(getSourceAction);
         viewModelToolBarManager.add(removeViewModelAction);
         viewModelToolBarManager.add(addViewModelItemAction);
         viewModelToolBarManager.add(addViewModelAction);
@@ -1243,8 +1243,8 @@ public class DataBindingPage extends Page implements IBindingDataSetListener {
 
     private void makeViewModelContextMenu() {
         viewModelMenuManager = new MenuManager("#viewModelMenu");
-        viewModelMenuManager.add(setTargetAction);
-        viewModelMenuManager.add(getSourceAction);
+//        viewModelMenuManager.add(setTargetAction);
+//        viewModelMenuManager.add(getSourceAction);
         viewModelMenuManager.add(removeViewModelAction);
         viewModelMenuManager.add(addViewModelItemAction);
         viewModelMenuManager.add(addViewModelAction);
@@ -1259,7 +1259,7 @@ public class DataBindingPage extends Page implements IBindingDataSetListener {
         ToolBar toolBar = new ToolBar(panel, SWT.FLAT);
         bindingInfoToolBarManager = new ToolBarManager(toolBar);
 
-        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif");
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_SHOW_ICON);
         ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
         Action showBindingInfoAction = new Action("show data binding info", imgDesc) {
 
@@ -1268,10 +1268,10 @@ public class DataBindingPage extends Page implements IBindingDataSetListener {
                 pageDesigner.getViewer().showBindingInfo(showBindInfo);
                 Image img = null;
                 if (showBindInfo) {
-                    img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "hide_bind.gif");
+                    img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_HIDE_ICON);
                     setText("hide data binding info");
                 } else {
-                    img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif");
+                    img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_SHOW_ICON);
                     setText("show data binding info");
                 }
                 ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
index 96bdecf..5227edd 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 
 public class AddDataSourceAction extends SelectionAction {
@@ -44,8 +46,9 @@ public class AddDataSourceAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_OBJ_ADD));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_DATASOURCE_ADD_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     @Override
index 40855b6..d3b0916 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 
 public class AddViewModelAction extends SelectionAction {
@@ -45,8 +47,9 @@ public class AddViewModelAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_OBJ_ADD));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_VIEWMODEL_ADD_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     @Override
index 16275af..46f2caa 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 public class AddViewModelItemAction extends SelectionAction {
 
@@ -44,8 +46,9 @@ public class AddViewModelItemAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_OBJ_ADD));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_VIEWMODELITEM_ADD_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     @Override
index edbc938..e87f97d 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
 import org.tizen.webuibuilder.ui.views.databinding.dialog.SetSourcePage;
 import org.tizen.webuibuilder.ui.views.databinding.model.BindingData;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 
 public class EditDataSourceAction extends SelectionAction {
@@ -50,8 +52,9 @@ public class EditDataSourceAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_DATASOURCE_DIALOG_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     private TreeItem getSelectedTreeItem() {
index cb9c329..2848362 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 public class RemoveBindingInfoAction extends SelectionAction {
 
@@ -37,8 +39,9 @@ public class RemoveBindingInfoAction extends SelectionAction {
                super(null);
                setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_DELETE_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
        }
 
        @Override
index e059ed4..76a080c 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 
 public class RemoveDataSourceAction extends SelectionAction {
@@ -45,8 +47,9 @@ public class RemoveDataSourceAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_DELETE_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     @Override
index 66ca987..6888d80 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 
 public class RemoveViewModelAction extends SelectionAction {
@@ -45,8 +47,9 @@ public class RemoveViewModelAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_DELETE_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
     @Override
index ebd149f..939d84c 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 public class RenameDataSourceAction extends SelectionAction {
        
@@ -43,8 +47,9 @@ public class RenameDataSourceAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-//        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-//                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_RENAME_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
     
     private TreeItem getSelectedTreeItem() {
index ddd5f5c..8188607 100644 (file)
 package org.tizen.webuibuilder.ui.views.databinding.actions;
 
 import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
 import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+import org.tizen.webuibuilder.utility.ResourceManager;
 
 public class RenameViewModelAction extends SelectionAction {
        
@@ -43,8 +47,9 @@ public class RenameViewModelAction extends SelectionAction {
         super(null);
         setText(text);
         this.view = view;
-//        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
-//                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+        Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, BuilderConstants.DATABINDING_RENAME_ICON);
+        ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+        setImageDescriptor(imgDesc);
     }
 
        private TreeItem getSelectedTreeItem() {
index 78d0c9d..9893f88 100644 (file)
@@ -212,6 +212,10 @@ public class SetSourcePage extends Dialog {
             public void widgetSelected( SelectionEvent event ) {
                 
                 BindingData dataModel = currentSubPage.getData();
+                
+                if( dataModel == null )
+                    return;
+                
                 dataModel.setModelType( dataTypeCombo.getText() );
                 dataModel.setUpdateOnStartup( updateOnStartUp.getSelection() );
                 dataModel.setSourceName( dataSourceTreeItem.getText() );
@@ -308,8 +312,6 @@ public class SetSourcePage extends Dialog {
         dataTypeCombo.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
 
-                currentSubPage.setButtonsState(dataButtonMap);
-                
                 for (Control control : dialogTree.getChildren()) {
                     control.dispose();
                 }
@@ -317,6 +319,8 @@ public class SetSourcePage extends Dialog {
                 dialogTree.removeAll();
                 
                 initByType();
+                
+                currentSubPage.setButtonsState(dataButtonMap);
             }
         });
 
@@ -477,7 +481,6 @@ public class SetSourcePage extends Dialog {
         addTreeItemButton.setText("A");
         addTreeItemButton.setToolTipText("Add");
         
-        data = new FormData();
         data = new FormData(25, 25);
         data.top = new FormAttachment(expandAllButton, 2);
         data.right = new FormAttachment(100, 0);
@@ -770,8 +773,6 @@ public class SetSourcePage extends Dialog {
             }
         });
 
-//        DataBindingDnDManager.addDragAndDropListenerToTree( dialogTree );
-        
         Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
         int operations = DND.DROP_MOVE | DND.DROP_LINK;
 
@@ -782,7 +783,7 @@ public class SetSourcePage extends Dialog {
         source.addDragListener( new DragSourceListener() {
             public void dragStart( DragSourceEvent event ) {
                 
-                if( !( currentSubPage instanceof StaticSubPage ) ){
+                if( !( currentSubPage instanceof StaticSubPage || currentSubPage instanceof RemoteCallSubPage ) ){
                     event.detail = DND.DROP_NONE;
                     event.doit = false;
                     return;
@@ -974,20 +975,28 @@ public class SetSourcePage extends Dialog {
             return;
         }
         
+        if( currentSubPage instanceof StaticSubPage && staticSubPage.getCurrentType().equals( "XML" ) && dialogTree.getItemCount() > 0 && parentItem == null ){
+            return;
+        }
+        
         TreeItem item;
         int index = 0;
         
+        String type = "String";
+        String value = "data";
+        
         if (parentItem == null) {
             item = new TreeItem(dialogTree, SWT.NONE);
             index = dialogTree.getItemCount();
+            type = "Object";
+            value = "";
         } else {
             item = new TreeItem(parentItem, SWT.NONE);
             index = parentItem.getItemCount();
+            value += index;
         }
         
         String key = "key" + index;
-        String value = "data" + index;
-        String type = "String";
         
         if( parentItem != null && currentSubPage instanceof StaticSubPage && parentItem.getText(2).equals("Array") ){
             type = "Index";
@@ -1005,7 +1014,7 @@ public class SetSourcePage extends Dialog {
         item.setData("TREEITEMDATA", treeItemData);
         
         if( !type.equals("Index") )
-            Helper.addComboInTreeItem(item, "String");
+            Helper.addComboInTreeItem(item, type);
         
         dialogTree.showItem(item);
         
@@ -1052,7 +1061,7 @@ public class SetSourcePage extends Dialog {
         }
         TreeItemData data = (TreeItemData) treeItem.getData( "TREEITEMDATA" );
         
-        if( data != null && data.getSource().equals( "original" ) )
+        if( data != null && data.getSource().equals( "original" ) && currentSubPage instanceof RemoteCallSubPage )
             return;
 
         TreeEditor editor = (TreeEditor) treeItem.getData("TREEEDITORFORCOMBO");
index b6b0281..95aa828 100644 (file)
@@ -31,6 +31,7 @@ import java.util.Arrays;
 import java.util.Map;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ST;
 import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.events.ModifyEvent;
@@ -49,6 +50,7 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.IEditorSite;
@@ -59,6 +61,7 @@ import org.eclipse.ui.internal.EditorReference;
 import org.eclipse.ui.internal.EditorSite;
 import org.eclipse.ui.internal.WorkbenchPage;
 import org.eclipse.ui.internal.registry.EditorDescriptor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor;
 import org.tizen.webuibuilder.ui.editor.MemoryEditorInput;
 import org.tizen.webuibuilder.ui.editor.PageDesigner;
@@ -82,6 +85,7 @@ public class StaticSubPage implements SourceDialogSubPage {
     private Combo typeCombo;
 
     private String jsonFile;
+    private String temp;
     private static Gson prettyGson;
     private static Gson normalGson;
 
@@ -102,6 +106,23 @@ public class StaticSubPage implements SourceDialogSubPage {
     public BindingData getData() {
         BindingData dataModel = new BindingData();
 
+        Object obj = null;
+        
+        try{
+            if ( typeCombo.getSelectionIndex() == 0 )
+                obj = normalGson.fromJson( staticSourceStyledText.getText(), JsonObject.class );
+            else
+                obj = Helper.parseXML( staticSourceStyledText.getText()  );
+        }catch(Exception e){}
+
+        if( obj == null ){
+            MessageBox messageBox = new MessageBox(staticSourceStyledText.getShell(), SWT.ICON_ERROR);
+            messageBox.setText( "Set Source Error" );
+            messageBox.setMessage("Error : Data is invalid.");
+            messageBox.open();
+            return null;
+        }
+        
         JsonObject root = new JsonObject();
         TreeItem[] items = parentDataTree.getItems();
         for ( TreeItem item : items ) {
@@ -270,19 +291,31 @@ public class StaticSubPage implements SourceDialogSubPage {
                     if ( typeCombo.getSelectionIndex() == 0 ){
                         jo = Helper.getJsonFromXML( source );
                     }else{
+                        temp = staticSourceStyledText.getText();
                         jo = prettyGson.fromJson( source, JsonObject.class );
                     }
                     
                     if( jo == null ) return;
                     
-                    if ( typeCombo.getSelectionIndex() == 0 )
-                        result = prettyGson.toJson( jo );
-                    else
-                        result = Helper.getStringFromDocument( Helper.getXMLFromJson( null, null, jo ), true );   
+                    if ( typeCombo.getSelectionIndex() == 0 ){
+                        if(temp == null)
+                            result = prettyGson.toJson( jo );
+                        else
+                            result = temp; 
+                    } else {
+                        result = Helper.getStringFromDocument( Helper.getXMLFromJson( null, null, jo ), true );
+                    }
                 }catch(Exception e){
                     e.printStackTrace();
                 }
-                staticSourceStyledText.setText(  result );
+                if( result.length() == 0 ){
+                    staticSourceStyledText.setText( result );
+                }else{
+                    staticSourceStyledText.setData( "editing", true );
+                    staticSourceStyledText.setText( result );
+                    staticSourceStyledText.setData( "editing", false );
+                }
+                
             }
         });
 
@@ -439,17 +472,20 @@ public class StaticSubPage implements SourceDialogSubPage {
         }
 
         editor.createPartControl( composite );
-
+        
+        editor.setActionActivationCode( ITextEditorActionConstants.GROUP_UNDO, 'Z', SWT.CONTROL, SWT.DEFAULT );
         staticSourceStyledText = editor.getViewer().getTextWidget();
 
         staticSourceStyledText.setData( "editing", false );
 
+        staticSourceStyledText.setKeyBinding( SWT.DEL, ST.DELETE_NEXT );
+        
         staticSourceStyledText.addModifyListener( new ModifyListener() {
             @Override
             public void modifyText( ModifyEvent e ) {
 
                 String inputText = staticSourceStyledText.getText();
-
+                
                 if ( staticSourceStyledText.getData( "editing" ) != null
                         && (Boolean) staticSourceStyledText.getData( "editing" ) )
                     return;
@@ -462,6 +498,8 @@ public class StaticSubPage implements SourceDialogSubPage {
                     return;
                 }
 
+                temp = null;
+                
                 JsonObject json = null;
                 try {
 
@@ -474,15 +512,36 @@ public class StaticSubPage implements SourceDialogSubPage {
                 }
 
                 if ( json != null ) {
-                    for ( Control control : parentDataTree.getChildren() ) {
-                        control.dispose();
-                    }
-                    parentDataTree.removeAll();
-                    Helper.makeTreeItem( json, parentDataTree, null, true );
+                    TreeRefreshTask task = new TreeRefreshTask(json);
+                    parentDataTree.setData( "LAST_TASK", task );
+                    parentDataTree.getDisplay().timerExec( 600, task );
+                    
+                    
                 }
             }
         } );
     }
+    
+    class TreeRefreshTask implements Runnable {
+        
+        private JsonObject taskJson;
+        
+        TreeRefreshTask(JsonObject taskJson){
+            this.taskJson = taskJson;
+        }
+        
+        public void run() {
+            if( !parentDataTree.getData( "LAST_TASK").equals( this ) )
+                return;
+            
+            for ( Control control : parentDataTree.getChildren() ) {
+                control.dispose();
+            }
+            
+            parentDataTree.removeAll();
+            Helper.makeTreeItem( taskJson, parentDataTree, null, true );
+        }
+    };
 
     @Override
     public void setButtonsState( Map<String, Button> dataButtonMap ) {
@@ -531,6 +590,7 @@ public class StaticSubPage implements SourceDialogSubPage {
             }
 
             staticSourceStyledText.setData( "editing", true );
+            temp = null;
             try{
                 if ( typeCombo.getSelectionIndex() == 0 )
                     staticSourceStyledText.setText( prettyGson.toJson( root ) );
@@ -549,4 +609,8 @@ public class StaticSubPage implements SourceDialogSubPage {
             staticSourceStyledText.setData( "editing", false );
         }
     }
+    
+    public String getCurrentType(){
+        return typeCombo.getText();
+    }
 }
index 41f0238..623853c 100644 (file)
@@ -148,12 +148,12 @@ public class NScreenItem extends Composite {
                     // }
                     // }
                     if (model.getType() != NScreenType.PIXELRATIO) {
-                        if (index > 0 && !model.isLinked(getPageId()) && !isRoot()) {
-                            menu.getItem(MENU_MOVE_UP).setEnabled(true);
-                        }
-                        if (index < size - 1 && !model.isLinked(getPageId()) && !isRoot()) {
-                            menu.getItem(MENU_MOVE_DOWN).setEnabled(true);
-                        }
+//                        if (index > 0 && !model.isLinked(getPageId()) && !isRoot()) {
+//                            menu.getItem(MENU_MOVE_UP).setEnabled(true);
+//                        }
+//                        if (index < size - 1 && !model.isLinked(getPageId()) && !isRoot()) {
+//                            menu.getItem(MENU_MOVE_DOWN).setEnabled(true);
+//                        }
                     }
                 }
             }
@@ -311,19 +311,19 @@ public class NScreenItem extends Composite {
     }
 
     public void moveUpAction() {
-        int index = parent.getItems().indexOf(this);
-        if (index != 0 && isItemEnabled() && !isLinked() && !isRoot()) {
-            Command command = new NScreenMoveUpCommand(this);
-            parent.getNScreenPageModel().getPageDesigner().getCommandStack().execute(command);
-        }
+//        int index = parent.getItems().indexOf(this);
+//        if (index != 0 && isItemEnabled() && !isLinked() && !isRoot()) {
+//            Command command = new NScreenMoveUpCommand(this);
+//            parent.getNScreenPageModel().getPageDesigner().getCommandStack().execute(command);
+//        }
     }
 
     public void moveDownAction() {
-        int index = parent.getItems().indexOf(this);
-        if (index < parent.getItems().size() - 1 && isItemEnabled() && !isLinked() && !isRoot()) {
-            Command command = new NScreenMoveDownCommand(this);
-            parent.getNScreenPageModel().getPageDesigner().getCommandStack().execute(command);
-        }
+//        int index = parent.getItems().indexOf(this);
+//        if (index < parent.getItems().size() - 1 && isItemEnabled() && !isLinked() && !isRoot()) {
+//            Command command = new NScreenMoveDownCommand(this);
+//            parent.getNScreenPageModel().getPageDesigner().getCommandStack().execute(command);
+//        }
     }
 
     public void LinkCutAction() {
index c4e1e5d..566a700 100644 (file)
@@ -48,11 +48,11 @@ public class FoldingComposite extends Composite {
             if (selection) {
                 selection = false;
                 toggle.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                         "resolution_value.png"));
+                                                         PropertiesConstant.SECOND_FOLDING_CLOSED));
                 setClientVisible(false);
             } else {
                 selection = true;
-                toggle.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR, "go.png"));
+                toggle.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR, PropertiesConstant.SECOND_FOLDING_OPENED));
 
                 setClientVisible(true);
             }
@@ -109,7 +109,7 @@ public class FoldingComposite extends Composite {
 
         // toggle
         toggle = new Label(toggleComposite, SWT.NONE);
-        toggle.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR, "resolution_value.png"));
+        toggle.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR, "second_folding_closed.png"));
         GridData data = new GridData(SWT.CENTER, SWT.CENTER, true, false);
         toggle.setLayoutData(data);
 
index 3f75a64..bedfc63 100644 (file)
@@ -114,12 +114,26 @@ public class PropertiesConstant {
     public static final int STYLE_PROPERTY_COLUMN_SIZE = 150;
     public static final int STYLE_VALUE_COLUMN_SIZE = 150;
 
+    public static final int ATTRIBUTES_MIN_WIDTH_SIZE = 200;
+    public static final int ACTION_MIN_WIDTH_SIZE = 260;
+    public static final int STYLE_MIN_WIDTH_SIZE = 350;
     public static final String STYLE_STANDARD_VIEW = "Standard view"; //$NON-NLS-1$
     public static final String STYLE_CATEGORY_VIEW = "Category view"; //$NON-NLS-1$
 
     public static final String STYLE_STANDARD_IMAGE_PATH = "style_standard_view.png"; //$NON-NLS-1$
     public static final String STYLE_CATEGORY_IMAGE_PATH = "style_category_view.png"; //$NON-NLS-1$
-
+    
+    public static final String CSS_SELECTOR_ADD = "Add CSS Selector"; //$NON-NLS-1$
+    public static final String CSS_SELECTOR_REMOVE = "Remove CSS Selector"; //$NON-NLS-1$
+    public static final String CSS_SELECTOR_RESET = "Reset CSS Selector"; //$NON-NLS-1$
+    
+    public static final String CSS_SELECTOR_ADD_IMAGE_PATH = "add_css_selector_nml.png"; //$NON-NLS-1$
+    public static final String CSS_SELECTOR_REMOVE_IMAGE_PATH = "remove_css_selector_nml.png"; //$NON-NLS-1$
+    public static final String CSS_SELECTOR_RESET_IMAGE_PATH = "reset_css_selector_nml.png"; //$NON-NLS-1$
+    
+    public static final String SECOND_FOLDING_CLOSED = "second_folding_closed.png"; //$NON-NLS-1$
+    public static final String SECOND_FOLDING_OPENED = "second_folding_opened.png"; //$NON-NLS-1$
+    
     public static final String STYLE_NO_WIDGET = "No widget is selected"; //$NON-NLS-1$
     public static final String TEXT_NONE = "None"; //$NON-NLS-1$
     public static final String NONE = "(" + TEXT_NONE + ")"; //$NON-NLS-1$
index 774e393..f952729 100644 (file)
@@ -228,6 +228,9 @@ public abstract class PropertiesTabItem extends CTabItem {
         return extendControl;
     }
 
+    protected ScrolledComposite getScrolledComposite() {
+        return scrolledComposite;
+    }
     /**
      * Resize the {@link ScrolledComposite} on this item.
      */
index 8f35a05..6c9d12d 100644 (file)
@@ -29,6 +29,7 @@ import java.util.List;
 import org.eclipse.gef.commands.CommandStack;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.events.ControlAdapter;
 import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.layout.FormAttachment;
@@ -129,6 +130,11 @@ public class ActionTab extends PropertiesTabItem {
             model.removePartListener(delegater);
         }
     }
+    
+    protected void resizeScrolledComposite() {
+        ScrolledComposite scrolledComposite = getScrolledComposite();
+        scrolledComposite.setMinSize(content.computeSize(PropertiesConstant.ACTION_MIN_WIDTH_SIZE, SWT.DEFAULT));
+    }
 
     /**
      * initialize layout and composite
index aad3924..423484f 100644 (file)
@@ -29,6 +29,7 @@ import java.util.List;
 import org.eclipse.gef.commands.CommandStack;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
@@ -111,6 +112,11 @@ public class AttributesTab extends PropertiesTabItem {
             model.removeCssListener(delegater);
         }
     }
+    
+    protected void resizeScrolledComposite() {
+        ScrolledComposite scrolledComposite = getScrolledComposite();
+        scrolledComposite.setMinSize(content.computeSize(PropertiesConstant.ATTRIBUTES_MIN_WIDTH_SIZE, SWT.DEFAULT));
+    }
 
     private void clear() {
         for (CategoryComposite category : categories) {
index dbe5ad9..8aa126d 100644 (file)
@@ -102,14 +102,12 @@ public class BorderMethod extends GroupMethod {
                 FormData data = new FormData();
                 if (index == 0) {
                     data.left = new FormAttachment(0, 0);
-                    data.width = 40;
+                    data.width = 30;
                 } else if (index == 1) {
                     data.left = new FormAttachment(methods.get(0), 3);
                     data.right = new FormAttachment(50, 0);
-                    method.setControlRightData(75, 0);
                 } else if (index == 2) {
                     data.left = new FormAttachment(methods.get(1), 3);
-                    // data.width = 80;
                     data.right = new FormAttachment(100, 0);
                     method.setControlRightData(100, 0);
                 }
index 90bd74d..9202022 100644 (file)
@@ -49,8 +49,7 @@ public class ComboMethod extends Method {
 
         @Override
         public void widgetSelected(SelectionEvent e) {
-            ConstantDescriptor item = items.get(((Combo) getControl()).getSelectionIndex());
-            setValue(item.getValue());
+            selectedCombo();
         }
     };
 
@@ -80,6 +79,16 @@ public class ComboMethod extends Method {
     }
 
     @Override
+    public void dispose() {
+        Combo combo = (Combo) getControl();
+        if (combo != null && !combo.isDisposed()) {
+            combo.removeSelectionListener(comboListener);
+        }
+        
+        super.dispose();
+    }
+    
+    @Override
     protected Control createControl() {
         // CCombo combo = MethodUtil.createCombo(this);
         Combo combo = new Combo(this, SWT.DROP_DOWN);
@@ -130,5 +139,10 @@ public class ComboMethod extends Method {
     protected List<ConstantDescriptor> getComboItems() {
         return items;
     }
+    
+    protected void selectedCombo() {
+        ConstantDescriptor item = items.get(((Combo) getControl()).getSelectionIndex());
+        setValue(item.getValue());
+    }
 
 }
index d8500d4..18b9210 100644 (file)
@@ -172,17 +172,16 @@ public class GroupMethod extends Method implements IGroupMethod, IValueChangeLis
 
                 if (methodSize % 2 == 0) {
                     data.left = new FormAttachment(0, 0);
-                    data.right = new FormAttachment(49, 0);
+                    data.right = new FormAttachment(50, 0);
                 } else {
-                    data.left = new FormAttachment(51, 0);
+                    data.left = new FormAttachment(50, 5);
                     data.right = new FormAttachment(100, 0);
                 }
                 data.height = 25;
                 // GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
-                method.setControlRightData(80, 0);
+                method.setControlRightData(100, 0);
                 method.setLayoutData(data);
                 method.setValueChangedListener(this);
-                method.setLabelRightData(25, 0);
                 methods.add(method);
             }
 
index e6c4bbd..bea8d72 100644 (file)
@@ -52,7 +52,7 @@ import org.tizen.webuibuilder.model.descriptors.UnitDescriptor;
  */
 public class IntegerMethod extends Method {
 
-    private String currentUnit;
+    private String currentUnit = BuilderConstants.EMPTY;
     private List<ConstantDescriptor> units;
     private Label unitLabel;
     private MenuItem menuItemUnit;
diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/IntegerStyleMethod.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/properties/method/IntegerStyleMethod.java
new file mode 100644 (file)
index 0000000..c4fb4f9
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * UI Builder
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.webuibuilder.ui.views.properties.method;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.model.descriptors.ConstantDescriptor;
+
+public class IntegerStyleMethod extends ComboMethod {
+
+    private Combo combo;
+    public IntegerStyleMethod(Composite parent, int style, MethodType type, String name,
+            String value, String displayName, boolean hasFunc) {
+        super(parent, style, type, name, value, displayName, hasFunc);
+    }
+
+    @Override
+    protected Control createControl() {
+        combo = new Combo(this, SWT.BORDER);
+
+        Listener comboListener = MethodUtil.createSizeComboListener(this, 1);
+        combo.addListener(SWT.Traverse, comboListener);
+        combo.addListener(SWT.FocusIn, comboListener);
+        combo.addListener(SWT.FocusOut, comboListener);
+        combo.addListener(SWT.MouseDown, comboListener);
+        combo.addListener(SWT.MouseUp, comboListener);
+        combo.addListener(SWT.MouseDoubleClick, comboListener);
+        combo.addListener(SWT.MouseMove, comboListener);
+        combo.addListener(SWT.Selection, comboListener);
+        
+        return combo;
+    }
+
+    protected void selectedCombo() {
+        List<ConstantDescriptor> items = getComboItems();
+        int index = combo.getSelectionIndex();
+        String value = BuilderConstants.EMPTY;
+        
+        if (index > 0) {
+            ConstantDescriptor item = items.get(index);
+            value = item.getValue();
+        } else {
+           return;
+        }
+        
+        setValue(value);
+    }
+    
+    @Override
+    public void setValue(String value) {
+        if (getValue().equals(value)) {
+            return;
+        }
+        if (value == null) {
+            value = BuilderConstants.EMPTY;
+        } 
+        super.setValue(value);
+    }
+    
+    @Override
+    public void refreshValue(String name, String value) {
+        if (value == null || value.isEmpty()) {
+            value = getDefaultValue();
+        }
+        combo.setText(value);
+        super.refreshValue(name, value);
+    }
+}
index 45f3b0d..77466a1 100644 (file)
@@ -245,6 +245,12 @@ public class MethodCreationFactory {
             }
                 break;
             case SIZE_INTEGER:
+                List<ConstantDescriptor> items =
+                property.getTypeDescriptor().getAvailableConstant();
+                IntegerStyleMethod intStyleMethod = new IntegerStyleMethod(parent, SWT.NONE, methodType, name, value, displayName, hasFunc);
+                intStyleMethod.setItems(items);
+                method = intStyleMethod;
+                break;
             case SIZE_PIXEL:
             case SIZE_ANGLE:
             case SIZE: {
index 3241287..6f2e077 100644 (file)
@@ -385,14 +385,14 @@ public class MethodUtil {
             private boolean hasFocus = false;
             private boolean hadFocusOnMousedown = false;
             private Point mousePt = null;
+            private boolean moveFlag = false;
 
             @Override
             public void handleEvent(Event event) {
-                Combo combo = (Combo) event.widget;
-
-                if (combo != method.getControl()) {
+                if (!(event.widget instanceof Combo)) {
                     return;
                 }
+                Combo combo = (Combo) event.widget;
 
                 switch (event.type) {
                     case SWT.Traverse:
@@ -424,31 +424,39 @@ public class MethodUtil {
                         hadFocusOnMousedown = hasFocus;
                         break;
                     case SWT.MouseUp:
-                        if (mousePt != null) {
+                        if (mousePt != null && moveFlag) {
                             mousePt = null;
+                            moveFlag = false;
                             method.setValue(combo.getText());
                         }
-                        if (!hadFocusOnMousedown) {
-                            combo.setFocus();
-                            // text.selectAll();
-                        }
+                        hadFocusOnMousedown = false;
+//                        if (!hadFocusOnMousedown) {
+//                            combo.setFocus();
+//                            // text.selectAll();
+//                        }
                         break;
                     case SWT.MouseDoubleClick:
                         method.setValue(combo.getText());
                         break;
                     case SWT.MouseMove: {
                         if (hadFocusOnMousedown) {
+                            moveFlag = true;
                             // long startTime = System.nanoTime();
                             if (combo != null && combo.getText() != null && mousePt != null) {
                                 double valueDouble = 0;
-                                if (!combo.getText().equals(BuilderConstants.EMPTY)
-                                        && !combo.getText().equals(Constants.auto)) {
-                                    try {
-                                        valueDouble = Double.parseDouble(combo.getText());
-                                    } catch (Exception e) {
-                                        break;
-                                    }
+                                String text = combo.getText();
+                                if (!text.isEmpty() && text.matches(BuilderConstants.FLOATVALUE)) {
+                                    valueDouble = Double.parseDouble(combo.getText());
                                 }
+                                    
+//                                if (!combo.getText().equals(BuilderConstants.EMPTY)
+//                                        && !combo.getText().equals(Constants.auto)) {
+//                                    try {
+//                                        valueDouble = Double.parseDouble(combo.getText());
+//                                    } catch (Exception e) {
+//                                        break;
+//                                    }
+//                                }
                                 if (mousePt.y - Constants.countPerPx > event.y) {
                                     double result = valueDouble + increment;
                                     int intValue = (int) result;
@@ -481,7 +489,7 @@ public class MethodUtil {
                         break;
 
                     case SWT.Selection: {
-                        method.setValue(combo.getText(), true);
+                        method.setValue(combo.getText());
                         // because not validate from combo box value
                     }
                         break;
index 77dc46e..8bb4570 100644 (file)
@@ -26,8 +26,6 @@ package org.tizen.webuibuilder.ui.views.properties.method;
 import java.util.List;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -36,6 +34,7 @@ import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -43,10 +42,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.tizen.webuibuilder.BuilderConstants;
-import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
 import org.tizen.webuibuilder.animator.utils.Constants;
 import org.tizen.webuibuilder.model.descriptors.ConstantDescriptor;
 import org.tizen.webuibuilder.model.descriptors.TypeDescriptor;
@@ -58,8 +54,9 @@ import org.tizen.webuibuilder.model.descriptors.UnitDescriptor;
  */
 public class SizeMethod extends Method {
 
-    private String currentUnit;
+    private String currentUnit = BuilderConstants.EMPTY;
     private List<ConstantDescriptor> units;
+    private Combo combo;
     private Label unitLabel;
 
     /**
@@ -84,7 +81,6 @@ public class SizeMethod extends Method {
      */
     public SizeMethod(Composite parent, int style, MethodType type, String name, String value,
             String displayName, boolean hasFunc) {
-
         super(parent, style, type, name, value, displayName, hasFunc);
     }
 
@@ -95,7 +91,21 @@ public class SizeMethod extends Method {
      */
     @Override
     protected Control createControl() {
-        final Combo combo = new Combo(this, SWT.TIME | SWT.BORDER);
+        Composite composite = new Composite(this, SWT.NONE);
+        composite.setLayout(new FormLayout());
+        
+        combo = createCombo(composite);
+        
+        FormData data = new FormData();
+        data.left =new FormAttachment(0, 0);
+        data.right = new FormAttachment(75, 0);
+        combo.setLayoutData(data);
+        
+        return composite;
+    }
+    
+    protected Combo createCombo(Composite composite) {
+        Combo combo = new Combo(composite, SWT.BORDER);
 
         Listener comboListener = MethodUtil.createSizeComboListener(this, 1);
         combo.addListener(SWT.Traverse, comboListener);
@@ -109,6 +119,10 @@ public class SizeMethod extends Method {
         
         return combo;
     }
+    
+    public Combo getCombo() {
+        return combo;
+    }
 
     /*
      * (non-Javadoc)
@@ -120,7 +134,6 @@ public class SizeMethod extends Method {
     public void setDefaultValue(String defaultValue) {
         super.setDefaultValue(defaultValue);
         if (defaultValue != null && defaultValue.equals(Constants.auto)) {
-            Combo combo = (Combo) getControl();
             combo.add(defaultValue);
         }
     }
@@ -151,8 +164,8 @@ public class SizeMethod extends Method {
         if (value == null || value.equals(BuilderConstants.EMPTY)) {
             value = getDefaultValue();
         }
-        Combo combo = (Combo) getControl();
 
+        super.refreshValue(name, value);
         String unitRemovedValue = removeUnit(value);
         if (unitRemovedValue == null) {
             // unitRemovedValue = "0";
@@ -161,21 +174,9 @@ public class SizeMethod extends Method {
         }
 
         combo.setText(unitRemovedValue);
-        super.refreshValue(name, unitRemovedValue);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#getControlLayoutData()
-     */
-    @Override
-    protected FormData getControlLayoutData() {
-
-        FormData data = super.getControlLayoutData();
-
-        data.width = 120;
-        return data;
+        if (unitLabel != null && !unitLabel.isDisposed() && currentUnit != null) {
+            unitLabel.setText(currentUnit);
+        }
     }
 
     /**
@@ -206,14 +207,14 @@ public class SizeMethod extends Method {
         this.units = units;
 
         if (unitLabel == null) {
-            unitLabel = new Label(this, SWT.NONE);
+            unitLabel = new Label((Composite) getControl(), SWT.NONE);
 
-            FormData formData2 = new FormData();
-            formData2.top = new FormAttachment(0, 5);
-            formData2.left = new FormAttachment(getControl(), 2);
-            formData2.right = new FormAttachment(100, 0);
+            FormData data = new FormData();
+            data.top = new FormAttachment(0, 5);
+            data.left = new FormAttachment(combo, 2);
+            data.right = new FormAttachment(100, 0);
             // formData2.bottom = new FormAttachment(0, 27);
-            unitLabel.setLayoutData(formData2);
+            unitLabel.setLayoutData(data);
 
             unitLabel.setText("");
 
@@ -249,6 +250,7 @@ public class SizeMethod extends Method {
                     currentUnit = menuItemUnit.getText();
 
                     unitLabel.setText((String) menuItemUnit.getData());
+                    setValue(combo.getText());
                 }
             });
 
@@ -279,21 +281,21 @@ public class SizeMethod extends Method {
 
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#getValue()
-     */
-    @Override
-    public String getValue() {
-        String value = super.getValue();
-
-        if (currentUnit == null || !AnimatorUtils.isNumeric(value)) {
-            return value;
-        }
-        return value + currentUnit;
-
-    }
+//    /*
+//     * (non-Javadoc)
+//     * 
+//     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#getValue()
+//     */
+//    @Override
+//    public String getValue() {
+//        String value = super.getValue();
+//
+//        if (currentUnit == null || !AnimatorUtils.isNumeric(value)) {
+//            return value;
+//        }
+//        return value + currentUnit;
+//
+//    }
 
     /**
      * is number
@@ -315,7 +317,7 @@ public class SizeMethod extends Method {
 
         String digitValue = BuilderConstants.EMPTY;
         StringBuffer buffer = new StringBuffer();
-        String sUnit;
+        String sUnit = BuilderConstants.EMPTY;;
 
         if (propertyValue != null) {
             int i = 0;
@@ -324,6 +326,16 @@ public class SizeMethod extends Method {
                 if (Character.isDigit(c) || c == '.' || c == '-' || c == '+') {
                     buffer.append(c);
                 } else {
+                    sUnit = propertyValue.substring(i);
+                    for (ConstantDescriptor unit : units) {
+                        if (unit.getValue().equals(sUnit)) {
+                            currentUnit = sUnit;
+                        }
+                    }
+                    if (!currentUnit.equals(sUnit)) {
+                        currentUnit = units.get(0).getValue();
+                    }
+                    
                     break;
                 }
             }
@@ -344,13 +356,9 @@ public class SizeMethod extends Method {
      */
     @Override
     public void setValue(String value) {
-        if (value != null && !value.equals(super.getValue())) {
-            // if (value != null) {
-            /* value += currentUnit; */
-            if (!isNumerical(value)) {
-                // TODO view message of validate
-                refreshValue(super.getMethodName(), super.getValue());
-                return;
+        if (value != null && !value.equals(getValue())) {
+            if (isNumeric(value)) {
+                value += currentUnit;
             }
             super.setValue(value);
         }
@@ -358,56 +366,20 @@ public class SizeMethod extends Method {
     
     @Override
     public void modifyValue(String value) {
-        if (value != null && !value.equals(super.getValue())) {
-            // if (value != null) {
-            /* value += currentUnit; */
-            if (value.isEmpty()) {
-                super.modifyValue(value);
-            } else if (!isNumerical(value)) {
-                // TODO view message of validate
-                refreshValue(super.getMethodName(), super.getValue());
-                return;
-            }
-            if (!value.isEmpty()) {
+        if (value != null && !value.equals(getValue())) {
+            if (isNumeric(value)) {
                 value += currentUnit;
             }
             super.modifyValue(value);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#setValue(java.lang.String,
-     * boolean)
-     */
+    
     @Override
-    public void setValue(String value, boolean undoable) {
-        super.refreshValue(getMethodName(), value);
-        modifyValue(BuilderConstants.EMPTY);
-
-        IValueChangeListener listener = getValueChangedListener();
-
-        if (listener != null) {
-            listener.valueChanged(new MethodEvent(this, getMethodName(), /* value */getValue(),
-                                                  undoable));
-        }
-
+    protected FormData getControlLayoutData() {
+        FormData data = super.getControlLayoutData();
+        data.right = new FormAttachment(100, 0);
+        return data;
     }
 
-    /**
-     * is number
-     * 
-     * @param value
-     * @return
-     */
-    private boolean isNumerical(String value) {
-        try {
-            Float.parseFloat(value);
-        } catch (Exception e) {
-            return false;
-        }
-        return true;
-    }
 
 }
index 14f96c9..e6f2da1 100644 (file)
 
 package org.tizen.webuibuilder.ui.views.properties.method;
 
-import java.util.List;
-
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
 import org.tizen.webuibuilder.BuilderConstants;
-import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
-import org.tizen.webuibuilder.animator.utils.Constants;
-import org.tizen.webuibuilder.model.descriptors.ConstantDescriptor;
 import org.tizen.webuibuilder.model.descriptors.TypeDescriptor;
-import org.tizen.webuibuilder.model.descriptors.UnitDescriptor;
 
 
 /**
  * A SizeRealMethod for SIZE_REAL type in the {@link TypeDescriptor.Types}
  */
-public class SizeRealMethod extends Method {
-
-    private String currentUnit;
-    private List<ConstantDescriptor> units;
-    private Label unitLabel;
-    private MenuItem menuItemUnit;
+public class SizeRealMethod extends SizeMethod {
 
     /**
      * Constructor.
@@ -91,8 +68,8 @@ public class SizeRealMethod extends Method {
      * @see org.tizen.webuibuilder.ui.views.properties.method.Method#createControl()
      */
     @Override
-    protected Control createControl() {
-        final Combo combo = new Combo(this, SWT.TIME | SWT.BORDER);
+    protected Combo createCombo(Composite composite) {
+        Combo combo = new Combo(composite, SWT.BORDER);
 
         Listener comboListener = MethodUtil.createSizeComboListener(this, 0.05);
         combo.addListener(SWT.Traverse, comboListener);
@@ -107,184 +84,6 @@ public class SizeRealMethod extends Method {
         return combo;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.tizen.webuibuilder.ui.views.properties.method.Method#setDefaultValue(java.lang.String)
-     */
-    @Override
-    public void setDefaultValue(String defaultValue) {
-        super.setDefaultValue(defaultValue);
-        if (defaultValue != null && defaultValue.equals(Constants.auto)) {
-            Combo combo = (Combo) getControl();
-            combo.add(defaultValue);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#refreshValue(java.lang.String,
-     * java.lang.String)
-     */
-    @Override
-    public void refreshValue(String name, String value) {
-        if (value == null || value.equals(BuilderConstants.EMPTY)) {
-            value = "0";
-        }
-        Combo combo = (Combo) getControl();
-
-        String unitRemovedValue = removeUnit(value);
-        if (unitRemovedValue == null || unitRemovedValue.equals(BuilderConstants.EMPTY)) {
-            return;
-        }
-
-        combo.setText(unitRemovedValue);
-        super.refreshValue(name, unitRemovedValue);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#getControlLayoutData()
-     */
-    @Override
-    protected FormData getControlLayoutData() {
-
-        FormData data = super.getControlLayoutData();
-
-        data.width = 120;
-        return data;
-    }
-
-    /**
-     * set units
-     * 
-     * @param units
-     */
-    public void setUnits(List<UnitDescriptor> units) {
-        if (units == null) {
-            return;
-        }
-        // TODO add listner and menu
-        for (UnitDescriptor unit : units) {
-            currentUnit = unit.getValue();
-        }
-    }
-
-    /**
-     * set units
-     * 
-     * @param units
-     */
-    public void setUnitsFromConstant(List<ConstantDescriptor> units) {
-        if (units == null || units.size() == 0) {
-            return;
-        }
-
-        this.units = units;
-
-        if (unitLabel == null) {
-            unitLabel = new Label(this, SWT.NONE);
-
-            FormData formData2 = new FormData();
-            formData2.top = new FormAttachment(0, 5);
-            formData2.left = new FormAttachment(getControl(), 2);
-            formData2.right = new FormAttachment(100, 0);
-            // formData2.bottom = new FormAttachment(0, 27);
-            unitLabel.setLayoutData(formData2);
-
-            unitLabel.setText("");
-
-            setUnitLabelMenu(unitLabel);
-
-        }
-
-        ConstantDescriptor unit = units.get(0);
-        if (unit != null) {
-            currentUnit = unit.getValue();
-
-            unitLabel.setText(currentUnit);
-        }
-    }
-
-    /**
-     * set label listener
-     * 
-     * @param unitLabel2
-     */
-    private void setUnitLabelMenu(final Label unitLabel2) {
-        final Menu menu = new Menu(unitLabel2.getShell());
-
-        for (ConstantDescriptor unit : units) {
-            final MenuItem menuItemUnit = new MenuItem(menu, SWT.NONE);
-            menuItemUnit.setText(unit.getDisplayName());
-
-            menuItemUnit.setData(unit.getValue());
-
-            menuItemUnit.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent event) {
-                    currentUnit = menuItemUnit.getText();
-
-                    unitLabel.setText((String) menuItemUnit.getData());
-                }
-            });
-
-        }
-
-        unitLabel2.addMouseListener(new MouseListener() {
-
-            @Override
-            public void mouseUp(MouseEvent e) {
-                Rectangle rect = unitLabel2.getBounds();
-                Point menuLocation = unitLabel2.toDisplay(rect.width, rect.height);
-
-                menu.setLocation(menuLocation);
-                menu.setVisible(true);
-
-            }
-
-            @Override
-            public void mouseDown(MouseEvent e) {
-
-            }
-
-            @Override
-            public void mouseDoubleClick(MouseEvent e) {
-
-            }
-        });
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#getValue()
-     */
-    @Override
-    public String getValue() {
-        String value = super.getValue();
-
-        if (currentUnit == null || !AnimatorUtils.isNumeric(value)) {
-            return value;
-        }
-        return value + currentUnit;
-
-    }
-
-    /**
-     * is number
-     * 
-     * @param s
-     * @return
-     */
-    public boolean isNumeric(String s) {
-        return s.matches("[-+]?\\d*\\.?\\d+");
-    }
-
     /**
      * remove unit string
      * 
@@ -292,10 +91,8 @@ public class SizeRealMethod extends Method {
      * @return
      */
     protected String removeUnit(String propertyValue) {
-
         String digitValue = BuilderConstants.EMPTY;
         StringBuffer buffer = new StringBuffer();
-        String sUnit;
 
         if (propertyValue != null) {
             int i = 0;
@@ -319,56 +116,4 @@ public class SizeRealMethod extends Method {
         return digitValue;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#setValue(java.lang.String)
-     */
-    @Override
-    public void setValue(String value) {
-        if (value != null) {
-            /* value += currentUnit; */
-            if (!isNumerical(value)) {
-                // TODO view message of validate
-                refreshValue(super.getMethodName(), super.getValue());
-                return;
-            }
-            super.setValue(value);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.tizen.webuibuilder.ui.views.properties.method.Method#setValue(java.lang.String,
-     * boolean)
-     */
-    @Override
-    public void setValue(String value, boolean undoable) {
-        super.refreshValue(getMethodName(), value);
-        modifyValue(BuilderConstants.EMPTY);
-
-        IValueChangeListener listener = getValueChangedListener();
-
-        if (listener != null) {
-            listener.valueChanged(new MethodEvent(this, getMethodName(), /* value */getValue(),
-                                                  undoable));
-        }
-
-    }
-
-    /**
-     * is number
-     * 
-     * @param value
-     * @return
-     */
-    private boolean isNumerical(String value) {
-        try {
-            Float.parseFloat(value);
-        } catch (Exception e) {
-            return false;
-        }
-        return true;
-    }
 }
index 5dc2540..36742dc 100644 (file)
@@ -83,7 +83,7 @@ public class TextStyleMethod extends GroupMethod {
         // int methodSize = methods.size();
         // int widthMargin = 4;
         int heightMargin = 4;
-        int labelPosition = 33;
+        int labelPosition = 34;
 
         for (int index = 0; index < children.size(); index++) {
             PropertyDescriptor child = children.get(index);
@@ -106,7 +106,7 @@ public class TextStyleMethod extends GroupMethod {
                     case 1:
                         /** font-size */
                         data.top = new FormAttachment(0, 0);
-                        data.left = new FormAttachment(51, 0);
+                        data.left = new FormAttachment(methods.get(0), 5);
                         data.right = new FormAttachment(100, 0);
                         break;
                     case 2:
@@ -166,15 +166,15 @@ public class TextStyleMethod extends GroupMethod {
                     case 11:
                         /** text-shadow */
                         data.top = new FormAttachment(methods.get(9), heightMargin);
-                        data.left = new FormAttachment(0, 1);
+                        data.left = new FormAttachment(0, 0);
                         data.right = new FormAttachment(100, 0);
-                        labelPosition = 16;
+                        labelPosition = 17;
                         break;
                     default:
                         break;
                 }
 
-                method.setControlRightData(80, 0);
+                method.setControlRightData(100, 0);
                 method.setValueChangedListener(this);
                 method.setLayoutData(data);
                 method.setLabelRightData(labelPosition, 0);
index 52fa0d6..36066fd 100644 (file)
@@ -93,6 +93,7 @@ public class TransformMethod extends GroupMethod {
 
                 method.setLayoutData(data);
                 method.setValueChangedListener(this);
+                method.setLabelRightData(26, 0);
                 methods.add(method);
             }
 
index cc98825..ae59e46 100644 (file)
@@ -32,6 +32,8 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
@@ -45,6 +47,8 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.forms.events.ExpansionAdapter;
@@ -53,6 +57,7 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.bridge.DesignerGoingBridge;
 import org.tizen.webuibuilder.model.css.CssFile;
 import org.tizen.webuibuilder.model.css.CssSelector;
 import org.tizen.webuibuilder.model.css.ICssSelectorListener;
@@ -61,6 +66,7 @@ import org.tizen.webuibuilder.ui.editor.PageDesigner;
 import org.tizen.webuibuilder.ui.selector.CSSSelectorDialog;
 import org.tizen.webuibuilder.ui.selector.CSSSelectorUtil;
 import org.tizen.webuibuilder.ui.views.properties.CategoryComposite;
+import org.tizen.webuibuilder.ui.views.properties.PropertiesConstant;
 import org.tizen.webuibuilder.utility.ResourceManager;
 
 
@@ -74,6 +80,7 @@ public class CssSelectorCategoryComposite extends CategoryComposite implements I
     private List<String> currentSelectors;
     private Map<String, List<String>> selectorMap = new HashMap<String, List<String>>();
     private Composite buttons;
+    private DesignerGoingBridge goingBridge;
     private ExpansionAdapter expansionListener = new ExpansionAdapter() {
 
         @Override
@@ -91,13 +98,14 @@ public class CssSelectorCategoryComposite extends CategoryComposite implements I
     };
 
     public CssSelectorCategoryComposite(Composite parent, String name, CssFile cssFile,
-            CssStyleEventDelegater delegater) {
+            CssStyleEventDelegater delegater, DesignerGoingBridge goingBridge) {
         super(parent, name, BuilderConstants.EMPTY, null);
         this.cssFile = cssFile;
         if (cssFile != null) {
             this.cssFile.addCssSelectorListener(this);
         }
         this.delegater = delegater;
+        this.goingBridge = goingBridge;
         createListBox();
     }
 
@@ -144,96 +152,118 @@ public class CssSelectorCategoryComposite extends CategoryComposite implements I
         buttons = new Composite(expandableComposite, SWT.NONE);
         buttons.setLayout(new RowLayout());
 
-        Label addButton = new Label(buttons, SWT.NONE);
-        Label deleteButton = new Label(buttons, SWT.NONE);
+        ToolBar toolBar = new ToolBar(buttons, SWT.RIGHT);
+        ToolItem addButton = new ToolItem(toolBar, SWT.PUSH);
+        ToolItem removeButton = new ToolItem(toolBar, SWT.PUSH);
+        
+//        Label addButton = new Label(buttons, SWT.NONE);
+//        Label deleteButton = new Label(buttons, SWT.NONE);
+        
+        addButton.setToolTipText(PropertiesConstant.CSS_SELECTOR_ADD);
+        removeButton.setToolTipText(PropertiesConstant.CSS_SELECTOR_REMOVE);
+        
         addButton.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                    "animator_action_add_normal.png"));
-        addMouseListenerForSelector(addButton, "add");
-        deleteButton.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                       "animator_action_delete_normal.png"));
-        addMouseListenerForSelector(deleteButton, "delete");
-    }
-
-    private void addMouseListenerForSelector(final Label label, final String function) {
-        final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-        label.addMouseListener(new MouseListener() {
-
-            @Override
-            public void mouseUp(MouseEvent e) {
-                if (function.equals("add")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_add_normal.png"));
-                    // addCssSelector("#page #button1>span>span");
-                    openSelectorDialog();
-                } else if (function.equals("delete")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_delete_normal.png"));
-                    removeCssSelectors();
-                } else {
-                    logger.error("Invalid function name for CSS Selector category");
-                }
-
-            }
-
+                                                    PropertiesConstant.CSS_SELECTOR_ADD_IMAGE_PATH));
+        removeButton.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+                                                       PropertiesConstant.CSS_SELECTOR_REMOVE_IMAGE_PATH));
+        
+        addButton.addSelectionListener(new SelectionAdapter() {
             @Override
-            public void mouseDown(MouseEvent e) {
-                if (function.equals("add")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_add_push.png"));
-                } else if (function.equals("delete")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_delete_push.png"));
-                } else {
-                    logger.error("Invalid function name for CSS Selector category");
-                }
-            }
-
-            @Override
-            public void mouseDoubleClick(MouseEvent e) {
-                // TODO Auto-generated method stub
-
+            public void widgetSelected(SelectionEvent e) {
+                openSelectorDialog();
             }
         });
-
-        label.addMouseTrackListener(new MouseTrackListener() {
-
+        
+        removeButton.addSelectionListener(new SelectionAdapter() {
             @Override
-            public void mouseHover(MouseEvent e) {
-                // TODO Auto-generated method stub
-
-            }
-
-            @Override
-            public void mouseExit(MouseEvent e) {
-                if (function.equals("add")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_add_normal.png"));
-                } else if (function.equals("delete")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_delete_normal.png"));
-                } else {
-                    logger.error("Invalid function name for CSS Selector category");
-                }
-
-            }
-
-            @Override
-            public void mouseEnter(MouseEvent e) {
-                if (function.equals("add")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_add_hover.png"));
-                } else if (function.equals("delete")) {
-                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                                                            "animator_action_delete_hover.png"));
-                } else {
-                    logger.error("Invalid function name for CSS Selector category");
-                }
-
+            public void widgetSelected(SelectionEvent e) {
+                removeCssSelectors();
             }
         });
+        
+//        addMouseListenerForSelector(addButton, "add");
+//        addMouseListenerForSelector(removeButton, "delete");
     }
 
+//    private void addMouseListenerForSelector(final ToolItem label, final String function) {
+//        final Logger logger = LoggerFactory.getLogger(this.getClass());
+//
+//        label.addMouseListener(new MouseListener() {
+//
+//            @Override
+//            public void mouseUp(MouseEvent e) {
+//                if (function.equals("add")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "add_css_selector_nml.png"));
+//                    openSelectorDialog();
+//                } else if (function.equals("delete")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "remove_css_selector_nml.png"));
+//                    removeCssSelectors();
+//                } else {
+//                    logger.error("Invalid function name for CSS Selector category");
+//                }
+//
+//            }
+//
+//            @Override
+//            public void mouseDown(MouseEvent e) {
+//                if (function.equals("add")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "add_css_selector_pushed.png"));
+//                } else if (function.equals("delete")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "remove_css_selector_pushed.png"));
+//                } else {
+//                    logger.error("Invalid function name for CSS Selector category");
+//                }
+//            }
+//
+//            @Override
+//            public void mouseDoubleClick(MouseEvent e) {
+//                // TODO Auto-generated method stub
+//
+//            }
+//        });
+//
+//        label.addMouseTrackListener(new MouseTrackListener() {
+//
+//            @Override
+//            public void mouseHover(MouseEvent e) {
+//                // TODO Auto-generated method stub
+//
+//            }
+//
+//            @Override
+//            public void mouseExit(MouseEvent e) {
+//                if (function.equals("add")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "add_css_selector_nml.png"));
+//                } else if (function.equals("delete")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "remove_css_selector_nml.png"));
+//                } else {
+//                    logger.error("Invalid function name for CSS Selector category");
+//                }
+//
+//            }
+//
+//            @Override
+//            public void mouseEnter(MouseEvent e) {
+//                if (function.equals("add")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "add_css_selector_hover.png"));
+//                } else if (function.equals("delete")) {
+//                    label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                                                            "remove_css_selector_hover.png"));
+//                } else {
+//                    logger.error("Invalid function name for CSS Selector category");
+//                }
+//
+//            }
+//        });
+//    }
+
     private void addCssSelector(String selectorName) {
         delegater.addCssSelector(selectorName);
     }
@@ -267,13 +297,8 @@ public class CssSelectorCategoryComposite extends CategoryComposite implements I
             return;
         }
 
-        PageDesigner pageDesigner = getPageDesigner();
-        if (pageDesigner == null) {
-            return;
-        }
-
         CSSSelectorDialog dialog = new CSSSelectorDialog(getShell(), widgetId);
-        dialog.setGoingBridge(pageDesigner.getViewer().getGoingBridge());
+        dialog.setGoingBridge(goingBridge);
 
         Rectangle rect = listBox.getBounds();
         Point pt = listBox.toDisplay(rect.x, rect.y);
@@ -294,17 +319,6 @@ public class CssSelectorCategoryComposite extends CategoryComposite implements I
 
     }
 
-    private PageDesigner getPageDesigner() {
-        IEditorPart editor =
-                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                        .getActiveEditor();
-        if (editor != null && editor instanceof PageDesigner) {
-            return (PageDesigner) editor;
-        } else {
-            return null;
-        }
-    }
-
     public String getDefaultSelectorName() {
         return currentSelectors.get(0);
     }
index 0fb24ea..d9da215 100644 (file)
@@ -183,11 +183,16 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
 
         String key = event.getKey();
         String value = event.getValue();
+        Method method = event.getMethod();
 
+        method.hideErrorTooltip();
+        
         if (key != null && !key.isEmpty()) {
             if (value != null && !value.equals(selector.getPropertyValue(key))) {
                 String message = validateStyle(key, value, event.getMethod());
                 if (!message.equals(WidgetValidator.OK)) {
+                    method.refreshValue(key, selector.getPropertyValue(key));
+                    method.showErrorToolTip(message);
                     return;
                 }
 
@@ -222,10 +227,12 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
 
         if (style != null) {
             descriptor = style.getDescriptor();
-        } else {
+        }
+        if (descriptor == null) {
             descriptor = (CssPropertyDescriptor) cssDescriptor.getPropertyDescriptor(key);
         }
 
+
         message = new WidgetValidator().canSetStyleValue(descriptor, value);
         return message;
     }
@@ -235,28 +242,18 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
             return;
         } else {
             CreateCssSelectorCommand command =
-                    new CreateCssSelectorCommand(pageData, styleTab.getModel(), selectorName);
+                    new CreateCssSelectorCommand(styleTab.getModel(), pageData, selectorName);
             commandStack.execute(command);
         }
     }
 
 
-    public void removeCssSelector(CssSelector selector) {
-        if (selector == null) {
-            return;
-        } else {
-            RemoveCssSelectorCommand command =
-                    new RemoveCssSelectorCommand(cssFile, styleTab.getModel(), selector);
-            commandStack.execute(command);
-        }
-    }
-
     public void removeCssSelector(String selectorName) {
         if (selectorName == null || selectorName.isEmpty()) {
             return;
         } else {
             RemoveCssSelectorCommand command =
-                    new RemoveCssSelectorCommand(cssFile, styleTab.getModel(), selectorName);
+                    new RemoveCssSelectorCommand(styleTab.getModel(), pageData, selectorName);
             commandStack.execute(command);
         }
     }
@@ -265,7 +262,7 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
         if (selectorName == null || selectorName.isEmpty()) {
             return;
         } else {
-            ResetCssSelectorCommand command = new ResetCssSelectorCommand(cssFile, styleTab.getModel(), selectorName);
+            ResetCssSelectorCommand command = new ResetCssSelectorCommand(styleTab.getModel(), pageData, selectorName);
             commandStack.execute(command);
         }
     }
@@ -324,14 +321,14 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
 
     @Override
     public void cssSelectorRemoved(CssEvent event) {
-        // TODO Auto-generated method stub
-        
+        styleTab.setDefaultSelector();
+        refreshStyleTab();
     }
 
     @Override
     public void cssPropertyChanged(CssEvent event) {
         String key = event.getPropertyKey();
-        if (key != null) {
+        if (key != null && !key.isEmpty()) {
             String value = event.getPropertyValue();
             refreshStyleTab(key, value);
         }
@@ -339,5 +336,6 @@ public class CssStyleEventDelegater implements ICssSelectorListener, IValueChang
 
     @Override
     public void needRefresh(CssEvent event) {
+        refreshStyleTab();
     }
 }
index 583c1a3..1573039 100644 (file)
@@ -32,18 +32,22 @@ import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.commands.CommandStack;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.MouseTrackListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
 import org.eclipse.ui.forms.events.ExpansionAdapter;
 import org.eclipse.ui.forms.events.ExpansionEvent;
 import org.slf4j.Logger;
@@ -95,8 +99,9 @@ import org.tizen.webuibuilder.utility.ResourceManager;
  */
 public class CssStyleTab extends PropertiesTabItem implements IPageDataListener {
 
-    // CommandStack
     private CommandStack commandStack;
+    private DesignerGoingBridge goingBridge;
+    
 
     // CSS Model
     private CssDescriptor cssDescriptor;
@@ -119,7 +124,7 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
             TableItem item = (TableItem) e.item;
             String selectorName = item.getText();
             if (setSelector(selectorName)) {
-                refresh();    
+                refresh();
             }
         }
         
@@ -169,6 +174,7 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
         setText(PropertiesConstant.STYLE);
         this.commandStack = commandStack;
         this.cssDescriptor = cssDescriptor;
+        this.goingBridge = goingBridge;
 
         cssDelegater = new CssStyleEventDelegater(commandStack, cssDescriptor, this, pageData, goingBridge);
         animDelegater = new CssStyleAnimationEventDelegater(commandStack, this);
@@ -183,56 +189,74 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     
     @Override
     protected Control createExtendControl(Composite parent) {
-        final Label label = new Label(parent, SWT.NONE);
-        label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                "animator_toolbar_repeat_hover.png"));
-        label.setToolTipText("Reset");
-        label.addMouseListener(new MouseListener() {
-            
+        ToolBar toolBar = new ToolBar(parent, SWT.RIGHT);
+        ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
+        toolItem.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+                PropertiesConstant.CSS_SELECTOR_RESET_IMAGE_PATH));
+        toolItem.setToolTipText(PropertiesConstant.CSS_SELECTOR_RESET);
+        
+        toolItem.addSelectionListener(new SelectionAdapter() {
             @Override
-            public void mouseUp(MouseEvent e) {
-                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                        "animator_toolbar_repeat_hover.png"));
+            public void widgetSelected(SelectionEvent e) {
                 resetCurrentSelector();
-                
-            }
-            
-            @Override
-            public void mouseDown(MouseEvent e) {
-                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                        "animator_toolbar_repeat_selected_normal.png"));
-                
-            }
-            
-            @Override
-            public void mouseDoubleClick(MouseEvent e) {
-                // TODO Auto-generated method stub
-                
             }
         });
+        return toolBar;
         
-        label.addMouseTrackListener(new MouseTrackListener() {
-            
-            @Override
-            public void mouseHover(MouseEvent e) {
-                // TODO Auto-generated method stub
-                
-            }
-            
-            @Override
-            public void mouseExit(MouseEvent e) {
-                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
-                        "animator_toolbar_repeat_hover.png"));
-                
-            }
-            
-            @Override
-            public void mouseEnter(MouseEvent e) {
-                // TODO Auto-generated method stub
-                
-            }
-        });
-        return label;
+//        final Label label = new Label(parent, SWT.NONE);
+//        label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                "reset_css_selector_nml.png"));
+//        label.setToolTipText("Reset");
+//        label.addMouseListener(new MouseListener() {
+//            
+//            @Override
+//            public void mouseUp(MouseEvent e) {
+//                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                        "reset_css_selector_nml.png"));
+//                resetCurrentSelector();
+//                
+//            }
+//            
+//            @Override
+//            public void mouseDown(MouseEvent e) {
+//                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                        "reset_css_selector_pushed.png"));
+//                
+//            }
+//            
+//            @Override
+//            public void mouseDoubleClick(MouseEvent e) {
+//                // TODO Auto-generated method stub
+//                
+//            }
+//        });
+//        
+//        label.addMouseTrackListener(new MouseTrackListener() {
+//            
+//            @Override
+//            public void mouseHover(MouseEvent e) {
+//                // TODO Auto-generated method stub
+//                
+//            }
+//            
+//            @Override
+//            public void mouseExit(MouseEvent e) {
+//                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                        "reset_css_selector_nml.png"));
+//            }
+//            
+//            @Override
+//            public void mouseEnter(MouseEvent e) {
+//                label.setImage(ResourceManager.getImage(BuilderConstants.ICON_DIR,
+//                        "reset_css_selector_hover.png"));
+//            }
+//        });
+//        return label;
+    }
+    
+    protected void resizeScrolledComposite() {
+        ScrolledComposite scrolledComposite = getScrolledComposite();
+        scrolledComposite.setMinSize(content.computeSize(PropertiesConstant.STYLE_MIN_WIDTH_SIZE, SWT.DEFAULT));
     }
     
     private void resetCurrentSelector() {
@@ -272,9 +296,12 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     }
     
     private void createCssSelectorCategory() {
-        cssCategory = new CssSelectorCategoryComposite(categoryContainer, "CSS Selector", cssFile, cssDelegater);
+        cssCategory =
+                new CssSelectorCategoryComposite(categoryContainer, "CSS Selector", cssFile,
+                                                 cssDelegater, goingBridge);
         cssCategory.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-        
+
+        cssCategory.addSelectorSelectionListener(selectorSelectionListener);
         cssCategory.addExpansionListener(new ExpansionAdapter() {
 
             @Override
@@ -285,7 +312,7 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
             }
         });
     }
-    
+
     /**
      * createStyleContents
      */
@@ -325,7 +352,7 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
                            GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
                            method.setLayoutData(data);
                            method.setLabelRightData(50, 1);
-                           method.setControlRightData(90, 0);
+                           method.setControlRightData(100, 0);
                        } else {
                            method.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2,
                                                              1));
@@ -351,20 +378,25 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     /**
      * Sets a current {@link CssFile}.
      * 
-     * @param cssFile
+     * @param inputCssFile
      *            a current {@link CssFile}
      * @return true if this class set CssFile, and false otherwise
      */
-    public boolean setCssFile(CssFile cssFile) {
-        if (this.cssFile == null || (cssFile != null && !this.cssFile.equals(cssFile))) {
-            this.cssFile = cssFile;
-            /* TODO Log */
-            cssDelegater.setCssFile(cssFile);
-            setDefaultSelector();
-            return true;
-        } else {
+    public boolean setCssFile(CssFile inputCssFile) {
+        if (inputCssFile == null || inputCssFile.equals(cssFile)) {
             return false;
+        } else if (cssFile != null) {
+            cssFile.removeCssSelectorListener(cssDelegater);
+            cssFile.removeCssSelectorListener(cssCategory);
         }
+        
+        cssFile = inputCssFile;
+        cssFile.addCssSelectorListener(cssDelegater);
+        cssFile.addCssSelectorListener(cssCategory);
+        
+        cssDelegater.setCssFile(inputCssFile);
+        setDefaultSelector();
+        return true;
     }
 
     
@@ -386,26 +418,15 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
         }
     }
 
-    /**
-     * addCssListener
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.swt.custom.CTabItem#dispose()
      */
-    private void addCssListener() {
-        if (cssFile != null) {
-            cssFile.addCssSelectorListener(cssDelegater);
-        }
-        if (currentSelector != null) {
-            currentSelector.addCssSelectorListener(cssDelegater);
-        }
+    @Override
+    public void dispose() {
+        removeModelListener();
         
-        if (cssCategory != null) {
-            cssCategory.addSelectorSelectionListener(selectorSelectionListener);
-        }
-    }
-
-    /**
-     * removeCssListener
-     */
-    private void removeCssListener() {
         if (cssFile != null) {
             cssFile.removeCssSelectorListener(cssDelegater);
         }
@@ -413,21 +434,9 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
         if (currentSelector != null) {
             currentSelector.removeCssSelectorListener(cssDelegater);
         }
-        
         if (cssCategory != null) {
             cssCategory.removeSelectorSelectionListener(selectorSelectionListener);
         }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.swt.custom.CTabItem#dispose()
-     */
-    @Override
-    public void dispose() {
-        removeModelListener();
-        removeCssListener();
         clear();
         noContent.dispose();
         multiContent.dispose();
@@ -468,7 +477,7 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     /**
      * Sets default selector.
      */
-    private void setDefaultSelector() {
+    public void setDefaultSelector() {
         Part model = getModel();
         if (model == null || model.isDocumentPart() || cssFile == null) {
             return;
@@ -488,17 +497,21 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     
     private boolean setSelector(String selectorName) {
         CssSelector cssSelector = cssFile.getSelector(selectorName);
-        
-        if (cssSelector != null) {
-            if (currentSelector != null && currentSelector.equals(cssSelector)) {
-                return false;
-            } else {
-                currentSelector = cssSelector;
-            }
-        } else {
+        if (cssSelector == null) {
             currentSelector = new CssSelector(selectorName);
+        } else if (cssSelector.equals(currentSelector)) {
+            return false;
+        } else if (currentSelector != null) {
+            currentSelector.removeCssSelectorListener(cssDelegater);
+            currentSelector = cssSelector;
+        } else {
+            // currentSelector == null
+            currentSelector = cssSelector;
         }
-
+        
+        
+        currentSelector.addCssSelectorListener(cssDelegater);
+        
         if (customCss != null && !customCss.isDisposed()) {
             customCss.setCssSelector(currentSelector);
         }
@@ -508,9 +521,6 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
         // CSS Delegater
         cssDelegater.setCssSelector(currentSelector);
         
-//        if (cssCategory != null && !cssCategory.isDisposed()) {
-//            cssCategory.setSelector(selectorName);    
-//        }
         return true;
     }
 
@@ -1474,10 +1484,8 @@ public class CssStyleTab extends PropertiesTabItem implements IPageDataListener
     @Override
     public void pageChanged(PageDataEvent e) {
         if (setCssFile(e.getPage().getCurrentCssFile())) {
+            setDefaultSelector();
             refresh();
-            removeCssListener();
-            addCssListener();
-//            addListeners();
         }
 
     }
index e02e123..70ce78d 100644 (file)
@@ -1,3 +1,6 @@
+* 0.1.440
+- [Title] update version.
+== yonghwan.jeon <yonghwan82.jeon@samsung.com> 2014-05-22
 * 0.1.439
 - [Title] Modify ProjectTemplateContributor.
 == yonghwan.jeon <yonghwan82.jeon@samsung.com> 2014-05-22
index 634eddd..9c90932 100644 (file)
@@ -1,5 +1,5 @@
 Package : web-ui-builder-eplugin
-Version :0.1.439
+Version :0.1.440
 OS : ubuntu-32
 Build-host-os : ubuntu-32
 Maintainer : Hoon Kang <h245.kang@samsung.com>
@@ -11,7 +11,7 @@ Source : web-ui-builder-eplugin
 Description : 
 
 Package : web-ui-builder-eplugin
-Version :0.1.439
+Version :0.1.440
 OS : ubuntu-64
 Build-host-os : ubuntu-64
 Maintainer : Hoon Kang <h245.kang@samsung.com>
@@ -23,7 +23,7 @@ Source : web-ui-builder-eplugin
 Description : 
 
 Package : web-ui-builder-eplugin
-Version :0.1.439
+Version :0.1.440
 OS : windows-32
 Build-host-os : ubuntu-32
 Maintainer : Hoon Kang <h245.kang@samsung.com>
@@ -35,7 +35,7 @@ Source : web-ui-builder-eplugin
 Description :
 
 Package : web-ui-builder-eplugin
-Version :0.1.439
+Version :0.1.440
 OS : windows-64
 Build-host-os : ubuntu-64
 Maintainer : Hoon Kang <h245.kang@samsung.com>
@@ -47,7 +47,7 @@ Source : web-ui-builder-eplugin
 Description :
 
 Package : web-ui-builder-eplugin
-Version :0.1.439
+Version :0.1.440
 OS : macos-64
 Build-host-os : ubuntu-64
 Maintainer : Hoon Kang <h245.kang@samsung.com>