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

Commit

Permalink
AWS Toolkit for Eclipse: v201710120027 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhx committed Oct 12, 2017
1 parent a79ec15 commit 7fc3a2c
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 66 deletions.
39 changes: 21 additions & 18 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
{
"current": [
"* **Support Lambda function versioning and alias**",
"",
" * Upload Lambda function to AWS with alias and S3 Server-Side-Encryption.",
"![LambdaVersioningEncryption-upload](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-upload.gif)",
"",
" * Check the result in AWS Lambda and Amazon S3 in AWS console.",
"![LambdaVersioningEncryption-result](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-result.gif)",
"",
"* **Better support right click in the Project Explorer. Previously, it only supports project level right click.**",
"![BetterSupportProjectExplorerForAwsLambdaActions](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/BetterSupportProjectExplorerForAwsLambdaActions.png)",
"",
"* **Move Decorators from project level to java class level to record the mapping remote AWS Lambda function**",
"![LambdaProjectDecorator](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaProjectDecorator.png)",
"",
"* **Update the Invoke function dialog UI for supporting choosing from multiple handlers instead of invoking only the last deployed function.**",
"![InvokeLambda](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/InvokeLambda.png)",
"",
"* **Resolving Issue: #56, #58, #66, #72.**"
"* **Resolving Issues: #50, #82.**"
],
"v201709262229 ": [
"* **Support Lambda function versioning and alias**",
"",
" * Upload Lambda function to AWS with alias and S3 Server-Side-Encryption.",
"![LambdaVersioningEncryption-upload](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-upload.gif)",
"",
" * Check the result in AWS Lambda and Amazon S3 in AWS console.",
"![LambdaVersioningEncryption-result](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaVersioningEncryption-result.gif)",
"",
"* **Better support right click in the Project Explorer. Previously, it only supports project level right click.**",
"![BetterSupportProjectExplorerForAwsLambdaActions](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/BetterSupportProjectExplorerForAwsLambdaActions.png)",
"",
"* **Move Decorators from project level to java class level to record the mapping remote AWS Lambda function**",
"![LambdaProjectDecorator](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/LambdaProjectDecorator.png)",
"",
"* **Update the Invoke function dialog UI for supporting choosing from multiple handlers instead of invoking only the last deployed function.**",
"![InvokeLambda](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/InvokeLambda.png)",
"",
"* **Resolving Issue: #56, #58, #66, #72.**"
],
"201709081818 ": [
"* Merge Pull Request: #81",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ public class AWSClientFactory {
/** Manages the cached client objects by region. **/
private CachedClients cachedClients = new CachedClients();

private final String accountId;

/**
* The account info for accessing the user's credentials.
*/
private final AccountInfo accountInfo;
private AccountInfo accountInfo;

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

AwsToolkitCore plugin = AwsToolkitCore.getDefault();

this.accountId = accountId;
accountInfo = plugin.getAccountManager().getAccountInfo(accountId);

plugin.getProxyService().addProxyChangeListener(new IProxyChangeListener() {
@Override
public void proxyInfoChanged(IProxyChangeEvent event) {
cachedClientsByEndpoint.invalidateClients();
cachedClients.invalidateClients();
}
});
plugin.getProxyService().addProxyChangeListener(this::onProxyChange);
plugin.getAccountManager().addAccountInfoChangeListener(this::onAccountInfoChange);
}

plugin.getAccountManager().addAccountInfoChangeListener(new AccountInfoChangeListener() {
@Override
public void onAccountInfoChange() {
cachedClientsByEndpoint.invalidateClients();
cachedClients.invalidateClients();
}
private void onProxyChange(IProxyChangeEvent e) {
onAccountInfoChange();
}

});
private void onAccountInfoChange() {
// 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.
accountInfo = AwsToolkitCore.getDefault().getAccountManager().getAccountInfo(accountId);
cachedClientsByEndpoint.invalidateClients();
cachedClients.invalidateClients();
}

// Returns an anonymous S3 client in us-east-1 region for fetching public-read files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

import com.amazonaws.eclipse.core.AwsToolkitCore;
import com.amazonaws.eclipse.core.preferences.PreferenceConstants;
import com.amazonaws.eclipse.core.ui.WebLinkListener;
import com.amazonaws.eclipse.core.ui.preferences.AwsToolkitPreferencePage;
import com.amazonaws.eclipse.core.ui.wizards.WizardWidgetFactory;

public class ToolkitAnalyticsPreferencePage extends AwsToolkitPreferencePage
implements IWorkbenchPreferencePage {
Expand Down Expand Up @@ -53,12 +55,15 @@ protected Control createContents(Composite parent) {
gridData.widthHint = 300;
composite.setLayoutData(gridData);

analyticsEnabledButton = new Button(composite, SWT.CHECK | SWT.MULTI | SWT.WRAP);
analyticsEnabledButton.setText(
WizardWidgetFactory.newLink(composite, new WebLinkListener(), String.format(
"By leaving this box checked, you agree that AWS may anonymously " +
"collect analytics about your usage of AWS Toolkit. AWS will handle " +
"all information received in accordance with the AWS Privacy Policy " +
"(http://aws.amazon.com/privacy/)");
"all information received in accordance with the <a href=\"%s\">AWS Privacy Policy</a>.",
"http://aws.amazon.com/privacy/"),
1);

analyticsEnabledButton = new Button(composite, SWT.CHECK | SWT.MULTI | SWT.WRAP);
analyticsEnabledButton.setText("Enable anonymous collection of analytics");
analyticsEnabledButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
analyticsEnabledButton.setSelection(getPreferenceStore().getBoolean(
PreferenceConstants.P_TOOLKIT_ANALYTICS_COLLECTION_ENABLED));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void widgetSelected(SelectionEvent e) {
jsonInputFileButton = newRadioButton(container, "Select one of the JSON files as input: ", 1, false, new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
onJsonInputFileButtonSelected();
onRadioButtonSelected();
}
});
jsonInputFileCombo = newCombo(container, 1);
Expand All @@ -130,7 +130,7 @@ public void widgetSelected(SelectionEvent e) {
jsonInputButton = newRadioButton(container, "Enter the JSON input for your function", 2, false, new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
onJsonInputButtonSelected();
onRadioButtonSelected();
}
});

Expand Down Expand Up @@ -247,9 +247,9 @@ private void loadJsonFilesAsync() {
jsonInputFileCombo.setItems(new String[] {NONE_FOUND});
jsonInputFileCombo.select(0);
jsonInputFileCombo.setEnabled(false);
jsonInputFileButton.setEnabled(false);
jsonInputButton.setEnabled(true);
jsonInputButton.setSelection(true);
jsonInputFileButton.setSelection(false);
onRadioButtonSelected();
} else {
jsonInputFileCombo.removeAll();
for (IFile jsonFile : jsonFiles) {
Expand Down Expand Up @@ -296,36 +296,22 @@ private void onLambdaHandlerComboSelected() {
String handlerClass = lambdaHandlerCombo.getItem(lambdaHandlerCombo.getSelectionIndex());
md.setLastInvokeHandler(handlerClass);
jsonInputFileButton.setSelection(md.getLastInvokeSelectJsonFile());
int index = jsonInputFileCombo.indexOf(md.getLastInvokeJsonFile());
if (index < 0) {
index = 0;
}
jsonInputFileCombo.select(index);
onJsonInputFileButtonSelected();
jsonInputButton.setSelection(md.getLastInvokeSelectJsonInput());
onJsonInputButtonSelected();
jsonInputButton.setSelection(!md.getLastInvokeSelectJsonFile());
onRadioButtonSelected();
showLiveLogButton.setSelection(md.getLastInvokeShowLiveLog());
}

private void onJsonInputFileButtonSelected() {
private void onRadioButtonSelected() {
jsonInputFileCombo.setEnabled(jsonInputFileButton.getSelection());
inputBox.setEditable(!jsonInputFileButton.getSelection());
inputBox.setEditable(jsonInputButton.getSelection());
md.setLastInvokeSelectJsonFile(jsonInputFileButton.getSelection());
md.setLastInvokeSelectJsonInput(!jsonInputFileButton.getSelection());
md.setLastInvokeSelectJsonInput(jsonInputButton.getSelection());
if (jsonInputFileButton.getSelection()) {
onJsonFileSelectionChange();
}
}

private void onJsonInputButtonSelected() {
jsonInputFileCombo.setEnabled(!jsonInputButton.getSelection());
inputBox.setEditable(jsonInputButton.getSelection());
md.setLastInvokeSelectJsonFile(jsonInputButton.getSelection());
md.setLastInvokeSelectJsonInput(!jsonInputButton.getSelection());
if (jsonInputButton.getSelection()) {
} else if (jsonInputButton.getSelection()) {
inputBox.setText(md.getLastInvokeInput());
}
}
}

private void onJsonFileSelectionChange() {
if (jsonInputFileButton.getSelection() == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void setLastInvokeShowLiveLog(boolean showLiveLog) {
@JsonIgnore
public boolean getLastInvokeSelectJsonFile() {
LambdaFunctionInvokeMetadata lastInvoke = getLastInvoke();
return lastInvoke == null ? true : lastInvoke.isSelectJsonFile();
return lastInvoke == null ? false : lastInvoke.isSelectJsonFile();
}

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<unit id="org.eclipse.swtbot.ide.feature.group" version="2.6.0.201706141832" />
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.6.0.201706141832" />
<unit id="org.eclipse.swtbot.feature.group" version="2.6.0.201706141832" />
<repository location="http://download.eclipse.org/releases/oxygen/"/>
<repository location="http://download.eclipse.org/releases/oxygen/201706281000"/>
</location>
<location includeMode="planner" includeAllPlatforms="false"
includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
Expand Down
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
</profile>
</profiles>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Bundle-Name: AWS Toolkit for Eclipse Java SDK Bundle
Bundle-Version: 1.11.130
Built-By: zhaoxiz
Bundle-ManifestVersion: 2
Bnd-LastModified: 1504630313552
Bnd-LastModified: 1507767784574
Created-By: Apache Maven Bundle Plugin
Tool: Bnd-0.0.357
Build-Jdk: 1.8.0_141
Expand Down

0 comments on commit 7fc3a2c

Please sign in to comment.