ANIMATOR : Refresh ContextMenu 43/21143/1
authorjinwooim.bae <jinwooim.bae@samsung.com>
Thu, 15 May 2014 10:26:06 +0000 (19:26 +0900)
committerjinwooim.bae <jinwooim.bae@samsung.com>
Thu, 15 May 2014 10:26:06 +0000 (19:26 +0900)
ContextMenu is refreshed when clicked filter.

Change-Id: If063a65e638f9fc37befce221ccb4043c18cf210
Signed-off-by: jinwooim.bae <jinwooim.bae@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/TimelineViewer.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimeTreeElement.java

index 9c910be..f9852c7 100644 (file)
@@ -478,7 +478,6 @@ public class TimelineViewer extends TreeViewer implements ISelectionChangedListe
      * 
      */
     private void applyfilter() {
-
         RootEditPart rootEditPart = getRootEditPart();
         List children = rootEditPart.getChildren();
         if (children != null) {
@@ -496,11 +495,44 @@ public class TimelineViewer extends TreeViewer implements ISelectionChangedListe
                     }
                 }
             }
-            Tree contentTree = (Tree) getControl();
-            contentTree.pack();
+            
+            refreshTree();
+            refreshContextMenu();
         }
     }
-    
+
+    /**
+     * Refresh tree
+     */
+    private void refreshTree() {
+        Tree contentTree = (Tree) getControl();
+        contentTree.pack();
+    }
+
+    /**
+     * Refresh ContextMenu
+     */
+    private void refreshContextMenu() {
+      //refresh contextMenu
+
+        this.getControl().setMenu(getContextMenu().createContextMenu(this.getControl()));
+
+      RootEditPart rootEditPart = getRootEditPart();
+      List children = rootEditPart.getChildren();
+      if (children != null) {
+          List<TimelineEditPart> editParts = ((EditPart) children.get(0)).getChildren();
+          for (TimelineEditPart editPart : editParts) {
+              List<TimelineEditPart> childEditParts = editPart.getChildren();
+              for(TimelineEditPart treeEditPart : childEditParts) {
+                  TimeTreeElement treeElement = treeEditPart.getTimeElement();
+                  if(treeElement != null) {
+                      treeElement.createContextMenu();
+                  }
+              }
+          }
+      }
+    }
+
     /**
      * applyNonFilter
      */
index 7dfbca2..eb904de 100644 (file)
@@ -210,7 +210,7 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
     /**
      * Create ContextMenu
      */
-    private void createContextMenu() {
+    public void createContextMenu() {
         /*
          * contextMenu = new TimelineWidgetContextMenu(this); contextMenu.createMenuItem();
          * contextMenu.getContextMenu().setVisible(false);