Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit 7fc3a2c

Browse files
author
zhangzhx
committed
AWS Toolkit for Eclipse: v201710120027 Release.
1 parent a79ec15 commit 7fc3a2c

File tree

8 files changed

+60
-66
lines changed

8 files changed

+60
-66
lines changed

CHANGELOG.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
{
22
"current": [
3-
"* **Support Lambda function versioning and alias**",
4-
"",
5-
" * Upload Lambda function to AWS with alias and S3 Server-Side-Encryption.",
6-
"![LambdaVersioningEncryption-upload](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-upload.gif)",
7-
"",
8-
" * Check the result in AWS Lambda and Amazon S3 in AWS console.",
9-
"![LambdaVersioningEncryption-result](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-result.gif)",
10-
"",
11-
"* **Better support right click in the Project Explorer. Previously, it only supports project level right click.**",
12-
"![BetterSupportProjectExplorerForAwsLambdaActions](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/BetterSupportProjectExplorerForAwsLambdaActions.png)",
13-
"",
14-
"* **Move Decorators from project level to java class level to record the mapping remote AWS Lambda function**",
15-
"![LambdaProjectDecorator](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaProjectDecorator.png)",
16-
"",
17-
"* **Update the Invoke function dialog UI for supporting choosing from multiple handlers instead of invoking only the last deployed function.**",
18-
"![InvokeLambda](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/InvokeLambda.png)",
19-
"",
20-
"* **Resolving Issue: #56, #58, #66, #72.**"
3+
"* **Resolving Issues: #50, #82.**"
4+
],
5+
"v201709262229 ": [
6+
"* **Support Lambda function versioning and alias**",
7+
"",
8+
" * Upload Lambda function to AWS with alias and S3 Server-Side-Encryption.",
9+
"![LambdaVersioningEncryption-upload](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-upload.gif)",
10+
"",
11+
" * Check the result in AWS Lambda and Amazon S3 in AWS console.",
12+
"![LambdaVersioningEncryption-result](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-result.gif)",
13+
"",
14+
"* **Better support right click in the Project Explorer. Previously, it only supports project level right click.**",
15+
"![BetterSupportProjectExplorerForAwsLambdaActions](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/BetterSupportProjectExplorerForAwsLambdaActions.png)",
16+
"",
17+
"* **Move Decorators from project level to java class level to record the mapping remote AWS Lambda function**",
18+
"![LambdaProjectDecorator](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaProjectDecorator.png)",
19+
"",
20+
"* **Update the Invoke function dialog UI for supporting choosing from multiple handlers instead of invoking only the last deployed function.**",
21+
"![InvokeLambda](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/InvokeLambda.png)",
22+
"",
23+
"* **Resolving Issue: #56, #58, #66, #72.**"
2124
],
2225
"201709081818 ": [
2326
"* Merge Pull Request: #81",

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/AWSClientFactory.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ public class AWSClientFactory {
120120
/** Manages the cached client objects by region. **/
121121
private CachedClients cachedClients = new CachedClients();
122122

123+
private final String accountId;
124+
123125
/**
124126
* The account info for accessing the user's credentials.
125127
*/
126-
private final AccountInfo accountInfo;
128+
private AccountInfo accountInfo;
127129

128130
/**
129131
* Constructs a client factory that uses the given account identifier to
@@ -133,24 +135,22 @@ public AWSClientFactory(String accountId) {
133135

134136
AwsToolkitCore plugin = AwsToolkitCore.getDefault();
135137

138+
this.accountId = accountId;
136139
accountInfo = plugin.getAccountManager().getAccountInfo(accountId);
137140

138-
plugin.getProxyService().addProxyChangeListener(new IProxyChangeListener() {
139-
@Override
140-
public void proxyInfoChanged(IProxyChangeEvent event) {
141-
cachedClientsByEndpoint.invalidateClients();
142-
cachedClients.invalidateClients();
143-
}
144-
});
141+
plugin.getProxyService().addProxyChangeListener(this::onProxyChange);
142+
plugin.getAccountManager().addAccountInfoChangeListener(this::onAccountInfoChange);
143+
}
145144

146-
plugin.getAccountManager().addAccountInfoChangeListener(new AccountInfoChangeListener() {
147-
@Override
148-
public void onAccountInfoChange() {
149-
cachedClientsByEndpoint.invalidateClients();
150-
cachedClients.invalidateClients();
151-
}
145+
private void onProxyChange(IProxyChangeEvent e) {
146+
onAccountInfoChange();
147+
}
152148

153-
});
149+
private void onAccountInfoChange() {
150+
// When the system AWS accounts refresh, we need to refresh the member variable accountInfo as well in case it is still referencing the previous credentials.
151+
accountInfo = AwsToolkitCore.getDefault().getAccountManager().getAccountInfo(accountId);
152+
cachedClientsByEndpoint.invalidateClients();
153+
cachedClients.invalidateClients();
154154
}
155155

156156
// Returns an anonymous S3 client in us-east-1 region for fetching public-read files.

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/mobileanalytics/ui/ToolkitAnalyticsPreferencePage.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
import com.amazonaws.eclipse.core.AwsToolkitCore;
2727
import com.amazonaws.eclipse.core.preferences.PreferenceConstants;
28+
import com.amazonaws.eclipse.core.ui.WebLinkListener;
2829
import com.amazonaws.eclipse.core.ui.preferences.AwsToolkitPreferencePage;
30+
import com.amazonaws.eclipse.core.ui.wizards.WizardWidgetFactory;
2931

3032
public class ToolkitAnalyticsPreferencePage extends AwsToolkitPreferencePage
3133
implements IWorkbenchPreferencePage {
@@ -53,12 +55,15 @@ protected Control createContents(Composite parent) {
5355
gridData.widthHint = 300;
5456
composite.setLayoutData(gridData);
5557

56-
analyticsEnabledButton = new Button(composite, SWT.CHECK | SWT.MULTI | SWT.WRAP);
57-
analyticsEnabledButton.setText(
58+
WizardWidgetFactory.newLink(composite, new WebLinkListener(), String.format(
5859
"By leaving this box checked, you agree that AWS may anonymously " +
5960
"collect analytics about your usage of AWS Toolkit. AWS will handle " +
60-
"all information received in accordance with the AWS Privacy Policy " +
61-
"(http://aws.amazon.com/privacy/)");
61+
"all information received in accordance with the <a href=\"%s\">AWS Privacy Policy</a>.",
62+
"http://aws.amazon.com/privacy/"),
63+
1);
64+
65+
analyticsEnabledButton = new Button(composite, SWT.CHECK | SWT.MULTI | SWT.WRAP);
66+
analyticsEnabledButton.setText("Enable anonymous collection of analytics");
6267
analyticsEnabledButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
6368
analyticsEnabledButton.setSelection(getPreferenceStore().getBoolean(
6469
PreferenceConstants.P_TOOLKIT_ANALYTICS_COLLECTION_ENABLED));

bundles/com.amazonaws.eclipse.lambda/src/com/amazonaws/eclipse/lambda/invoke/ui/InvokeFunctionInputDialog.java

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void widgetSelected(SelectionEvent e) {
115115
jsonInputFileButton = newRadioButton(container, "Select one of the JSON files as input: ", 1, false, new SelectionAdapter() {
116116
@Override
117117
public void widgetSelected(SelectionEvent e) {
118-
onJsonInputFileButtonSelected();
118+
onRadioButtonSelected();
119119
}
120120
});
121121
jsonInputFileCombo = newCombo(container, 1);
@@ -130,7 +130,7 @@ public void widgetSelected(SelectionEvent e) {
130130
jsonInputButton = newRadioButton(container, "Enter the JSON input for your function", 2, false, new SelectionAdapter() {
131131
@Override
132132
public void widgetSelected(SelectionEvent e) {
133-
onJsonInputButtonSelected();
133+
onRadioButtonSelected();
134134
}
135135
});
136136

@@ -247,9 +247,9 @@ private void loadJsonFilesAsync() {
247247
jsonInputFileCombo.setItems(new String[] {NONE_FOUND});
248248
jsonInputFileCombo.select(0);
249249
jsonInputFileCombo.setEnabled(false);
250-
jsonInputFileButton.setEnabled(false);
251-
jsonInputButton.setEnabled(true);
252250
jsonInputButton.setSelection(true);
251+
jsonInputFileButton.setSelection(false);
252+
onRadioButtonSelected();
253253
} else {
254254
jsonInputFileCombo.removeAll();
255255
for (IFile jsonFile : jsonFiles) {
@@ -296,36 +296,22 @@ private void onLambdaHandlerComboSelected() {
296296
String handlerClass = lambdaHandlerCombo.getItem(lambdaHandlerCombo.getSelectionIndex());
297297
md.setLastInvokeHandler(handlerClass);
298298
jsonInputFileButton.setSelection(md.getLastInvokeSelectJsonFile());
299-
int index = jsonInputFileCombo.indexOf(md.getLastInvokeJsonFile());
300-
if (index < 0) {
301-
index = 0;
302-
}
303-
jsonInputFileCombo.select(index);
304-
onJsonInputFileButtonSelected();
305-
jsonInputButton.setSelection(md.getLastInvokeSelectJsonInput());
306-
onJsonInputButtonSelected();
299+
jsonInputButton.setSelection(!md.getLastInvokeSelectJsonFile());
300+
onRadioButtonSelected();
307301
showLiveLogButton.setSelection(md.getLastInvokeShowLiveLog());
308302
}
309303

310-
private void onJsonInputFileButtonSelected() {
304+
private void onRadioButtonSelected() {
311305
jsonInputFileCombo.setEnabled(jsonInputFileButton.getSelection());
312-
inputBox.setEditable(!jsonInputFileButton.getSelection());
306+
inputBox.setEditable(jsonInputButton.getSelection());
313307
md.setLastInvokeSelectJsonFile(jsonInputFileButton.getSelection());
314-
md.setLastInvokeSelectJsonInput(!jsonInputFileButton.getSelection());
308+
md.setLastInvokeSelectJsonInput(jsonInputButton.getSelection());
315309
if (jsonInputFileButton.getSelection()) {
316310
onJsonFileSelectionChange();
317-
}
318-
}
319-
320-
private void onJsonInputButtonSelected() {
321-
jsonInputFileCombo.setEnabled(!jsonInputButton.getSelection());
322-
inputBox.setEditable(jsonInputButton.getSelection());
323-
md.setLastInvokeSelectJsonFile(jsonInputButton.getSelection());
324-
md.setLastInvokeSelectJsonInput(!jsonInputButton.getSelection());
325-
if (jsonInputButton.getSelection()) {
311+
} else if (jsonInputButton.getSelection()) {
326312
inputBox.setText(md.getLastInvokeInput());
327313
}
328-
}
314+
}
329315

330316
private void onJsonFileSelectionChange() {
331317
if (jsonInputFileButton.getSelection() == false) {

bundles/com.amazonaws.eclipse.lambda/src/com/amazonaws/eclipse/lambda/project/metadata/LambdaFunctionProjectMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void setLastInvokeShowLiveLog(boolean showLiveLog) {
162162
@JsonIgnore
163163
public boolean getLastInvokeSelectJsonFile() {
164164
LambdaFunctionInvokeMetadata lastInvoke = getLastInvoke();
165-
return lastInvoke == null ? true : lastInvoke.isSelectJsonFile();
165+
return lastInvoke == null ? false : lastInvoke.isSelectJsonFile();
166166
}
167167

168168
@JsonIgnore

releng/com.amazonaws.eclipse.oxygen/com.amazonaws.eclipse.oxygen.target

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<unit id="org.eclipse.swtbot.ide.feature.group" version="2.6.0.201706141832" />
2020
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.6.0.201706141832" />
2121
<unit id="org.eclipse.swtbot.feature.group" version="2.6.0.201706141832" />
22-
<repository location="http://download.eclipse.org/releases/oxygen/"/>
22+
<repository location="http://download.eclipse.org/releases/oxygen/201706281000"/>
2323
</location>
2424
<location includeMode="planner" includeAllPlatforms="false"
2525
includeSource="true" includeConfigurePhase="false" type="InstallableUnit">

tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757
</profile>
5858
</profiles>
5959

60-
</project>
60+
</project>

thirdparty/com.amazonaws.eclipse.javasdk/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Bundle-Name: AWS Toolkit for Eclipse Java SDK Bundle
171171
Bundle-Version: 1.11.130
172172
Built-By: zhaoxiz
173173
Bundle-ManifestVersion: 2
174-
Bnd-LastModified: 1504630313552
174+
Bnd-LastModified: 1507767784574
175175
Created-By: Apache Maven Bundle Plugin
176176
Tool: Bnd-0.0.357
177177
Build-Jdk: 1.8.0_141

0 commit comments

Comments
 (0)