javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java
branchRCL_3
changeset 24 6c158198356e
parent 18 9ac0a0a7da70
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java	Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java	Thu Aug 19 09:48:13 2010 +0300
@@ -35,7 +35,6 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 
@@ -62,7 +61,7 @@
     protected PermissionConfirmationView(
         InstallerUiEswt aInstallerUi, Composite aParent)
     {
-        super(aInstallerUi, aParent, 8, true);
+        super(aInstallerUi, aParent, 8);
         setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLING));
         setCommands(null, null);
     }
@@ -93,39 +92,30 @@
     protected void createView()
     {
         // Add header.
-        String title = "Install?";
-        String appName = "";
-        if (iInstallInfo != null)
-        {
-            if (iInstallInfo.getOldVersion() != null)
-            {
-                title = "Update?";
-            }
-            appName = iInstallInfo.getName();
-        }
-        addHeader(title, iInstallInfo, null);
+        addHeader(null, iInstallInfo, null);
 
         GridData gridData = null;
-        int horizontalSpan = getColumns();
         int labelStyle = SWT.WRAP;
 
         // Add permission query label.
-        Label domainLabel = createLabel(
-            InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY,
-                                 new String[] { appName }),
+        int detailsColumns = 2;
+        int horizontalSpan = getColumns() - detailsColumns;
+        Label permissionQueryLabel = createLabel(
+            InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY),
             horizontalSpan, labelStyle);
+        setCssId(permissionQueryLabel, "permissionDetails");
 
         // Add link for permission details.
         if (iPermissionInfo != null &&
                 iPermissionInfo.getPermissionNames() != null &&
                 iPermissionInfo.getPermissionNames().length > 0)
         {
-            Link detailsLink = new Link(getComposite(), SWT.NONE);
-            detailsLink.setText(
-                "<a>" +
-                InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS) +
-                "</a>");
-            detailsLink.addListener(SWT.Selection, new Listener()
+            horizontalSpan = detailsColumns;
+            Button detailsButton = new Button(getComposite(), SWT.NONE);
+            setCssId(detailsButton, "detailsLink");
+            detailsButton.setText(
+                InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS));
+            detailsButton.addListener(SWT.Selection, new Listener()
             {
                 public void handleEvent(Event aEvent)
                 {
@@ -134,15 +124,15 @@
             });
             gridData = new GridData(GridData.FILL_HORIZONTAL);
             gridData.horizontalSpan = horizontalSpan;
-            detailsLink.setLayoutData(gridData);
-            addSoftKeyListenerFor(detailsLink);
+            detailsButton.setLayoutData(gridData);
+            addSoftKeyListenerFor(detailsButton);
         }
 
-        // Number of pixels on top of the buttons.
-        int verticalIndent = 5;
+        horizontalSpan = getColumns();
 
         // Add allow button.
         iAllowButton = new Button(getComposite(), SWT.NONE);
+        setCssId(iAllowButton, "allowButton");
         iAllowButton.setText(InstallerUiTexts.get(
                                  InstallerUiTexts.PERM_ALLOW_ALWAYS));
         iAllowButton.addListener(SWT.Selection, new Listener()
@@ -169,13 +159,13 @@
         });
         gridData = new GridData(GridData.FILL_HORIZONTAL);
         gridData.horizontalSpan = horizontalSpan;
-        gridData.verticalIndent = verticalIndent;
         iAllowButton.setLayoutData(gridData);
         iAllowButton.setFocus();
         addSoftKeyListenerFor(iAllowButton);
 
         // Add deny button.
         iDenyButton = new Button(getComposite(), SWT.NONE);
+        setCssId(iDenyButton, "denyButton");
         iDenyButton.setText(InstallerUiTexts.get(
                                 InstallerUiTexts.PERM_ASK_ME_LATER));
         iDenyButton.addListener(SWT.Selection, new Listener()
@@ -202,12 +192,12 @@
         });
         gridData = new GridData(GridData.FILL_HORIZONTAL);
         gridData.horizontalSpan = horizontalSpan;
-        gridData.verticalIndent = verticalIndent;
         iDenyButton.setLayoutData(gridData);
         addSoftKeyListenerFor(iDenyButton);
 
         // Add cancel button.
         iCancelButton = new Button(getComposite(), SWT.NONE);
+        setCssId(iCancelButton, "cancelButton");
         iCancelButton.setText(InstallerUiTexts.get(InstallerUiTexts.PERM_CANCEL));
         iCancelButton.addListener(SWT.Selection, new Listener()
         {
@@ -232,9 +222,12 @@
         });
         gridData = new GridData(GridData.FILL_HORIZONTAL);
         gridData.horizontalSpan = horizontalSpan;
-        gridData.verticalIndent = verticalIndent;
         iCancelButton.setLayoutData(gridData);
         addSoftKeyListenerFor(iCancelButton);
+
+        // After other widgets have been added, add content to
+        // application info Composite.
+        addAppInfo(iInstallInfo, false);
     }
 
     /**