Upload tizen_2.2 source tizen_2.2 2.2.1_release
authorkh5325.kim <kh5325.kim@samsung.com>
Fri, 1 Nov 2013 03:22:40 +0000 (12:22 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Fri, 1 Nov 2013 03:22:40 +0000 (12:22 +0900)
Change-Id: Id43086499ecf41434d551f7267d184f6de285823

org.tizen.nativeplatform/src/org/tizen/nativeplatform/preferences/ui/SiteConfigurationPreferencePage.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/ui/TizenPlatformPWComposite.java
package/changelog
package/pkginfo.manifest

index b3ec5e4..8757a76 100644 (file)
@@ -146,12 +146,12 @@ public class SiteConfigurationPreferencePage extends PreferencePage implements
         column = new TableColumn(table, SWT.NONE);
         column.setResizable(true);
         column.setText(resources.getString("GitConfPref.Column.URI"));
-        column.setWidth(300);
+        column.setWidth(250);
 
         column = new TableColumn(table, SWT.NONE);
         column.setResizable(true);
         column.setText(resources.getString("GitConfPref.Column.Type"));
-        column.setWidth(50);
+        column.setWidth(100);
 
         GridData tableGridData = new GridData(GridData.FILL_HORIZONTAL
                 | GridData.VERTICAL_ALIGN_BEGINNING);
index b7f659d..255d2bd 100644 (file)
@@ -84,111 +84,127 @@ import org.tizen.nativeplatform.wizards.TizenPlatformProjectWizard;
 import org.tizen.nativeplatform.wizards.model.TizenPlatformTemplateModel;
 
 public class TizenPlatformPWComposite extends PWWidget {
-       protected final Logger logger = LoggerFactory.getLogger(getClass());
+    protected final Logger logger = LoggerFactory.getLogger(getClass());
 
     private int textMargin = 30;
     private int tableWidth = 250;
     private Tree tree;
     private Table table;
-    
+
     private TizenNativeTreeRootModel modelRoot;
     private Browser descBrowser;
     private final TizenPlatformMainWizardPage wizardPage;
     private TableViewer gitDescTable;
     private int browserWidth = 418;
     private static Color topColor = new Color(Display.getDefault(), 168, 198, 255); // Top Color
-    private static Color bottomColor = new Color(Display.getDefault(), 104, 151, 239); // Bottom Color
-    
+    private static Color bottomColor = new Color(Display.getDefault(), 104, 151, 239); // Bottom
+                                                                                       // Color
+
     private static String IMAGE_TREE_BG = "images/wizard/tree_viewer_bg.png";
     private static String IMAGE_TABLE_BG = "images/wizard/list_viewer_bg.png";
     private final String GIT_CATEGORY = "Git";
     private final String TABLE_DATA_DELIMITER = "::";
-    
-    private final static String BUNDLE_NAME = TizenPlatformProjectWizard.class.getPackage().getName() + ".WizardUIMessages";//$NON-NLS-1$
-       private static ResourceBundle resources = ResourceBundle.getBundle(BUNDLE_NAME);
-    
-    public TizenPlatformPWComposite(final String label, TizenNativeTreeRootModel modelRoot, TizenPlatformMainWizardPage page) {
+
+    private final static String BUNDLE_NAME = TizenPlatformProjectWizard.class.getPackage()
+            .getName() + ".WizardUIMessages";//$NON-NLS-1$
+    private static ResourceBundle resources = ResourceBundle.getBundle(BUNDLE_NAME);
+
+    public TizenPlatformPWComposite(final String label, TizenNativeTreeRootModel modelRoot,
+            TizenPlatformMainWizardPage page) {
         super(label, null, 1, true);
         this.modelRoot = modelRoot;
-        this.wizardPage = page;        
-        
+        this.wizardPage = page;
+
         setAlignment(GridData.FILL);
     }
-    
+
     @Override
     protected Control build(Composite parent) {
         this.wizardPage.setLastSelectedTemplate(null);
         this.wizardPage.h_selected = null;
-        
+
         Composite composite = new Composite(parent, SWT.NONE);
         GridLayout gridLayout = new GridLayout(3, false);
         gridLayout.marginHeight = 0;
         gridLayout.marginWidth = 0;
         composite.setLayout(gridLayout);
-        composite.setLayoutData(new GridData(GridData.FILL_BOTH));        
-        
+        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
         if (this.getLabel().equals(GIT_CATEGORY)) {
-               if ( modelRoot.getEntries().size() == 1 && 
-                               modelRoot.getEntries().get(0).getName().equals("no_category")) {
-                       createEmptyGitRepositoryComposite(composite);
-               } 
-               else {
+            if (modelRoot.getEntries().size() == 1
+                    && modelRoot.getEntries().get(0).getName().equals("no_category")) {
+                createEmptyGitRepositoryComposite(composite);
+            } else {
                 createTree(composite);
                 createTable(composite);
-                       createGitDescriptionComposite(composite);
-               }
+                createGitDescriptionComposite(composite);
+            }
         } else {
             createTree(composite);
             createTable(composite);
-               createDescriptionComposite(composite);
+            createDescriptionComposite(composite);
         }
-        
-        
+
+        initializeTabList();
+
         wizardPage.setPageComplete(wizardPage.validatePage());
         return composite;
     }
 
-    
+    private void initializeTabList() {
+        ArrayList<Control> tabList = new ArrayList<Control>();
+        if (this.tree == null) {
+            return;
+        }
+
+        if (this.tree.getItemCount() > 0) {
+            tabList.add(this.tree);
+            if (this.table.getItemCount() > 0) {
+                tabList.add(this.table);
+            }
+        }
+
+        this.tree.getParent().setTabList(tabList.toArray(new Control[tabList.size()]));
+    }
+
     private void createEmptyGitRepositoryComposite(Composite parent) {
-       Composite composite = new Composite(parent, SWT.NONE);          
-               GridLayout gridLayout = new GridLayout(1, false);
+        Composite composite = new Composite(parent, SWT.NONE);
+        GridLayout gridLayout = new GridLayout(1, false);
         gridLayout.marginHeight = 0;
         gridLayout.marginWidth = 0;
         composite.setLayout(gridLayout);
         GridData gridData = new GridData(GridData.FILL_BOTH);
         gridData.minimumWidth = this.browserWidth;
-        composite.setLayoutData(gridData); 
+        composite.setLayoutData(gridData);
 
-        Label emptyGitDescription = new Label(composite, SWT.NONE       ) ;
-        emptyGitDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL,true, true));
-        emptyGitDescription.setAlignment(SWT.CENTER);        
-        emptyGitDescription.setText(resources.getString("WizardPage.GitError.NoInfo"));        
+        Label emptyGitDescription = new Label(composite, SWT.NONE);
+        emptyGitDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        emptyGitDescription.setAlignment(SWT.CENTER);
+        emptyGitDescription.setText(resources.getString("WizardPage.GitError.NoInfo"));
     }
 
-    
     private void createTable(Composite parent) {
         this.table = new Table(parent, SWT.FULL_SELECTION);
         TableColumn column = new TableColumn(this.table, SWT.NONE);
         column.setResizable(true);
         column.setWidth(this.tableWidth);
-        
         GridData tableGridData = new GridData(GridData.FILL_BOTH);
         tableGridData.minimumWidth = this.tableWidth;
         table.setLayoutData(tableGridData);
-        
         createTableListener();
-        
+
         this.table.setBackgroundImage(ImageUtil.getImage(Activator.PLUGIN_ID, IMAGE_TABLE_BG));
     }
 
     private void createTableListener() {
-       final String label = this.getLabel();
+        final String label = this.getLabel();
         table.addSelectionListener(new SelectionListener() {
             @Override
             public void widgetSelected(SelectionEvent e) {
-               boolean errorOccured = false;
-                if(table.getSelection() != null && table.getSelection().length > 0 ) {
-                       TizenPlatformTemplateModel templateModel = (TizenPlatformTemplateModel) table.getSelection()[0].getData();
+                boolean errorOccured = false;
+                if (table.getSelection() != null && table.getSelection().length > 0) {
+                    TizenPlatformTemplateModel templateModel = (TizenPlatformTemplateModel) table
+                            .getSelection()[0].getData();
                     EntryDescriptor ed = templateModel.getEntryDescriptor();
                     wizardPage.setLastSelectedTemplate(templateModel);
                     wizardPage.switchTo(ed.getHandler(), ed);
@@ -221,22 +237,22 @@ public class TizenPlatformPWComposite extends PWWidget {
                         gitDescTable.setInput(inputs);
 
                     } else {
-                       descBrowser.setUrl(templateModel.getDescPath().toOSString());
+                        descBrowser.setUrl(templateModel.getDescPath().toOSString());
                     }
                     if (errorOccured) {
-                       wizardPage.setPageError(true);
+                        wizardPage.setPageError(true);
                     } else {
-                       wizardPage.setPageError(false);                  
+                        wizardPage.setPageError(false);
                     }
                     wizardPage.setPageComplete(wizardPage.validatePage());
                 }
             }
-            
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
             }
         });
-        
+
         // margin
         table.addListener(SWT.MeasureItem, new Listener() {
             public void handleEvent(Event event) {
@@ -253,9 +269,9 @@ public class TizenPlatformPWComposite extends PWWidget {
                 event.detail &= ~SWT.HOT;
                 if ((event.detail & SWT.SELECTED) == 0) {
                     table.drawBackground(event.gc, 0, event.y, tableWidth, event.height, 0, 0);
-                    return; /* item not selected */
+                    return;
                 }
-                
+
                 GC gc = event.gc;
                 Color oldForeground = gc.getForeground();
                 Color oldBackground = gc.getBackground();
@@ -267,54 +283,53 @@ public class TizenPlatformPWComposite extends PWWidget {
                 event.detail &= ~SWT.SELECTED;
             }
         });
-    }   
-    
+    }
+
     private void createDescriptionComposite(Composite parent) {
         GridData gridData = new GridData(GridData.FILL_BOTH);
         gridData.minimumWidth = browserWidth;
 
         try {
-               descBrowser = new Browser(parent, SWT.NONE);
-               initializebrowser(SWTUtil.getDisplay(), descBrowser);
-               descBrowser.setLayoutData(gridData);
+            descBrowser = new Browser(parent, SWT.NONE);
+            initializebrowser(SWTUtil.getDisplay(), descBrowser);
+            descBrowser.setLayoutData(gridData);
         } catch (SWTError e) {
-               // Exception skip: Ubuntu 12.04 browser compatibility problem
-               logger.error("Failed to create a browser", e);
-               Composite temporaryControl = new Composite(parent, SWT.NONE);
-               temporaryControl.setLayoutData(gridData);
+            // Exception skip: Ubuntu 12.04 browser compatibility problem
+            logger.error("Failed to create a browser", e);
+            Composite temporaryControl = new Composite(parent, SWT.NONE);
+            temporaryControl.setLayoutData(gridData);
         }
     }
 
     private void createGitDescriptionComposite(Composite parent) {
-       Composite composite = new Composite(parent, SWT.NONE);
-               GridLayout gridLayout = new GridLayout(1, false);
+        Composite composite = new Composite(parent, SWT.NONE);
+        GridLayout gridLayout = new GridLayout(1, false);
         gridLayout.marginHeight = 0;
         gridLayout.marginWidth = 0;
         composite.setLayout(gridLayout);
-        composite.setLayoutData(new GridData(GridData.FILL_BOTH)); 
-        
+        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
         createGitInfoComposite(composite);
     }
 
-    
-    private void createGitInfoComposite(Composite parent) {            
-       gitDescTable = new TableViewer(parent, SWT.NONE);
-       
-       Table table = gitDescTable.getTable();
-       table.setLinesVisible(true);            
-               
-               gitDescTable.setLabelProvider(new TableViewerProvider());               
-               gitDescTable.setContentProvider(new ArrayContentProvider());
-               
-        TableColumn column = new TableColumn(table, SWT.NONE);        
+    private void createGitInfoComposite(Composite parent) {
+        gitDescTable = new TableViewer(parent, SWT.NONE);
+
+        Table table = gitDescTable.getTable();
+        table.setLinesVisible(true);
+
+        gitDescTable.setLabelProvider(new TableViewerProvider());
+        gitDescTable.setContentProvider(new ArrayContentProvider());
+
+        TableColumn column = new TableColumn(table, SWT.NONE);
         column.setResizable(true);
-        //column.setWidth(this.tableWidth);
-        column.setWidth(100);           
-        
+        // column.setWidth(this.tableWidth);
+        column.setWidth(100);
+
         column = new TableColumn(table, SWT.FILL);
         column.setResizable(true);
         column.setWidth(318);
-        
+
         GridData tableGridData = new GridData(GridData.FILL_BOTH);
         tableGridData.minimumWidth = this.browserWidth;
         table.setLayoutData(tableGridData);
@@ -330,62 +345,65 @@ public class TizenPlatformPWComposite extends PWWidget {
         public String getColumnText(Object element, int columnIndex) {
             String[] splitValues = ((String) element).split("::");
             switch (columnIndex) {
-                case 0:
-                    return splitValues[0];
-                case 1:
-                    if (splitValues.length == 2) {
-                        return splitValues[1];
-                    } else {
-                        return "";
-                    }
-                default:
-                    break;
+            case 0:
+                return splitValues[0];
+            case 1:
+                if (splitValues.length == 2) {
+                    return splitValues[1];
+                } else {
+                    return "";
+                }
+            default:
+                break;
             }
             return null;
         }
-       }
-    
+    }
+
     private void createTree(Composite parent) {
         // Type Tree View
         this.tree = new Tree(parent, SWT.NONE);
-        
+
         // set layout data
         GridData treeGridData = new GridData(GridData.FILL_BOTH);
         treeGridData.minimumWidth = 200;
         this.tree.setLayoutData(treeGridData);
-        
+
         createTreeItem(parent, modelRoot.getEntries());
         createTreeListener();
-        
+
         makeGradientTree(this.tree);
         if (!modelRoot.getName().equals(GIT_CATEGORY)) {
-               SWTUtil.expandTree(this.tree);
+            SWTUtil.expandTree(this.tree);
         }
         this.tree.setBackgroundImage(ImageUtil.getImage(Activator.PLUGIN_ID, IMAGE_TREE_BG));
     }
 
     private void createTreeListener() {
         this.tree.addSelectionListener(new SelectionListener() {
-            
+
             @Override
             public void widgetSelected(SelectionEvent e) {
-                if(tree.getSelection() != null && tree.getSelection().length > 0) {
+                if (tree.getSelection() != null && tree.getSelection().length > 0) {
                     TreeItem selectedItem = tree.getSelection()[0];
                     Object data = selectedItem.getData();
-                    
-                    List<TizenNativeTemplateModel> templateList = ((TizenNativeTreeGroupModel)(data)).getTemplateList();
-                    if(templateList.size() > 0) {
+
+                    List<TizenNativeTemplateModel> templateList = ((TizenNativeTreeGroupModel) (data))
+                            .getTemplateList();
+                    if (templateList.size() > 0) {
                         createTableItem(templateList);
-                    }
-                    else {
-//                        descBrowser.setVisible(false);
+                    } else {
+                        // descBrowser.setVisible(false);
                         wizardPage.setLastSelectedTemplate(null);
                         wizardPage.h_selected = null;
                         wizardPage.setPageComplete(wizardPage.validatePage());
                         table.removeAll();
                     }
+
+                    initializeTabList();
                 }
             }
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
             }
@@ -395,26 +413,27 @@ public class TizenPlatformPWComposite extends PWWidget {
     private void createTableItem(List<TizenNativeTemplateModel> templates) {
         this.table.removeAll();
         this.table.setLinesVisible(false);
-        
-        for(TizenNativeTemplateModel template: templates) {
+
+        for (TizenNativeTemplateModel template : templates) {
             TableItem tableItem = new TableItem(table, SWT.NONE);
             tableItem.setText(template.getName());
             tableItem.setData(template);
-            
+
             IPath iconPath = template.getIconPath();
-            
+
             Image wizardIconImage = null;
-            if(iconPath != null) {
-                wizardIconImage = ImageUtil.getImage(ImageDescriptor.createFromFile(null, iconPath.toOSString()));
+            if (iconPath != null) {
+                wizardIconImage = ImageUtil.getImage(ImageDescriptor.createFromFile(null,
+                        iconPath.toOSString()));
+            } else {
+                wizardIconImage = ImageUtil.getImage(Activator.PLUGIN_ID,
+                        TizenMainWizardPage.DEFAULT_WIZARD_ICON);
             }
-            else {
-                wizardIconImage = ImageUtil.getImage(Activator.PLUGIN_ID, TizenMainWizardPage.DEFAULT_WIZARD_ICON);
-            }
-            
+
             tableItem.setImage(wizardIconImage);
         }
-        
-        if(templates.size() > 0) {
+
+        if (templates.size() > 0) {
             Event e = new Event();
             table.select(0);
             e.item = this.table.getSelection()[0];
@@ -422,13 +441,11 @@ public class TizenPlatformPWComposite extends PWWidget {
         }
     }
 
-    
-    private void createTreeItem(Composite parent,
-            List<TizenNativeTreeGroupModel> entries) {
-        
+    private void createTreeItem(Composite parent, List<TizenNativeTreeGroupModel> entries) {
+
         Stack<TizenNativeTreeGroupModel> entryStack = new Stack<TizenNativeTreeGroupModel>();
         Stack<TreeItem> treeStack = new Stack<TreeItem>();
-        
+
         for (TizenNativeTreeGroupModel entry : entries) {
             TreeItem treeItem = new TreeItem(this.tree, SWT.None);
             treeItem.setText(entry.getName());
@@ -436,12 +453,12 @@ public class TizenPlatformPWComposite extends PWWidget {
             entryStack.push(entry);
             treeStack.push(treeItem);
         }
-        
-        while(!entryStack.isEmpty()) {
+
+        while (!entryStack.isEmpty()) {
             TizenNativeTreeGroupModel entry = entryStack.pop();
             TreeItem treeItem = treeStack.pop();
-            
-            for(TizenNativeTreeGroupModel subEntry: entry.getEntries()) {
+
+            for (TizenNativeTreeGroupModel subEntry : entry.getEntries()) {
                 TreeItem subTreeItem = new TreeItem(treeItem, SWT.None);
                 subTreeItem.setText(subEntry.getName());
                 subTreeItem.setData(subEntry);
@@ -454,23 +471,19 @@ public class TizenPlatformPWComposite extends PWWidget {
     @Override
     protected void check() {
     }
-    
+
     private void initializebrowser(final Display currentDisplay, Browser pBrowser) {
-        
+
         pBrowser.addOpenWindowListener(new OpenWindowListener() {
             @Override
             public void open(WindowEvent event) {
-                if (!event.required)
-                {
-                    return;    /* only do it if necessary */
-                }
                 Shell shell = new Shell(currentDisplay, SWT.CLOSE | SWT.MAX | SWT.MIN | SWT.RESIZE);
-                
+
                 GridLayout gridLayout = new GridLayout();
                 gridLayout.numColumns = 1;
                 shell.setLayout(gridLayout);
                 HelpBrowser childBrowser = new HelpBrowser(shell, SWT.BORDER, true);
-                
+
                 initializebrowser(currentDisplay, childBrowser.getBrowser());
                 event.browser = childBrowser.getBrowser();
                 shell.open();
@@ -480,9 +493,8 @@ public class TizenPlatformPWComposite extends PWWidget {
 
     public static void makeGradientTree(final Tree tree) {
         /*
-         * NOTE: MeasureItem, PaintItem and EraseItem are called repeatedly.
-         * Therefore, it is critical for performance that these methods be
-         * as efficient as possible.
+         * NOTE: MeasureItem, PaintItem and EraseItem are called repeatedly. Therefore, it is
+         * critical for performance that these methods be as efficient as possible.
          */
         tree.addListener(SWT.EraseItem, new Listener() {
             public void handleEvent(Event event) {
@@ -491,8 +503,8 @@ public class TizenPlatformPWComposite extends PWWidget {
                     GC gc = event.gc;
                     Rectangle area = tree.getClientArea();
                     /*
-                     * If you wish to paint the selection beyond the end of
-                     * last column, you must change the clipping region.
+                     * If you wish to paint the selection beyond the end of last column, you must
+                     * change the clipping region.
                      */
                     int columnCount = tree.getColumnCount();
                     if (event.index == columnCount - 1 || columnCount == 0) {
@@ -505,15 +517,15 @@ public class TizenPlatformPWComposite extends PWWidget {
                             region.dispose();
                         }
                     }
-                    //gc.setAdvanced(true);
-                    //if (gc.getAdvanced()) gc.setAlpha(127);
+                    // gc.setAdvanced(true);
+                    // if (gc.getAdvanced()) gc.setAlpha(127);
                     Rectangle rect = event.getBounds();
                     Color foreground = gc.getForeground();
                     Color background = gc.getBackground();
                     gc.setForeground(topColor);
                     gc.setBackground(bottomColor);
                     gc.fillGradientRectangle(0, rect.y, 200, rect.height, true);
-                    
+
                     // restore colors for subsequent drawing
                     gc.setForeground(foreground);
                     gc.setBackground(background);
index a56a9c3..0abdcfb 100644 (file)
@@ -1,3 +1,6 @@
+* 2.1.32
+- Fixed a problem that Tab to change focus is not working for Platform project wizard
+== donghyuk yang <donghyuk.yang@samsung.com> 2013-10-31
 * 2.1.31
 - Fixed a import problem (TrayDialog)
 == donghyuk yang <donghyuk.yang@samsung.com> 2013-10-24
index 236ad2d..1f54d6f 100644 (file)
@@ -1,4 +1,4 @@
-Version:2.1.31
+Version:2.1.32
 Source:nativeplatform-eplugin
 Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park<yoonki.park@samsung.com>, Hyunsik Noh<hyunsik.noh@samsung.com>, Gun Kim<gune.kim@samsung.com>, Ho Namkoong<ho.namkoong@samsung.com>, Taeyoung Son<taeyoung2.son@samsung.com>