javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java
equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 package com.nokia.mj.impl.installer.ui.eswt2; |
19 package com.nokia.mj.impl.installer.ui.eswt2; |
20 |
20 |
|
21 import com.nokia.mj.impl.installer.ui.InstallInfo; |
21 import com.nokia.mj.impl.installer.ui.LaunchAppInfo; |
22 import com.nokia.mj.impl.installer.ui.LaunchAppInfo; |
22 |
23 |
|
24 import org.eclipse.swt.SWT; |
23 import org.eclipse.swt.widgets.Composite; |
25 import org.eclipse.swt.widgets.Composite; |
|
26 import org.eclipse.swt.widgets.Button; |
24 |
27 |
25 /** |
28 /** |
26 * LaunchAppQueryView asks from the user if the installed |
29 * LaunchAppQueryView asks from the user if the installed |
27 * application should be displayed. |
30 * application should be displayed. |
28 */ |
31 */ |
29 public class LaunchAppQueryView extends ConfirmationViewBase |
32 public class LaunchAppQueryView extends ConfirmationViewBase |
30 { |
33 { |
|
34 private LaunchAppInfo iLaunchAppInfo = null; |
|
35 private Button iDefaultButton = null; |
|
36 |
31 /** Constructor */ |
37 /** Constructor */ |
32 protected LaunchAppQueryView() |
38 protected LaunchAppQueryView() |
33 { |
39 { |
34 super(); |
40 super(); |
35 } |
41 } |
38 protected LaunchAppQueryView( |
44 protected LaunchAppQueryView( |
39 InstallerUiEswt aInstallerUi, Composite aParent) |
45 InstallerUiEswt aInstallerUi, Composite aParent) |
40 { |
46 { |
41 super(aInstallerUi, aParent, 8); |
47 super(aInstallerUi, aParent, 8); |
42 setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE)); |
48 setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE)); |
43 setCommands(InstallerUiTexts.get(InstallerUiTexts.SHOW), |
49 setCommands("Show", //InstallerUiTexts.get(InstallerUiTexts.SHOW), |
44 InstallerUiTexts.get(InstallerUiTexts.CLOSE)); |
50 InstallerUiTexts.get(InstallerUiTexts.CLOSE)); |
45 } |
51 } |
46 |
52 |
47 /** Show launch app query. */ |
53 /** Show launch app query. */ |
48 public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo) |
54 public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo) |
50 if (isDisposed() || aLaunchAppInfo == null) |
56 if (isDisposed() || aLaunchAppInfo == null) |
51 { |
57 { |
52 return false; |
58 return false; |
53 } |
59 } |
54 |
60 |
|
61 iLaunchAppInfo = aLaunchAppInfo; |
55 // Use confirm() from super class to display the view. |
62 // Use confirm() from super class to display the view. |
56 boolean result = confirm(); |
63 boolean result = confirm(); |
57 // Return the result to the client. |
64 // Return the result to the client. |
58 return result; |
65 return result; |
59 } |
66 } |
60 |
67 |
61 protected void createView() |
68 protected void createView() |
62 { |
69 { |
63 // Add header. |
70 // Add header. |
64 addHeader(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE), |
71 String title = "Installed"; |
65 iInstallerUi.getInstallInfo(), null); |
72 addHeader(title, iInstallerUi.getInstallInfo(), null); |
66 // Add content to the application info Composite. |
73 // Add content to the application info Composite. |
67 addAppInfo(iInstallerUi.getInstallInfo(), true); |
74 addAppInfo(iInstallerUi.getInstallInfo(), true); |
68 } |
75 } |
69 |
76 |
70 /** |
77 /** |
72 */ |
79 */ |
73 protected void getDataFromView() |
80 protected void getDataFromView() |
74 { |
81 { |
75 // User selection data is initialized in button listeners. |
82 // User selection data is initialized in button listeners. |
76 } |
83 } |
|
84 |
|
85 /** |
|
86 * Returns SWT style for this view. |
|
87 */ |
|
88 protected int getStyle() |
|
89 { |
|
90 return SWT.V_SCROLL; |
|
91 } |
|
92 |
|
93 /** |
|
94 * Called after view and commands have been created. Subclasses |
|
95 * can overrride this method to set focus to their own default |
|
96 * commands. |
|
97 */ |
|
98 protected void setDefaultCommand() |
|
99 { |
|
100 if (iDefaultButton != null) |
|
101 { |
|
102 iDefaultButton.setFocus(); |
|
103 getShell().setDefaultButton(iDefaultButton); |
|
104 } |
|
105 } |
77 } |
106 } |