|
3 | 3 | import java.net.URL; |
4 | 4 | import java.util.Arrays; |
5 | 5 |
|
6 | | -import org.apache.commons.lang3.StringUtils; |
7 | 6 | import org.eclipse.swt.SWT; |
8 | 7 | import org.eclipse.swt.events.FocusAdapter; |
9 | 8 | import org.eclipse.swt.events.FocusEvent; |
@@ -98,8 +97,47 @@ protected Control createDialogArea(Composite parent) { |
98 | 97 | clusterNameField.setLayoutData(gridData); |
99 | 98 | clusterNameField.setToolTipText("The HDInsight cluster name, such as 'mycluster' of cluster URL 'mycluster.azurehdinsight.net'.\n\n Press the F1 key or click the '?'(Help) button to get more details."); |
100 | 99 |
|
| 100 | + Group clusterAccountGroup = new Group(container, SWT.NONE); |
| 101 | + clusterAccountGroup.setText("The Cluster Account"); |
| 102 | + gridLayout = new GridLayout(); |
| 103 | + gridLayout.numColumns = 2; |
| 104 | + clusterAccountGroup.setLayout(gridLayout); |
| 105 | + gridData = new GridData(); |
| 106 | + gridData.horizontalSpan = 2; |
| 107 | + gridData.widthHint = 350; |
| 108 | + gridData.horizontalAlignment = SWT.FILL; |
| 109 | + gridData.grabExcessHorizontalSpace = true; |
| 110 | + clusterAccountGroup.setLayoutData(gridData); |
| 111 | + |
| 112 | + userNameLabel = new Label(clusterAccountGroup, SWT.LEFT); |
| 113 | + userNameLabel.setText("User Name:"); |
| 114 | + gridData = new GridData(); |
| 115 | + gridData.horizontalIndent = 38; |
| 116 | + gridData.horizontalAlignment = SWT.RIGHT; |
| 117 | + userNameLabel.setLayoutData(gridData); |
| 118 | + userNameField = new Text(clusterAccountGroup, SWT.BORDER); |
| 119 | + gridData = new GridData(); |
| 120 | + gridData.horizontalAlignment = SWT.FILL; |
| 121 | + gridData.grabExcessHorizontalSpace = true; |
| 122 | + userNameField.setLayoutData(gridData); |
| 123 | + userNameField.setToolTipText("The user name of the HDInsight cluster.\n\n Press the F1 key or click the '?'(Help) button to get more details."); |
| 124 | + |
| 125 | + passwordLabel = new Label(clusterAccountGroup, SWT.LEFT); |
| 126 | + passwordLabel.setText("Password:"); |
| 127 | + gridData = new GridData(); |
| 128 | + gridData.horizontalIndent = 38; |
| 129 | + gridData.horizontalAlignment = SWT.RIGHT; |
| 130 | + passwordLabel.setLayoutData(gridData); |
| 131 | + passwordField = new Text(clusterAccountGroup, SWT.PASSWORD | SWT.BORDER); |
| 132 | + gridData = new GridData(); |
| 133 | + gridData.horizontalAlignment = SWT.FILL; |
| 134 | + gridData.grabExcessHorizontalSpace = true; |
| 135 | + passwordField.setLayoutData(gridData); |
| 136 | + passwordField.setToolTipText("The password of the HDInsight cluster user provided.\n\n Press the F1 key or click the '?'(Help) button to get more details."); |
| 137 | + |
101 | 138 | Group clusterStorageGroup = new Group(container, SWT.NONE); |
102 | | - clusterStorageGroup.setText("The Cluster Storage Information"); |
| 139 | + clusterStorageGroup.setText("The Cluster Storage Information (Optional)"); |
| 140 | + clusterStorageGroup.setToolTipText("The Cluster Storage Information provided can enable the Storage Explorer support."); |
103 | 141 | gridLayout = new GridLayout(); |
104 | 142 | gridLayout.numColumns = 2; |
105 | 143 | clusterStorageGroup.setLayout(gridLayout); |
@@ -160,44 +198,6 @@ public void focusLost(FocusEvent e) { |
160 | 198 | gridData.grabExcessHorizontalSpace = true; |
161 | 199 | containersComboBox.setLayoutData(gridData); |
162 | 200 |
|
163 | | - Group clusterAccountGroup = new Group(container, SWT.NONE); |
164 | | - clusterAccountGroup.setText("The Cluster Account"); |
165 | | - gridLayout = new GridLayout(); |
166 | | - gridLayout.numColumns = 2; |
167 | | - clusterAccountGroup.setLayout(gridLayout); |
168 | | - gridData = new GridData(); |
169 | | - gridData.horizontalSpan = 2; |
170 | | - gridData.widthHint = 350; |
171 | | - gridData.horizontalAlignment = SWT.FILL; |
172 | | - gridData.grabExcessHorizontalSpace = true; |
173 | | - clusterAccountGroup.setLayoutData(gridData); |
174 | | - |
175 | | - userNameLabel = new Label(clusterAccountGroup, SWT.LEFT); |
176 | | - userNameLabel.setText("User Name:"); |
177 | | - gridData = new GridData(); |
178 | | - gridData.horizontalIndent = 38; |
179 | | - gridData.horizontalAlignment = SWT.RIGHT; |
180 | | - userNameLabel.setLayoutData(gridData); |
181 | | - userNameField = new Text(clusterAccountGroup, SWT.BORDER); |
182 | | - gridData = new GridData(); |
183 | | - gridData.horizontalAlignment = SWT.FILL; |
184 | | - gridData.grabExcessHorizontalSpace = true; |
185 | | - userNameField.setLayoutData(gridData); |
186 | | - userNameField.setToolTipText("The user name of the HDInsight cluster.\n\n Press the F1 key or click the '?'(Help) button to get more details."); |
187 | | - |
188 | | - passwordLabel = new Label(clusterAccountGroup, SWT.LEFT); |
189 | | - passwordLabel.setText("Password:"); |
190 | | - gridData = new GridData(); |
191 | | - gridData.horizontalIndent = 38; |
192 | | - gridData.horizontalAlignment = SWT.RIGHT; |
193 | | - passwordLabel.setLayoutData(gridData); |
194 | | - passwordField = new Text(clusterAccountGroup, SWT.PASSWORD | SWT.BORDER); |
195 | | - gridData = new GridData(); |
196 | | - gridData.horizontalAlignment = SWT.FILL; |
197 | | - gridData.grabExcessHorizontalSpace = true; |
198 | | - passwordField.setLayoutData(gridData); |
199 | | - passwordField.setToolTipText("The password of the HDInsight cluster user provided.\n\n Press the F1 key or click the '?'(Help) button to get more details."); |
200 | | - |
201 | 201 | container.addHelpListener(new HelpListener() { |
202 | 202 | @Override public void helpRequested(HelpEvent e) { |
203 | 203 | try { |
@@ -254,6 +254,7 @@ public void setData(AddNewClusterModel data) { |
254 | 254 | data.getContainers().forEach(containersComboBox::add); |
255 | 255 | containersComboBox.select(data.getSelectedContainerIndex()); |
256 | 256 |
|
| 257 | + // Resize layout |
257 | 258 | getShell().layout(true, true); |
258 | 259 | } |
259 | 260 | } |
0 commit comments