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

Commit 5cc2929

Browse files
author
zhangzhx
committed
AWS Toolkit for Eclipse: v201708161930 Release.
1 parent 9baaced commit 5cc2929

33 files changed

+525
-302
lines changed

CHANGELOG.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"current": [
3+
"* Merge Pull Request: #78",
4+
"* Resolving Issues: #25, #61, #71, and #77",
5+
"* Adding more metrics for AWS Overview Editor, Amazon EC2 Explorer, and Create a new AWS Java Project."
6+
]
7+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2017 Amazon Technologies, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at:
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
11+
* OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
* License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
package com.amazonaws.eclipse.core;
16+
17+
import org.eclipse.jface.action.Action;
18+
19+
import com.amazonaws.eclipse.core.mobileanalytics.AwsToolkitMetricType;
20+
import com.amazonaws.eclipse.core.mobileanalytics.ToolkitAnalyticsUtils;
21+
22+
public class OpenLinkAction extends Action {
23+
private final String linkName;
24+
25+
public OpenLinkAction(String linkName) {
26+
this.linkName = linkName;
27+
}
28+
29+
@Override
30+
public void run() {
31+
ToolkitAnalyticsUtils.publishBooleansEvent(AwsToolkitMetricType.OVERVIEW_OPEN_LINK_ITEM, linkName, true);
32+
}
33+
}

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/mobileanalytics/AwsToolkitMetricType.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
public enum AwsToolkitMetricType {
2121
/* AWS Overview Events */
2222
OVERVIEW("Overview"),
23+
OVERVIEW_OPEN_LINK_ITEM("Overview-OpenLinkItem"),
2324
/* AWS Explorer Events */
2425
EXPLORER_LOADING("Explorer-Loading"),
2526
/* Explorer Dynamodb Actions */
@@ -36,7 +37,7 @@ public enum AwsToolkitMetricType {
3637
EXPLORER_CODECOMMIT_REFRESH_REPO_EDITOR("Explorer-CodeCommitRefreshRepoEditor"),
3738
EXPLORER_CODECOMMIT_CREATE_REPO("Explorer-CodeCommitCreateRepo"),
3839
EXPLORER_CODECOMMIT_CLONE_REPO("Explorer-CodeCommitCloneRepo"),
39-
EXPLORER_CODECOMMIT_DELETE_REPO("Explorer_CodeCommitDeleteRepo"),
40+
EXPLORER_CODECOMMIT_DELETE_REPO("Explorer-CodeCommitDeleteRepo"),
4041
EXPLORER_CODECOMMIT_OPEN_REPO_EDITOR("Explorer-CodeCommitOpenRepoEditor"),
4142
/* Explorer Beanstalk Actions */
4243
EXPLORER_BEANSTALK_OPEN_ENVIRONMENT_EDITOR("Explorer-BeanstalkOpenEnvironmentEditor"),
@@ -54,9 +55,34 @@ public enum AwsToolkitMetricType {
5455
EXPLORER_S3_GENERATE_PRESIGNED_URL("Explorer-S3GeneratePresignedUrl"),
5556
EXPLORER_S3_EDIT_OBJECT_TAGS("Explorer-S3EditObjectTags"),
5657
EXPLORER_S3_EDIT_OBJECT_PERMISSIONS("Explorer-S3EditObjectPermissions"),
58+
/* Explorer EC2 Actions */
59+
EXPLORER_EC2_OPEN_VIEW("Explorer-Ec2OpenView"),
60+
EXPLORER_EC2_OPEN_AMIS_VIEW("Explorer-Ec2OpenAmisView"),
61+
EXPLORER_EC2_OPEN_INSTANCES_VIEW("Explorer-Ec2OpenInstancesView"),
62+
EXPLORER_EC2_OPEN_EBS_VIEW("Explorer-Ec2OpenEbsView"),
63+
EXPLORER_EC2_OPEN_SECURITY_GROUPS_VIEW("Explorer-Ec2OpenSecurityGroupsView"),
64+
EXPLORER_EC2_SELECT_SECURITY_GROUP("Explorer-Ec2SelectSecurityGroup"),
65+
EXPLORER_EC2_NEW_SECURITY_GROUP("Explorer-Ec2NewSecurityGroup"),
66+
EXPLORER_EC2_DELETE_SECURITY_GROUP("Explorer-Ec2DeleteSecurityGroup"),
67+
EXPLORER_EC2_ADD_PERMISSIONS_TO_SECURITY_GROUP("Explorer-Ec2AddPermissionsToSecurityGroup"),
68+
EXPLORER_EC2_REMOVE_PERMISSIONS_FROM_SECURITY_GROUP("Explorer-Ec2RemovePermissionsFromSecurityGroup"),
69+
EXPLORER_EC2_REFRESH_SECURITY_GROUP("Explorer-Ec2RefreshSecurityGroup"),
70+
EXPLORER_EC2_OPEN_SHELL_ACTION("Explorer-Ec2OpenShellAction"),
71+
EXPLORER_EC2_OPEN_SHELL_DIALOG_ACTION("Explorer-Ec2OpenShellDialogAction"),
72+
EXPLORER_EC2_REBOOT_ACTION("Explorer-Ec2RebootAction"),
73+
EXPLORER_EC2_TERMINATE_ACTION("Explorer-Ec2TerminateAction"),
74+
EXPLORER_EC2_CREATE_AMI_ACTION("Explorer-Ec2CreateAmiAction"),
75+
EXPLORER_EC2_COPY_PUBLIC_DNS_NAME_ACTION("Explorer-Ec2CopyPublicDnsNameAction"),
76+
EXPLORER_EC2_ATTACH_NEW_VOLUME_ACTION("Explorer-Ec2AttachNewVolumeAction"),
77+
EXPLORER_EC2_START_INSTANCES_ACTION("Explorer-Ec2StartInstancesAction"),
78+
EXPLORER_EC2_STOP_INSTANCES_ACTION("Explorer-Ec2StopInstancesAction"),
79+
/* Aws level Events */
80+
AWS_NEW_JAVA_PROJECT_WIZARD("Aws-NewJavaProjectWizard"),
5781
/* Dynamodb Events */
5882
DYNAMODB_INSTALL_TEST_TOOL("Dynamodb-InstallTestTool"),
5983
DYNAMODB_UNINSTALL_TEST_TOOL("Dynamodb-UninstallTestTool"),
84+
/* Ec2 Events */
85+
EC2_LAUNCH_INSTANCES("Ec2-LaunchInstances"),
6086
/* Lambda Events */
6187
LAMBDA_NEW_LAMBDA_FUNCTION_WIZARD("Lambda-NewLambdaFunctionWizard"),
6288
LAMBDA_NEW_LAMBDA_PROJECT_WIZARD("Lambda-NewLambdaProjectWizard"),

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/plugin/AbstractAwsProjectWizard.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
public abstract class AbstractAwsProjectWizard extends AbstractAwsWizard implements INewWizard {
3434
protected IStructuredSelection selection;
3535
protected IWorkbench workbench;
36+
private long actionStartTimeMilli;
37+
private long actionEndTimeMilli;
3638

3739
protected AbstractAwsProjectWizard(String windowTitle) {
3840
super(windowTitle);
@@ -47,6 +49,7 @@ public void init(IWorkbench workbench, IStructuredSelection selection) {
4749
@Override
4850
public final boolean performFinish() {
4951
beforeExecution();
52+
actionStartTimeMilli = System.currentTimeMillis();
5053

5154
IRunnableWithProgress runnable = new IRunnableWithProgress() {
5255
@Override
@@ -58,6 +61,7 @@ public void run(IProgressMonitor monitor)
5861
protected void execute(IProgressMonitor monitor) throws CoreException,
5962
InvocationTargetException, InterruptedException {
6063
IStatus status = doFinish(monitor);
64+
actionEndTimeMilli = System.currentTimeMillis();
6165
afterExecution(status);
6266
if (status.getSeverity() == IStatus.ERROR) {
6367
throw new InvocationTargetException(status.getException(), status.getMessage());
@@ -85,5 +89,9 @@ protected void execute(IProgressMonitor monitor) throws CoreException,
8589
return status.isOK();
8690
}
8791

92+
protected long getActionExecutionTimeMillis() {
93+
return actionEndTimeMilli - actionStartTimeMilli;
94+
}
95+
8896
protected abstract AbstractAwsPlugin getPlugin();
8997
}

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/ui/overview/FormsOverviewComposite.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.eclipse.core.runtime.Platform;
2929
import org.eclipse.core.runtime.Status;
3030
import org.eclipse.core.runtime.jobs.Job;
31+
import org.eclipse.jface.action.Action;
3132
import org.eclipse.swt.SWT;
3233
import org.eclipse.swt.layout.FillLayout;
3334
import org.eclipse.swt.layout.GridLayout;
@@ -41,7 +42,10 @@
4142

4243
import com.amazonaws.eclipse.core.AwsToolkitCore;
4344
import com.amazonaws.eclipse.core.AwsUrls;
45+
import com.amazonaws.eclipse.core.OpenLinkAction;
4446
import com.amazonaws.eclipse.core.diagnostic.utils.EmailMessageLauncher;
47+
import com.amazonaws.eclipse.core.mobileanalytics.AwsToolkitMetricType;
48+
import com.amazonaws.eclipse.core.mobileanalytics.ToolkitAnalyticsUtils;
4549
import com.amazonaws.eclipse.core.util.RssFeed;
4650
import com.amazonaws.eclipse.core.util.RssFeed.Item;
4751
import com.amazonaws.eclipse.core.util.RssFeedParser;
@@ -168,7 +172,6 @@ public void dispose() {
168172
super.dispose();
169173
}
170174

171-
172175
/*
173176
* Private Interface
174177
*/
@@ -207,22 +210,22 @@ private Composite createResourcesSection(Composite parent) {
207210
composite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
208211
overviewToolkit.newListItem(composite,
209212
"AWS Toolkit for Eclipse Homepage",
210-
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_HOMEPAGE_URL, null);
213+
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_HOMEPAGE_URL, new OpenLinkAction("AwsToolkitForEclipseHomepage"));
211214
overviewToolkit.newListItem(composite,
212215
"AWS Java Development Forum",
213-
AwsUrls.JAVA_DEVELOPMENT_FORUM_URL, null);
216+
AwsUrls.JAVA_DEVELOPMENT_FORUM_URL, new OpenLinkAction("AwsJavaDevelopmentForum"));
214217
overviewToolkit.newListItem(composite,
215218
"Frequently Asked Questions",
216-
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_FAQ_URL, null);
219+
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_FAQ_URL, new OpenLinkAction("FrequentlyAskedQuestion"));
217220
overviewToolkit.newListItem(composite,
218221
"AWS Toolkit for Eclipse Source Code",
219-
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_GITHUB_URL, null);
222+
AwsUrls.AWS_TOOLKIT_FOR_ECLIPSE_GITHUB_URL, new OpenLinkAction("AwsToolkitForEclipseSourceCode"));
220223
overviewToolkit.newListItem(composite,
221224
"AWS Management Console",
222-
AwsUrls.AWS_MANAGEMENT_CONSOLE_URL, null);
225+
AwsUrls.AWS_MANAGEMENT_CONSOLE_URL, new OpenLinkAction("AwsManagementConsole"));
223226
overviewToolkit.newListItem(composite,
224227
"Send Feedback to " + EmailMessageLauncher.AWS_ECLIPSE_FEEDBACK_AT_AMZN,
225-
"mailto:" + EmailMessageLauncher.AWS_ECLIPSE_FEEDBACK_AT_AMZN, null);
228+
"mailto:" + EmailMessageLauncher.AWS_ECLIPSE_FEEDBACK_AT_AMZN, new OpenLinkAction("SendFeedback"));
226229

227230
return composite;
228231
}
@@ -259,13 +262,12 @@ public void run() {
259262
for (Control control : composite.getChildren()) control.dispose();
260263

261264
if (items == null || items.isEmpty()) {
262-
toolkit.newListItem(composite, "AWS Java Developer Blog", JAVA_DEVELOPER_BLOG_URL, null);
263-
265+
toolkit.newListItem(composite, "AWS Java Developer Blog", JAVA_DEVELOPER_BLOG_URL, new OpenLinkAction("AWS Java Developer Blog"));
264266
} else {
265267
for (Item message : items) {
266268
toolkit.newListItem(composite,
267269
message.getTitle(), message.getLink(),
268-
null);
270+
new OpenLinkAction("AWS Blog: " + message.getTitle()));
269271
}
270272
}
271273

bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/explorer/AwsAction.java

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,37 @@
1515
package com.amazonaws.eclipse.explorer;
1616

1717
import org.eclipse.jface.action.Action;
18+
import org.eclipse.jface.resource.ImageDescriptor;
1819

1920
import com.amazonaws.eclipse.core.mobileanalytics.AwsToolkitMetricType;
2021
import com.amazonaws.eclipse.core.mobileanalytics.MetricsDataModel;
2122

2223
public abstract class AwsAction extends Action {
23-
private static final String END_RESULT = "EndResult";
24-
private static final String PERFORMED = "Performed";
25-
private static final String SUCCEEDED = "Succeeded";
26-
private static final String FAILED = "Failed";
27-
private static final String CANCELED = "Canceled";
24+
public static final String END_RESULT = "EndResult";
25+
public static final String PERFORMED = "Performed";
26+
public static final String SUCCEEDED = "Succeeded";
27+
public static final String FAILED = "Failed";
28+
public static final String CANCELED = "Canceled";
2829

2930
private final MetricsDataModel metricsDataModel;
3031

3132
protected AwsAction(AwsToolkitMetricType metricType) {
3233
metricsDataModel = new MetricsDataModel(metricType);
3334
}
3435

36+
protected AwsAction(AwsToolkitMetricType metricType, String text) {
37+
super(text);
38+
this.metricsDataModel = new MetricsDataModel(metricType);
39+
}
40+
3541
protected AwsAction(AwsToolkitMetricType metricType, String text, int style) {
3642
super(text, style);
37-
this.metricsDataModel= new MetricsDataModel(metricType);
43+
this.metricsDataModel = new MetricsDataModel(metricType);
44+
}
45+
46+
protected AwsAction(AwsToolkitMetricType metricType, String text, ImageDescriptor image) {
47+
super(text, image);
48+
this.metricsDataModel = new MetricsDataModel(metricType);
3849
}
3950

4051
private final void actionPerformed() {
@@ -74,4 +85,9 @@ public static void publishFailedAction(AwsToolkitMetricType metricType) {
7485
public static void publishSucceededAction(AwsToolkitMetricType metricType) {
7586
new MetricsDataModel(metricType).addAttribute(END_RESULT, SUCCEEDED).publishEvent();
7687
}
88+
89+
// Helper method to publish a performed action metric immediately
90+
public static void publishPerformedAction(AwsToolkitMetricType metricType) {
91+
new MetricsDataModel(metricType).addAttribute(END_RESULT, PERFORMED).publishEvent();
92+
}
7793
}

bundles/com.amazonaws.eclipse.ec2/build.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ bin.includes = META-INF/,\
99
LICENSE,\
1010
lib/jsch-0.1.40/LICENSE,\
1111
etc/,\
12-
lib/jsch-0.1.40/jsch-0.1.40.jar
12+
lib/jsch-0.1.40/jsch-0.1.40.jar,\
13+
lib/PemToPPKConverter.exe
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2017 Amazon Technologies, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at:
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
11+
* OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
* License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
package com.amazonaws.eclipse.ec2;
16+
17+
public class Ec2PluginConstants {
18+
public static final String AMIS_VIEW_ID = "com.amazonaws.eclipse.ec2.ui.views.AmiBrowserView";
19+
public static final String INSTANCES_VIEW_ID = "com.amazonaws.eclipse.ec2.ui.views.InstanceView";
20+
public static final String EBS_VIEW_ID = "com.amazonaws.eclipse.ec2.ui.views.ElasticBlockStorageView";
21+
public static final String SECURITY_GROUPS_VIEW_ID = "com.amazonaws.eclipse.ec2.views.SecurityGroupView";
22+
}

0 commit comments

Comments
 (0)