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: v201712181839 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhx committed Dec 18, 2017
1 parent 7f6ef6d commit 676b728
Show file tree
Hide file tree
Showing 88 changed files with 4,852 additions and 645 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"current": [
"**Support AWS SAM Local to locally debug Lambda functions and AWS Gateway**",
"",
"* Debug Lambda Function",
"![debug-lambda-function](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/debug-lambda-function.gif)",
"",
"* Debug API Gateway",
"![debug-api-gateway](https://s3.amazonaws.com/aws-eclipse-toolkit/eclipse/release/debug-api-gateway.gif)"
],
"v201710260046": [
"* Update Java SDK samples."
],
"v201710231659": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.PojoObservables;
import org.eclipse.core.databinding.beans.PojoProperties;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
Expand Down Expand Up @@ -117,19 +118,13 @@ private void createUsernamePasswordSection() {
+ "Toolkit for Eclipse to create a new set of Git credentials under the current selected account. see "
+ "<a href=\"%s\">CreateServiceSpecificCredential</a> for more information.", GIT_CREDENTIALS_DOC, CREATE_SERVICE_SPECIFIC_CREDENTIALS_DOC), 2);

usernameComplex = TextComplex.builder()
.composite(this)
.dataBindingContext(dataBindingContext)
.pojoObservableValue(PojoObservables.observeValue(dataModel, P_USERNAME))
usernameComplex = TextComplex.builder(this, dataBindingContext, PojoObservables.observeValue(dataModel, P_USERNAME))
.addValidator(usernameValidator == null ? new NotEmptyValidator("User name must be provided!") : usernameValidator)
.labelValue("User name:")
.defaultValue(dataModel.getUsername())
.build();

passwordComplex = TextComplex.builder()
.composite(this)
.dataBindingContext(dataBindingContext)
.pojoObservableValue(PojoObservables.observeValue(dataModel, P_PASSWORD))
passwordComplex = TextComplex.builder(this, dataBindingContext, PojoObservables.observeValue(dataModel, P_PASSWORD))
.addValidator(passwordValidator == null ? new NotEmptyValidator("Password must be provided!") : passwordValidator)
.labelValue("Password: ")
.defaultValue(dataModel.getPassword())
Expand Down
11 changes: 9 additions & 2 deletions bundles/com.amazonaws.eclipse.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Export-Package: com.amazonaws.eclipse.core,
com.amazonaws.eclipse.core.accounts,
com.amazonaws.eclipse.core.accounts.preferences,
com.amazonaws.eclipse.core.accounts.profiles,
com.amazonaws.eclipse.core.ansi,
com.amazonaws.eclipse.core.diagnostic.utils,
com.amazonaws.eclipse.core.egit,
com.amazonaws.eclipse.core.egit.jobs,
Expand Down Expand Up @@ -60,6 +61,7 @@ Require-Bundle: org.eclipse.swt,
org.eclipse.m2e.archetype.common;bundle-version="1.5.1",
org.eclipse.m2e.maven.runtime;bundle-version="1.5.1",
org.eclipse.ui.ide,
org.eclipse.ui.console,
org.eclipse.egit;bundle-version="3.4.2",
org.eclipse.egit.core;bundle-version="3.4.2",
org.eclipse.egit.doc;bundle-version="3.4.2",
Expand All @@ -68,7 +70,12 @@ Require-Bundle: org.eclipse.swt,
org.eclipse.core.variables;bundle-version="3.2.800",
org.eclipse.equinox.security;bundle-version="1.2.0",
org.eclipse.core.databinding.property,
com.amazonaws.eclipse.javasdk;bundle-version="1.11.130"
com.amazonaws.eclipse.javasdk;bundle-version="1.11.130",
org.eclipse.m2e.launching
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.jdt.launching
Import-Package: org.eclipse.debug.core,
org.eclipse.debug.core.model,
org.eclipse.debug.ui,
org.eclipse.jdt.annotation,
org.eclipse.jdt.launching
60 changes: 60 additions & 0 deletions bundles/com.amazonaws.eclipse.core/etc/regions.xml

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bundles/com.amazonaws.eclipse.core/icons/logo_aws.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,7 @@ private <T extends AmazonWebServiceClient> T createClient(String endpoint, Class
// Low layer method for building a service client by using the client builder.
@SuppressWarnings("unchecked")
private <T> T createClientByRegion(AwsSyncClientBuilder<? extends AwsSyncClientBuilder, T> builder, String region, String endpoint) {
if (region.equals("local")) {
builder.withEndpointConfiguration(new EndpointConfiguration(endpoint, region));
} else {
builder.withRegion(region);
}
builder.withEndpointConfiguration(new EndpointConfiguration(endpoint, region));
Object client = builder
.withCredentials(new AWSStaticCredentialsProvider(getAwsCredentials()))
.withClientConfiguration(createClientConfiguration(endpoint))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,9 @@ private static void registerCustomErrorSupport() {
Policy.setErrorSupportProvider(awsProvider);
}

// TODO: any better way to check debug mode?
public static final boolean DEBUG_MODE = false;
public boolean isDebugMode() {
return getBundleVersion().contains("qualifier");
}

private ToolkitAnalyticsManager initializeToolkitAnalyticsManager() {

Expand All @@ -535,7 +536,7 @@ private ToolkitAnalyticsManager initializeToolkitAnalyticsManager() {

if (enabled) {
try {
if (DEBUG_MODE) {
if (isDebugMode()) {
toReturn = new ToolkitAnalyticsManagerImpl(
AWSCognitoCredentialsProvider.TEST_PROVIDER,
ClientContextConfig.TEST_CONFIG);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.amazonaws.eclipse.core.ansi;

//From Wikipedia, http://en.wikipedia.org/wiki/ANSI_escape_code
public class AnsiCommands {
public static final int COMMAND_ATTR_RESET = 0; // Reset / Normal (all attributes off)
public static final int COMMAND_ATTR_INTENSITY_BRIGHT = 1; // Bright (increased intensity) or Bold
public static final int COMMAND_ATTR_INTENSITY_FAINT = 2; // Faint (decreased intensity) (not widely supported)
public static final int COMMAND_ATTR_ITALIC = 3; // Italic: on not widely supported. Sometimes treated as inverse.
public static final int COMMAND_ATTR_UNDERLINE = 4; // Underline: Single
public static final int COMMAND_ATTR_BLINK_SLOW = 5; // Blink: Slow (less than 150 per minute)
public static final int COMMAND_ATTR_BLINK_FAST = 6; // Blink: Rapid (MS-DOS ANSI.SYS; 150 per minute or more; not widely supported)
public static final int COMMAND_ATTR_NEGATIVE_ON = 7; // Image: Negative (inverse or reverse; swap foreground and background)
public static final int COMMAND_ATTR_CONCEAL_ON = 8; // Conceal (not widely supported)
public static final int COMMAND_ATTR_CROSSOUT_ON = 9; // Crossed-out (Characters legible, but marked for deletion. Not widely supported.)
public static final int COMMAND_ATTR_UNDERLINE_DOUBLE = 21; // Bright/Bold: off or Underline: Double (bold off not widely supported, double underline hardly ever)
public static final int COMMAND_ATTR_INTENSITY_NORMAL = 22; // Normal color or intensity (neither bright, bold nor faint)
public static final int COMMAND_ATTR_ITALIC_OFF = 23; // Not italic, not Fraktur
public static final int COMMAND_ATTR_UNDERLINE_OFF = 24; // Underline: None (not singly or doubly underlined)
public static final int COMMAND_ATTR_BLINK_OFF = 25; // Blink: off
public static final int COMMAND_ATTR_NEGATIVE_OFF = 27; // Image: Positive
public static final int COMMAND_ATTR_CONCEAL_OFF = 28; // Reveal (conceal off)
public static final int COMMAND_ATTR_CROSSOUT_OFF = 29; // Not crossed out

// Extended colors. Next arguments are 5;<index_0_255> or 2;<red_0_255>;<green_0_255>;<blue_0_255>
public static final int COMMAND_HICOLOR_FOREGROUND = 38; // Set text color
public static final int COMMAND_HICOLOR_BACKGROUND = 48; // Set background color

public static final int COMMAND_COLOR_FOREGROUND_RESET = 39; // Default text color
public static final int COMMAND_COLOR_BACKGROUND_RESET = 49; // Default background color

public static final int COMMAND_COLOR_FOREGROUND_FIRST = 30; // First text color
public static final int COMMAND_COLOR_FOREGROUND_LAST = 37; // Last text color
public static final int COMMAND_COLOR_BACKGROUND_FIRST = 40; // First background text color
public static final int COMMAND_COLOR_BACKGROUND_LAST = 47; // Last background text color

public static final int COMMAND_ATTR_FRAMED_ON = 51; // Framed
public static final int COMMAND_ATTR_FRAMED_OFF = 54; // Not framed or encircled

public static final int COMMAND_HICOLOR_FOREGROUND_FIRST = 90; // First text color
public static final int COMMAND_HICOLOR_FOREGROUND_LAST = 97; // Last text color
public static final int COMMAND_HICOLOR_BACKGROUND_FIRST = 100; // First background text color
public static final int COMMAND_HICOLOR_BACKGROUND_LAST = 107; // Last background text color

public static final int COMMAND_COLOR_INTENSITY_DELTA = 8; // Last background text color
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.amazonaws.eclipse.core.ansi;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;

import com.amazonaws.eclipse.core.util.OsPlatformUtils;

import static com.amazonaws.eclipse.core.ansi.AnsiCommands.*;

public class AnsiConsoleAttributes implements Cloneable {
public final static int UNDERLINE_NONE = -1; // nothing in SWT, a bit of an abuse

public Integer currentBgColor;
public Integer currentFgColor;
public int underline;
public boolean bold;
public boolean italic;
public boolean invert;
public boolean conceal;
public boolean strike;
public boolean framed;

public AnsiConsoleAttributes() {
reset();
}

public void reset() {
currentBgColor = null;
currentFgColor = null;
underline = UNDERLINE_NONE;
bold = false;
italic = false;
invert = false;
conceal = false;
strike = false;
framed = false;
}

@Override
public AnsiConsoleAttributes clone() {
AnsiConsoleAttributes result = new AnsiConsoleAttributes();
result.currentBgColor = currentBgColor;
result.currentFgColor = currentFgColor;
result.underline = underline;
result.bold = bold;
result.italic = italic;
result.invert = invert;
result.conceal = conceal;
result.strike = strike;
result.framed = framed;
return result;
}

public static Color hiliteRgbColor(Color c) {
if (c == null)
return new Color(null, new RGB(0xff, 0xff, 0xff));
int red = c.getRed() * 2;
int green = c.getGreen() * 2;
int blue = c.getBlue() * 2;

if (red > 0xff) red = 0xff;
if (green > 0xff) green = 0xff;
if (blue > 0xff) blue = 0xff;

return new Color(null, new RGB(red, green, blue)); // here
}

// This function maps from the current attributes as "described" by escape sequences to real,
// Eclipse console specific attributes (resolving color palette, default colors, etc.)
public static void updateRangeStyle(StyleRange range, AnsiConsoleAttributes attribute) {
boolean useWindowsMapping = OsPlatformUtils.isWindows();
AnsiConsoleAttributes tempAttrib = attribute.clone();

boolean hilite = false;

if (useWindowsMapping) {
if (tempAttrib.bold) {
tempAttrib.bold = false; // not supported, rendered as intense, already done that
hilite = true;
}
if (tempAttrib.italic) {
tempAttrib.italic = false;
tempAttrib.invert = true;
}
tempAttrib.underline = UNDERLINE_NONE; // not supported on Windows
tempAttrib.strike = false; // not supported on Windows
tempAttrib.framed = false; // not supported on Windows
}

// Prepare the foreground color
if (hilite) {
if (tempAttrib.currentFgColor == null) {
range.foreground = AnsiConsolePreferenceUtils.getDebugConsoleFgColor();
range.foreground = hiliteRgbColor(range.foreground);
} else {
if (tempAttrib.currentFgColor < COMMAND_COLOR_INTENSITY_DELTA)
range.foreground = new Color(null, AnsiConsoleColorPalette.getColor(tempAttrib.currentFgColor + COMMAND_COLOR_INTENSITY_DELTA));
else
range.foreground = new Color(null, AnsiConsoleColorPalette.getColor(tempAttrib.currentFgColor));
}
} else {
if (tempAttrib.currentFgColor != null)
range.foreground = new Color(null, AnsiConsoleColorPalette.getColor(tempAttrib.currentFgColor));
}

// Prepare the background color
if (tempAttrib.currentBgColor != null)
range.background = new Color(null, AnsiConsoleColorPalette.getColor(tempAttrib.currentBgColor));

// These two still mess with the foreground/background colors
// We need to solve them before we use them for strike/underline/frame colors
if (tempAttrib.invert) {
if (range.foreground == null)
range.foreground = AnsiConsolePreferenceUtils.getDebugConsoleFgColor();
if (range.background == null)
range.background = AnsiConsolePreferenceUtils.getDebugConsoleBgColor();
Color tmp = range.background;
range.background = range.foreground;
range.foreground = tmp;
}

if (tempAttrib.conceal) {
if (range.background == null)
range.background = AnsiConsolePreferenceUtils.getDebugConsoleBgColor();
range.foreground = range.background;
}

range.font = null;
range.fontStyle = SWT.NORMAL;
// Prepare the rest of the attributes
if (tempAttrib.bold)
range.fontStyle |= SWT.BOLD;

if (tempAttrib.italic)
range.fontStyle |= SWT.ITALIC;

if (tempAttrib.underline != UNDERLINE_NONE) {
range.underline = true;
range.underlineColor = range.foreground;
range.underlineStyle = tempAttrib.underline;
}
else
range.underline = false;

range.strikeout = tempAttrib.strike;
range.strikeoutColor = range.foreground;

if (tempAttrib.framed) {
range.borderStyle = SWT.BORDER_SOLID;
range.borderColor = range.foreground;
}
else
range.borderStyle = SWT.NONE;
}
}
Loading

0 comments on commit 676b728

Please sign in to comment.