Skip to content

Commit 6eff371

Browse files
committed
Update Eclipse Link a cluster UI with storage configs as optional
Signed-off-by: Wei Zhang <[email protected]>
1 parent 2c0f3ee commit 6eff371

File tree

1 file changed

+41
-40
lines changed
  • PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.azureexplorer/src/com/microsoft/azuretools/azureexplorer/forms

1 file changed

+41
-40
lines changed

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.azureexplorer/src/com/microsoft/azuretools/azureexplorer/forms/AddNewClusterForm.java

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.net.URL;
44
import java.util.Arrays;
55

6-
import org.apache.commons.lang3.StringUtils;
76
import org.eclipse.swt.SWT;
87
import org.eclipse.swt.events.FocusAdapter;
98
import org.eclipse.swt.events.FocusEvent;
@@ -98,8 +97,47 @@ protected Control createDialogArea(Composite parent) {
9897
clusterNameField.setLayoutData(gridData);
9998
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.");
10099

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+
101138
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.");
103141
gridLayout = new GridLayout();
104142
gridLayout.numColumns = 2;
105143
clusterStorageGroup.setLayout(gridLayout);
@@ -160,44 +198,6 @@ public void focusLost(FocusEvent e) {
160198
gridData.grabExcessHorizontalSpace = true;
161199
containersComboBox.setLayoutData(gridData);
162200

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-
201201
container.addHelpListener(new HelpListener() {
202202
@Override public void helpRequested(HelpEvent e) {
203203
try {
@@ -254,6 +254,7 @@ public void setData(AddNewClusterModel data) {
254254
data.getContainers().forEach(containersComboBox::add);
255255
containersComboBox.select(data.getSelectedContainerIndex());
256256

257+
// Resize layout
257258
getShell().layout(true, true);
258259
}
259260
}

0 commit comments

Comments
 (0)