javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java
changeset 35 85266cc22c7f
parent 26 dc7c549001d5
child 48 e0d6e9bd3ca7
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
    33 import org.eclipse.swt.layout.GridData;
    33 import org.eclipse.swt.layout.GridData;
    34 import org.eclipse.swt.widgets.Composite;
    34 import org.eclipse.swt.widgets.Composite;
    35 import org.eclipse.swt.widgets.Button;
    35 import org.eclipse.swt.widgets.Button;
    36 import org.eclipse.swt.widgets.Event;
    36 import org.eclipse.swt.widgets.Event;
    37 import org.eclipse.swt.widgets.Label;
    37 import org.eclipse.swt.widgets.Label;
    38 import org.eclipse.swt.widgets.Link;
       
    39 import org.eclipse.swt.widgets.Listener;
    38 import org.eclipse.swt.widgets.Listener;
    40 import org.eclipse.swt.widgets.Shell;
    39 import org.eclipse.swt.widgets.Shell;
    41 
    40 
    42 /**
    41 /**
    43  * PermissionConfirmationView asks permissions confirmation
    42  * PermissionConfirmationView asks permissions confirmation
   104             appName = iInstallInfo.getName();
   103             appName = iInstallInfo.getName();
   105         }
   104         }
   106         addHeader(title, iInstallInfo, null);
   105         addHeader(title, iInstallInfo, null);
   107 
   106 
   108         GridData gridData = null;
   107         GridData gridData = null;
   109         int horizontalSpan = getColumns();
       
   110         int labelStyle = SWT.WRAP;
   108         int labelStyle = SWT.WRAP;
   111 
   109 
   112         // Add permission query label.
   110         // Add permission query label.
       
   111         int detailsColumns = 2;
       
   112         int horizontalSpan = getColumns() - detailsColumns;
   113         Label domainLabel = createLabel(
   113         Label domainLabel = createLabel(
   114             InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY,
   114             InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY,
   115                                  new String[] { appName }),
   115                                  new String[] { appName }),
   116             horizontalSpan, labelStyle);
   116             horizontalSpan, labelStyle);
   117 
   117 
   118         // Add link for permission details.
   118         // Add link for permission details.
   119         if (iPermissionInfo != null &&
   119         if (iPermissionInfo != null &&
   120                 iPermissionInfo.getPermissionNames() != null &&
   120                 iPermissionInfo.getPermissionNames() != null &&
   121                 iPermissionInfo.getPermissionNames().length > 0)
   121                 iPermissionInfo.getPermissionNames().length > 0)
   122         {
   122         {
   123             Link detailsLink = new Link(getComposite(), SWT.NONE);
   123             horizontalSpan = detailsColumns;
   124             detailsLink.setText(
   124             Button detailsButton = new Button(getComposite(), SWT.NONE);
   125                 "<a>" +
   125             detailsButton.setText(
   126                 InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS) +
   126                 InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS));
   127                 "</a>");
   127             detailsButton.addListener(SWT.Selection, new Listener()
   128             detailsLink.addListener(SWT.Selection, new Listener()
       
   129             {
   128             {
   130                 public void handleEvent(Event aEvent)
   129                 public void handleEvent(Event aEvent)
   131                 {
   130                 {
   132                     openDetailsView();
   131                     openDetailsView();
   133                 }
   132                 }
   134             });
   133             });
   135             gridData = new GridData(GridData.FILL_HORIZONTAL);
   134             gridData = new GridData(GridData.FILL_HORIZONTAL);
   136             gridData.horizontalSpan = horizontalSpan;
   135             gridData.horizontalSpan = horizontalSpan;
   137             detailsLink.setLayoutData(gridData);
   136             detailsButton.setLayoutData(gridData);
   138             addSoftKeyListenerFor(detailsLink);
   137             addSoftKeyListenerFor(detailsButton);
   139         }
   138         }
       
   139 
       
   140         horizontalSpan = getColumns();
   140 
   141 
   141         // Number of pixels on top of the buttons.
   142         // Number of pixels on top of the buttons.
   142         int verticalIndent = 5;
   143         int verticalIndent = 5;
   143 
   144 
   144         // Add allow button.
   145         // Add allow button.
   233         gridData = new GridData(GridData.FILL_HORIZONTAL);
   234         gridData = new GridData(GridData.FILL_HORIZONTAL);
   234         gridData.horizontalSpan = horizontalSpan;
   235         gridData.horizontalSpan = horizontalSpan;
   235         gridData.verticalIndent = verticalIndent;
   236         gridData.verticalIndent = verticalIndent;
   236         iCancelButton.setLayoutData(gridData);
   237         iCancelButton.setLayoutData(gridData);
   237         addSoftKeyListenerFor(iCancelButton);
   238         addSoftKeyListenerFor(iCancelButton);
       
   239 
       
   240         // After other widgets have been added, add content to
       
   241         // application info Composite.
       
   242         addAppInfo(iInstallInfo, false);
   238     }
   243     }
   239 
   244 
   240     /**
   245     /**
   241      * This method is called after user has answered
   246      * This method is called after user has answered
   242      * to confirmation.
   247      * to confirmation.