From: parary Date: Thu, 29 May 2014 10:09:51 +0000 (+0900) Subject: DATABIND : Set Source Dialog Modify. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7258f4ec421cf9349acd7f1e04af106e0831db73;p=sdk%2Fide%2Fweb-ui-builder-eplugin.git DATABIND : Set Source Dialog Modify. add button icons. remove undefined data type. Change-Id: I13d18f681a22cc02d7a04601f3d2375ec7239e61 Signed-off-by: parary --- diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/Helper.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/Helper.java index 46922a3..0fc9adf 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/Helper.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/Helper.java @@ -291,10 +291,10 @@ public class Helper { makeTreeItem( entry.getValue(), tree, treeItem, includeIndex, currentSubPage ); } else if ( entry.getValue().isJsonNull() ) { - careteTreeItem( treeItem, entry.getKey(), null, "Undefined" ); + careteTreeItem( treeItem, entry.getKey(), null, "String" ); if ( includeIndex ) - Helper.addComboInTreeItem( treeItem, "Undefined", currentSubPage ); + Helper.addComboInTreeItem( treeItem, "String", currentSubPage ); makeTreeItem( entry.getValue(), tree, treeItem, includeIndex, currentSubPage ); @@ -677,7 +677,7 @@ public class Helper { Combo combo = new Combo( item.getParent(), SWT.SINGLE | SWT.READ_ONLY ); treeEditor.setEditor( combo, item, 2 ); - final String[] comboItems = { "String", "Number", "Boolean", "Object", "Array", "Undefined" }; + final String[] comboItems = { "String", "Number", "Boolean", "Object", "Array" }; combo.setVisibleItemCount( comboItems.length ); combo.setItems( comboItems ); @@ -699,6 +699,28 @@ public class Helper { parentItem.setText( 2, selectedText ); + String imageName; + + if ( selectedText.equals( "Array" ) ) { + imageName = BuilderConstants.DATABINDING_ARRAY_ICON; + }else if ( selectedText.equals( "Number" ) ) { + imageName = BuilderConstants.DATABINDING_NUMBER_ICON; + }else if ( selectedText.equals( "String" ) ) { + imageName = BuilderConstants.DATABINDING_STRING_ICON; + }else if ( selectedText.equals( "Index" ) ) { + imageName = BuilderConstants.DATABINDING_INDEX_ICON; + }else if ( selectedText.equals( "Object" ) ) { + imageName = BuilderConstants.DATABINDING_OBJECT_ICON; + }else if ( selectedText.equals( "Boolean" ) ) { + imageName = BuilderConstants.DATABINDING_BOOLEAN_ICON; + }else{ + imageName = BuilderConstants.DATABINDING_UNDEFINED_ICON; + } + + if ( imageName != null ) { + parentItem.setImage( ResourceManager.getImage( BuilderConstants.ICON_DIR, imageName ) ); + } + if( currentSubPage instanceof StaticSubPage ){ ((StaticSubPage)currentSubPage).updateJsonFromTree(); } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java index 42f8be0..1777c63 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java @@ -1026,6 +1026,28 @@ public class SetSourcePage extends Dialog { item.setText(new String[] { key, value, type }); + String imageName; + + if ( type.equals( "Array" ) ) { + imageName = BuilderConstants.DATABINDING_ARRAY_ICON; + }else if ( type.equals( "Number" ) ) { + imageName = BuilderConstants.DATABINDING_NUMBER_ICON; + }else if ( type.equals( "String" ) ) { + imageName = BuilderConstants.DATABINDING_STRING_ICON; + }else if ( type.equals( "Index" ) ) { + imageName = BuilderConstants.DATABINDING_INDEX_ICON; + }else if ( type.equals( "Object" ) ) { + imageName = BuilderConstants.DATABINDING_OBJECT_ICON; + }else if ( type.equals( "Boolean" ) ) { + imageName = BuilderConstants.DATABINDING_BOOLEAN_ICON; + }else{ + imageName = BuilderConstants.DATABINDING_UNDEFINED_ICON; + } + + if ( imageName != null ) { + item.setImage( ResourceManager.getImage( BuilderConstants.ICON_DIR, imageName ) ); + } + TreeItemData treeItemData = new TreeItemData(); treeItemData.setSource( "custom" ); treeItemData.setObjectType("String");