Skip to content

Commit d6d3c7b

Browse files
authored
Added menu item to create a new flex project (#1501)
* Added 'Google App Engine Flexible Java Project' menu item under the GCP dropdown and under File->New->Project * Added FlexFacetPropertyTester * Added the google as the provider for org.mockito.stubbing. Tests work again. * Add test for FlexFacetPropertyTester * Changes the type for the property tester * Moved FlexFacetPropertyTester to c.g.c.t.e.util, renamed it to FacetExistsPropertyTester and made the functionality more general so that it supports any facet * Removed dependency of com.google.cloud.tools.eclipse.appengine.flex on com.google.cloud.tools.eclipse.appengine.ui * No need to export c.g.c.t.e.appengine.flex * Updated javadoc * Moved the declaration of the flex creation wizard in the gcp drop down from c.g.c.t.e.appengine.ui to c.g.c.t.e.appengine.flex * Moved dependecies to Imported Packages * Did not have the correct namespace for AppEngineFlexProjectWizard. Fixed now * Fixed text for flex wizard description
1 parent b18ceed commit d6d3c7b

13 files changed

Lines changed: 172 additions & 8 deletions

File tree

plugins/com.google.cloud.tools.eclipse.appengine.flex.test/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Require-Bundle: org.eclipse.wst.common.project.facet.core,
1515
Fragment-Host: com.google.cloud.tools.eclipse.appengine.flex
1616
Import-Package: org.mockito;provider=google;version="1.10.19",
1717
org.mockito.runners;provider=google;version="1.10.19",
18-
org.mockito.stubbing;version="1.10.19"
18+
org.mockito.stubbing;provider=google;version="1.10.19"

plugins/com.google.cloud.tools.eclipse.appengine.flex.test/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@
5151
</plugins>
5252
</build>
5353
</project>
54-
>

plugins/com.google.cloud.tools.eclipse.appengine.flex/META-INF/MANIFEST.MF

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ Bundle-Vendor: Google Inc.
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
99
Bundle-Localization: plugin
1010
Require-Bundle: org.eclipse.wst.common.project.facet.core
11-
Import-Package: com.google.cloud.tools.eclipse.appengine.facets
11+
Import-Package: com.google.cloud.tools.eclipse.appengine.facets,
12+
com.google.cloud.tools.eclipse.appengine.newproject,
13+
com.google.cloud.tools.eclipse.appengine.newproject.flex,
14+
com.google.cloud.tools.eclipse.util.service,
15+
org.eclipse.core.expressions,
16+
org.eclipse.core.resources,
17+
org.eclipse.core.runtime;version="3.5.0",
18+
org.eclipse.ui
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
flexFacetName = App Engine Java Flexible Environment
22
flexFacetDescription = Supply App Engine Flexible Environment Functionality
3+
4+
flexWizardDescription=Creates an App Engine Flexible Java project.
5+
flexWizardName=Google App Engine Flexible Java Project
6+
gcpCategory = Google Cloud Platform

plugins/com.google.cloud.tools.eclipse.appengine.flex/plugin.xml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,65 @@
2828
</action>
2929
</extension>
3030

31-
</plugin>
31+
<extension point="org.eclipse.ui.newWizards">
32+
<wizard
33+
id="com.google.cloud.tools.eclipse.appengine.newproject.AppEngineFlex"
34+
name="%flexWizardName"
35+
class="com.google.cloud.tools.eclipse.util.service.ServiceContextFactory:com.google.cloud.tools.eclipse.appengine.newproject.flex.AppEngineFlexProjectWizard"
36+
icon="platform:/plugin/com.google.cloud.tools.eclipse.appengine.ui/icons/gae-16x16.png"
37+
project="true"
38+
category="com.google.cloud.tools.eclipse.appengine.wizards">
39+
<description>%flexWizardDescription</description>
40+
<selection class="org.eclipse.core.resources.IResource"/>
41+
<keywordReference id="com.google.cloud.tools.eclipse.appengine.ui.FlexKeyword"/>
42+
<keywordReference id="com.google.cloud.tools.eclipse.appengine.ui.GCPKeyword"/>
43+
<keywordReference id="com.google.cloud.tools.eclipse.appengine.ui.GAEKeyword"/>
44+
<keywordReference id="com.google.cloud.tools.eclipse.appengine.ui.GoogleKeyword"/>
45+
<keywordReference
46+
id="com.google.cloud.tools.eclipse.appengine.ui.AppEngineKeyword"/>
47+
<keywordReference
48+
id="com.google.cloud.tools.eclipse.appengine.ui.AppSpaceEngineKeyword"/>
49+
</wizard>
50+
<category
51+
id="com.google.cloud.tools.eclipse.appengine.wizards"
52+
name="%gcpCategory" />
53+
</extension>
54+
<extension
55+
point="org.eclipse.ui.perspectiveExtensions">
56+
<perspectiveExtension
57+
targetID="org.eclipse.jdt.ui.JavaPerspective">
58+
<newWizardShortcut
59+
id="com.google.cloud.tools.eclipse.appengine.newproject.AppEngineFlex">
60+
</newWizardShortcut>
61+
</perspectiveExtension>
62+
<perspectiveExtension
63+
targetID="org.eclipse.jst.j2ee.J2EEPerspective">
64+
<newWizardShortcut
65+
id="com.google.cloud.tools.eclipse.appengine.newproject.AppEngineFlex">
66+
</newWizardShortcut>
67+
</perspectiveExtension>
68+
<perspectiveExtension
69+
targetID="org.eclipse.wst.web.ui.webDevPerspective">
70+
<newWizardShortcut
71+
id="com.google.cloud.tools.eclipse.appengine.newproject.AppEngineFlex">
72+
</newWizardShortcut>
73+
</perspectiveExtension>
74+
</extension>
75+
76+
<extension
77+
point="org.eclipse.ui.menus">
78+
<menuContribution
79+
allPopups="false"
80+
locationURI="menu:com.google.cloud.tools.eclipse.appengine.actions.new">
81+
<command
82+
commandId="org.eclipse.ui.newWizard"
83+
style="push">
84+
<parameter
85+
name="newWizardId"
86+
value="com.google.cloud.tools.eclipse.appengine.newproject.AppEngineFlex">
87+
</parameter>
88+
</command>
89+
</menuContribution>
90+
</extension>
91+
92+
</plugin>

plugins/com.google.cloud.tools.eclipse.appengine.newproject/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ Import-Package: com.google.cloud.tools.eclipse.appengine.facets,
5050
org.eclipse.wst.server.core.internal,
5151
org.osgi.framework;version="1.8.0",
5252
org.osgi.service.prefs;version="1.1.1"
53-
Export-Package: com.google.cloud.tools.eclipse.appengine.newproject;version="0.1.0";x-friends:="com.google.cloud.tools.eclipse.appengine.newproject.maven"
53+
Export-Package: com.google.cloud.tools.eclipse.appengine.newproject;version="0.1.0";x-friends:="com.google.cloud.tools.eclipse.appengine.newproject.maven",
54+
com.google.cloud.tools.eclipse.appengine.newproject.flex

plugins/com.google.cloud.tools.eclipse.appengine.ui/plugin.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ appEngineNameWithSpace=App Engine
1111
googleCloudPlatformName=Google Cloud Platform
1212
createNewProject = Create New Project
1313
launch.gae.run = Run on App Engine
14-
launch.gae.debug = Debug on App Engine
14+
launch.gae.debug = Debug on App Engine
15+
16+
appEngineFlexAbbreviation=Flex

plugins/com.google.cloud.tools.eclipse.appengine.ui/plugin.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
id="com.google.cloud.tools.eclipse.appengine.ui.AppEngineKeyword"/>
1515
<keyword label="%appEngineNameWithSpace"
1616
id="com.google.cloud.tools.eclipse.appengine.ui.AppSpaceEngineKeyword"/>
17+
<keyword label="%appEngineFlexAbbreviation"
18+
id="com.google.cloud.tools.eclipse.appengine.ui.FlexKeyword"/>
1719
</extension>
1820
<extension
1921
point="org.eclipse.ui.menus">
@@ -99,4 +101,4 @@
99101
</menuContribution>
100102
</extension>
101103

102-
</plugin>
104+
</plugin>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2017 Google 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://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.tools.eclipse.util;
18+
19+
import com.google.cloud.tools.eclipse.util.FacetExistsPropertyTester;
20+
import org.junit.Assert;
21+
import org.junit.Test;
22+
23+
/**
24+
* Unit tests for {@link FacetExistsPropertyTester}
25+
*/
26+
public class FacetExistsPropertyTesterTest {
27+
private FacetExistsPropertyTester propertyTester = new FacetExistsPropertyTester();
28+
29+
@Test
30+
public void test_facetExist() {
31+
Assert.assertTrue(propertyTester.test(null /* receiver */, "facetExists", null /* args */,
32+
"com.google.cloud.tools.eclipse.appengine.facets.standard"));
33+
}
34+
35+
@Test
36+
public void test_facetDoesNotExist() {
37+
Assert.assertFalse(propertyTester.test(null /* receiver */, "facetExists", null /* args */,
38+
"fake.facet"));
39+
}
40+
}

plugins/com.google.cloud.tools.eclipse.util/META-INF/MANIFEST.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Import-Package: com.google.common.annotations;version="[20.0.0,21.0.0)",
1818
com.google.common.net;version="[20.0.0,21.0.0)",
1919
freemarker.template;version="[2.3.25,2.4.0)",
2020
org.eclipse.core.commands,
21+
org.eclipse.core.expressions,
2122
org.eclipse.core.resources,
2223
org.eclipse.core.runtime;bundle-symbolic-name="org.eclipse.core.runtime",
2324
org.eclipse.e4.core.contexts,

0 commit comments

Comments
 (0)