Or download an archive for instance for offline installation and pass it via 'Archive' in the 'Help > Install new Software...' Eclipse menu. Note however, that you will miss automatic update notifications this way.
35 |
36 |
37 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/internal/SharedImages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui.internal;
17 |
18 | import java.net.URL;
19 |
20 | import org.eclipse.core.runtime.FileLocator;
21 | import org.eclipse.core.runtime.IPath;
22 | import org.eclipse.core.runtime.Path;
23 | import org.eclipse.jface.resource.ImageDescriptor;
24 | import org.osgi.framework.Bundle;
25 |
26 | import com.adobe.granite.ide.eclipse.ui.Activator;
27 |
28 | /**
29 | * The SharedImages class contains references to images
30 | *
31 | */
32 | public final class SharedImages {
33 |
34 | public static final ImageDescriptor AEM_MEDIUM_LOGO = createImageDescriptor(Activator.getDefault().getBundle(),
35 | Path.fromPortableString("icons/mc_experiencemanager_transp_medium.png"));
36 | public static final ImageDescriptor NT_UNSTRUCTURED = ImageDescriptor.createFromFile(SharedImages.class, "unstructured.png");
37 | public static final ImageDescriptor AEM_ICON = createImageDescriptor(Activator.getDefault().getBundle(),
38 | Path.fromPortableString("icons/mc_experiencemanager_transp.png"));
39 |
40 | public static ImageDescriptor createImageDescriptor(Bundle bundle, IPath path) {
41 | URL url = FileLocator.find(bundle, path, null);
42 | if (url != null) {
43 | return ImageDescriptor.createFromURL(url);
44 | }
45 | return null;
46 | }
47 |
48 | private SharedImages() {
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/wizards/np/PropUtils.java:
--------------------------------------------------------------------------------
1 | package com.adobe.granite.ide.eclipse.ui.wizards.np;
2 |
3 | import java.util.Map;
4 | import java.util.regex.Matcher;
5 | import java.util.regex.Pattern;
6 |
7 | public class PropUtils {
8 |
9 | private static final Pattern pattern = Pattern.compile("\\$\\{(\\w+?)\\}");
10 |
11 | /**
12 | * Update all properties based on default value, replacing placeholders with recursively processed values
13 | *
14 | * @param properties
15 | */
16 | public static void updateProperties(Map properties) {
17 | for (String key : properties.keySet()) {
18 | getUpdateProperty(key, properties, 0);
19 | }
20 | }
21 |
22 | /**
23 | * Update a property, looking up and updating placeholders too, recursively
24 | *
25 | * @param key Property key
26 | * @param properties Properties map
27 | * @param calls Recursion limit to avoid stack overflow
28 | *
29 | * @return Updated value for the property
30 | */
31 | @SuppressWarnings("restriction")
32 | private static String getUpdateProperty(String key, Map properties, int calls) {
33 | // Prevent stack overflows
34 | if (calls > 50) {
35 | return "";
36 | }
37 | RequiredPropertyWrapper property = properties.get(key);
38 | if (property == null) {
39 | return "";
40 | }
41 | // Skip manually modified properties
42 | if (!property.isModified()) {
43 | String defaultValue = property.getDefaultValue();
44 | if (defaultValue != null) {
45 | Matcher matcher = pattern.matcher(defaultValue);
46 | String newValue = defaultValue;
47 | // For each matched placeholder, replace it with respective property, updating it before
48 | while (matcher.find()) {
49 | if (matcher.groupCount() > 0) {
50 | String match = matcher.group(1);
51 | newValue = newValue.replace("${" + match + "}", getUpdateProperty(match, properties, ++calls));
52 | }
53 | }
54 | property.setValue(newValue);
55 | } else {
56 | property.setValue("");
57 | }
58 | }
59 | return property.getValue();
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Thanks for choosing to contribute!
4 |
5 | The following are a set of guidelines to follow when contributing to this project.
6 |
7 | ## Code Of Conduct
8 |
9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating,
10 | you are expected to uphold this code. Please report unacceptable behavior to
11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com).
12 |
13 | ## Have A Question?
14 |
15 | Start by filing an issue. The existing committers on this project work to reach
16 | consensus around project direction and issue solutions within issue threads
17 | (when appropriate).
18 |
19 | ## Contributor License Agreement
20 |
21 | All third-party contributions to this project must be accompanied by a signed contributor
22 | license agreement. This gives Adobe permission to redistribute your contributions
23 | as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You
24 | only need to submit an Adobe CLA one time, so if you have submitted one previously,
25 | you are good to go!
26 |
27 | ## Code Reviews
28 |
29 | All submissions should come in the form of pull requests and need to be reviewed
30 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/)
31 | for more information on sending pull requests.
32 |
33 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when
34 | submitting a pull request!
35 |
36 | ## From Contributor To Committer
37 |
38 | We love contributions from our community! If you'd like to go a step beyond contributor
39 | and become a committer with full write access and a say in the project, you must
40 | be invited to the project. The existing committers employ an internal nomination
41 | process that must reach lazy consensus (silence is approval) before invitations
42 | are issued. If you feel you are qualified and want to get more deeply involved,
43 | feel free to reach out to existing committers to have a conversation about that.
44 |
45 | ## Security Issues
46 |
47 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html).
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/Activator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui;
17 |
18 | import org.apache.sling.ide.eclipse.ui.WhitelabelSupport;
19 | import org.eclipse.ui.plugin.AbstractUIPlugin;
20 | import org.osgi.framework.BundleContext;
21 |
22 | import com.adobe.granite.ide.eclipse.ui.internal.SharedImages;
23 |
24 | /**
25 | * The activator class controls the plug-in life cycle
26 | */
27 | public class Activator extends AbstractUIPlugin {
28 |
29 | // The plug-in ID
30 | public static final String PLUGIN_ID = "com.adobe.granite.ide.eclipse-ui"; //$NON-NLS-1$
31 |
32 | // The shared instance
33 | private static Activator plugin;
34 |
35 | /**
36 | * The constructor
37 | */
38 | public Activator() {
39 | }
40 |
41 | /*
42 | * (non-Javadoc)
43 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
44 | */
45 | public void start(BundleContext context) throws Exception {
46 | super.start(context);
47 | plugin = this;
48 |
49 | WhitelabelSupport.setWizardBanner(SharedImages.AEM_MEDIUM_LOGO);
50 | WhitelabelSupport.setProjectWizardBanner(SharedImages.AEM_MEDIUM_LOGO);
51 | WhitelabelSupport.setJcrNodeIcon(SharedImages.NT_UNSTRUCTURED);
52 | WhitelabelSupport.setProductIcon(SharedImages.AEM_ICON);
53 | WhitelabelSupport.setProductName("AEM");
54 | }
55 |
56 | /*
57 | * (non-Javadoc)
58 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
59 | */
60 | public void stop(BundleContext context) throws Exception {
61 | plugin = null;
62 | super.stop(context);
63 | }
64 |
65 | /**
66 | * Returns the shared instance
67 | *
68 | * @return the shared instance
69 | */
70 | public static Activator getDefault() {
71 | return plugin;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.target-definition/com.adobe.granite.ide.target-definition.target:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Create Release
2 | run-name: Create Release ${{ inputs.release_version }}
3 |
4 | on:
5 | workflow_dispatch:
6 | inputs:
7 | release_version:
8 | description: 'Release version (e.g., 1.3.1)'
9 | required: true
10 | type: string
11 |
12 | jobs:
13 | release:
14 | runs-on: ubuntu-latest
15 | permissions:
16 | contents: write
17 | pages: write
18 | id-token: write
19 |
20 | steps:
21 | - name: Checkout repository
22 | uses: actions/checkout@v5
23 | with:
24 | fetch-depth: 0
25 | token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
26 |
27 | - name: Set up JDK 17
28 | uses: actions/setup-java@v5
29 | with:
30 | java-version: '17'
31 | distribution: 'temurin'
32 | cache: maven
33 | gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
34 | gpg-passphrase: MAVEN_GPG_PASSPHRASE
35 |
36 | - name: Configure Git with user identity
37 | run: |
38 | git config user.name "${{ github.actor }}"
39 | git config user.email "${{ github.actor }}@users.noreply.github.com"
40 |
41 | - name: Run Maven Release
42 | run: |
43 | mvn -B -Prelease clean release:prepare release:perform \
44 | -DreleaseVersion=${{ inputs.release_version }}
45 | env:
46 | MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
47 |
48 | - name: Create GitHub Release
49 | id: create_release
50 | uses: actions/create-release@v1
51 | env:
52 | GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
53 | with:
54 | tag_name: aem-eclipse-developer-tools-${{ inputs.release_version }}
55 | release_name: AEM Developer Tools for Eclipse ${{ inputs.release_version }}
56 | body: ''
57 | draft: true
58 | prerelease: true
59 |
60 | - name: Upload p2 update site to release
61 | uses: actions/upload-release-asset@v1
62 | env:
63 | GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
64 | with:
65 | upload_url: ${{ steps.create_release.outputs.upload_url }}
66 | asset_path: target/checkout/com.adobe.granite.ide.p2update/target/com.adobe.granite.ide.p2update-${{ inputs.release_version }}.zip
67 | asset_name: com.adobe.granite.ide.p2update-${{ inputs.release_version }}.zip
68 | asset_content_type: application/zip
69 |
70 | - name: Copy p2 update site zip to repository root
71 | run: |
72 | cp target/checkout/com.adobe.granite.ide.p2update/target/com.adobe.granite.ide.p2update-${{ inputs.release_version }}.zip \
73 | target/checkout/com.adobe.granite.ide.p2update/target/repository/
74 |
75 | - name: Upload Pages artifact
76 | uses: actions/upload-pages-artifact@v4
77 | with:
78 | path: target/checkout/com.adobe.granite.ide.p2update/target/repository/
79 |
80 | - name: Deploy to GitHub Pages
81 | uses: actions/deploy-pages@v4
82 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 | 4.0.0
12 |
13 |
14 | com.adobe.granite.ide
15 | aem-eclipse-developer-tools
16 | 1.4.1-SNAPSHOT
17 | ../
18 |
19 |
20 | com.adobe.granite.ide
21 | com.adobe.granite.ide.eclipse-ui
22 | eclipse-plugin
23 |
24 | Granite IDE Tools: Extensions
25 |
26 |
27 |
28 |
29 | src/main/java
30 |
31 | **/*.java
32 |
33 |
34 |
35 | src/test/java
36 |
37 |
38 | org.apache.maven.plugins
39 | maven-surefire-plugin
40 | 3.5.4
41 |
42 |
43 | test
44 | test
45 |
46 |
47 | **/*Test.java
48 |
49 |
50 |
51 | test
52 |
53 |
54 |
55 |
56 |
57 | maven-compiler-plugin
58 | 3.14.1
59 |
60 |
61 | compiletests
62 | test-compile
63 |
64 | testCompile
65 |
66 |
67 |
68 |
69 | 17
70 | 17
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | org.junit.jupiter
79 | junit-jupiter-api
80 | 5.14.0
81 | test
82 |
83 |
84 | org.apache.maven.shared
85 | maven-shared-utils
86 | 3.4.2
87 | test
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/test/java/com/adobe/granite/ide/eclipse/ui/wizards/np/PropUtilsTest.java:
--------------------------------------------------------------------------------
1 | package com.adobe.granite.ide.eclipse.ui.wizards.np;
2 |
3 | import static org.junit.jupiter.api.Assertions.assertEquals;
4 |
5 | import java.util.LinkedHashMap;
6 | import java.util.Map;
7 |
8 | import org.apache.maven.archetype.metadata.RequiredProperty;
9 |
10 | import org.apache.maven.shared.utils.StringUtils;
11 | import org.junit.jupiter.api.Test;
12 |
13 | @SuppressWarnings("restriction")
14 | class PropUtilsTest {
15 |
16 | private Map getProperties(String[][] props) {
17 | Map properties = new LinkedHashMap();
18 | for (String[] prop : props) {
19 | RequiredProperty property = new RequiredProperty();
20 | property.setKey(prop[0]);
21 | property.setDefaultValue(prop[2]);
22 | RequiredPropertyWrapper propertyWrapper = new RequiredPropertyWrapper(property);
23 | propertyWrapper.setValue(prop[1]);
24 | propertyWrapper.setModified("true".equalsIgnoreCase(prop[3]));
25 | properties.put(property.getKey(), propertyWrapper);
26 | }
27 | return properties;
28 | }
29 |
30 | @Test
31 | void updateProperties() {
32 | Map properties = getProperties(new String[][] {
33 | new String[] {
34 | "unmodified", "", "DEFAULT_UNMODIFIED", ""
35 | },
36 | new String[] {
37 | "computed", "", "DEFAULT_COMPUTED.${unmodified}", ""
38 | },
39 | new String[] {
40 | "multiple", "", "DEFAULT_MULTIPLE.${computed}-${hasvalue}", ""
41 | },
42 | new String[] {
43 | "hasvalue", "HASVALUE", "DEFAULT_HASVALUE", ""
44 | },
45 | new String[] {
46 | "modified", "MODIFIED", "DEFAULT_MODIFIED.${hasvalue}", "true"
47 | },
48 | new String[] {
49 | "stackoverflow", "", "${stackoverflow}", ""
50 | },
51 | new String[] {
52 | "empty", "", "", ""
53 | },
54 | new String[] {
55 | "useempty", "", "${empty}", ""
56 | },
57 | new String[] {
58 | "null", null, null, null
59 | },
60 | new String[] {
61 | "usenull", "", "${null}", ""
62 | }
63 | });
64 |
65 | printProperties(properties);
66 | PropUtils.updateProperties(properties);
67 | printProperties(properties);
68 |
69 | assertEquals("DEFAULT_MULTIPLE.DEFAULT_COMPUTED.DEFAULT_UNMODIFIED-DEFAULT_HASVALUE", properties.get("multiple").getValue());
70 | assertEquals("MODIFIED", properties.get("modified").getValue());
71 | assertEquals("", properties.get("stackoverflow").getValue());
72 | }
73 |
74 | private void printProperties(Map properties) {
75 | for (String key : properties.keySet()) {
76 | RequiredPropertyWrapper property = properties.get(key);
77 | System.out.println(pad(property.getKey()) + " | " +
78 | pad(property.getValue()) + " | " +
79 | pad(property.getDefaultValue()) + " | " +
80 | pad(property.isModified()));
81 | }
82 | System.out.println("\n");
83 | }
84 |
85 | private String pad(Object obj) {
86 | return StringUtils.rightPad(String.valueOf(obj), 30);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.p2update/siteTemplate/css/style.css:
--------------------------------------------------------------------------------
1 |
2 | /* GENERAL ********************************/
3 |
4 | html {
5 | font: 300 1em/1.4 "adobe-clean", sans-serif;
6 | }
7 | body {
8 | margin: 0 0 8em;
9 | color: #222;
10 | }
11 |
12 | a:focus {
13 | outline: thin dotted;
14 | }
15 | a:active,
16 | a:hover {
17 | outline: 0;
18 | }
19 |
20 | img {
21 | border: 0;
22 | -ms-interpolation-mode: bicubic;
23 | }
24 |
25 | h1,
26 | h2,
27 | h3 {
28 | font-weight: 300;
29 | }
30 | h1 {
31 | font-size: 3em;
32 | margin: 0.67em 0;
33 | }
34 | h2 {
35 | font-size: 2em;
36 | margin: 1em 0;
37 | }
38 | h3 {
39 | font-size: 1.5em;
40 | margin: 1em 0;
41 | }
42 | p {
43 | margin: 1em 0;
44 | }
45 | strong {
46 | font-weight: normal;
47 | }
48 |
49 | /* LAYOUT ********************************/
50 |
51 | .page-wrapper {
52 | max-width: 58em;
53 | margin: 0 auto;
54 | padding: 0 1em;
55 | }
56 |
57 | .clearfix:before,
58 | .clearfix:after {
59 | content: " ";
60 | display: table;
61 | }
62 | .clearfix:after {
63 | clear: both;
64 | }
65 |
66 | /*
67 | * For IE 6/7 only
68 | * Include this rule to trigger hasLayout and contain floats.
69 | */
70 |
71 | .clearfix {
72 | *zoom: 1;
73 | }
74 |
75 | /* TITLE ********************************/
76 |
77 | #title {
78 | margin-bottom: 4em;
79 | color: #eee;
80 | background: #393661;
81 | }
82 | #title .page-wrapper {
83 | position: relative;
84 | padding-bottom: 4em;
85 | }
86 | #title-top,
87 | #title a {
88 | color: #fff;
89 | }
90 | #title-text,
91 | #title-docs {
92 | margin-right: 400px;
93 | }
94 | #title-eclipse {
95 | position: absolute;
96 | right: 1em;
97 | bottom: -136px;
98 | }
99 |
100 | /* COLUMNS ********************************/
101 | .leftcol {
102 | float: left;
103 | width: 45%;
104 | }
105 | .rightcol {
106 | float: right;
107 | width: 45%;
108 | }
109 |
110 |
111 | /* INSTALL ********************************/
112 |
113 | #install section {
114 | width: 40%;
115 | padding-right: 10%;
116 | float: left;
117 | }
118 | #install-link {
119 | margin-top: 2em;
120 | }
121 | #install-link a {
122 | display: inline-block;
123 | border: 1px solid #4d627e;
124 | padding: 0.5em 2em;
125 | color: #fff;
126 | background: #3280c8;
127 | text-decoration: none;
128 | }
129 | #install-text {
130 | min-height: 90px
131 | }
132 |
133 | /* RESPONSIVE ********************************/
134 |
135 | @media only screen and (max-width: 720px) {
136 | body {
137 | margin-bottom: 4em;
138 | }
139 | #title {
140 | margin-bottom: 1em;
141 | }
142 | #title-text,
143 | #title-docs {
144 | margin-right: 0;
145 | }
146 | #title-eclipse {
147 | display: none;
148 | }
149 | }
150 |
151 | @media only screen and (max-width: 500px) {
152 | body {
153 | margin-bottom: 2em;
154 | }
155 | h1 {
156 | font-size: 2em;
157 | margin: 1em 0;
158 | }
159 | #title {
160 | margin-bottom: 0;
161 | }
162 | #title .page-wrapper {
163 | padding-bottom: 2em;
164 | }
165 | .leftcol,
166 | .rightcol {
167 | float: none;
168 | width: auto;
169 | }
170 | #install-text {
171 | min-height: 0;
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Adobe Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | nationality, personal appearance, race, religion, or sexual identity and
10 | orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language.
18 | * Being respectful of differing viewpoints and experiences.
19 | * Gracefully accepting constructive criticism.
20 | * Focusing on what is best for the community.
21 | * Showing empathy towards other community members.
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances.
27 | * Trolling, insulting/derogatory comments, and personal or political attacks.
28 | * Public or private harassment.
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission.
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting.
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at [https://contributor-covenant.org/version/1/4][version].
72 |
73 | [homepage]: https://contributor-covenant.org
74 | [version]: https://contributor-covenant.org/version/1/4/
--------------------------------------------------------------------------------
/com.adobe.granite.ide.p2update/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 |
20 |
21 | com.adobe.granite.ide
22 | aem-eclipse-developer-tools
23 | 1.4.1-SNAPSHOT
24 | ../
25 |
26 |
27 | com.adobe.granite.ide
28 | com.adobe.granite.ide.p2update
29 | eclipse-repository
30 |
31 | AEM Developer Tools for Eclipse: Update Site
32 |
33 |
34 | ${project.name}
35 | 2022-12 or newer
36 | /
37 |
38 |
39 |
40 |
41 |
42 | org.apache.maven.plugins
43 | maven-resources-plugin
44 | 3.3.1
45 |
46 |
47 | copy-site-template
48 | package
49 |
50 | copy-resources
51 |
52 |
53 | ${project.build.directory}/repository
54 |
55 |
56 | siteTemplate
57 | true
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | release
71 |
72 | false
73 |
74 |
75 |
76 |
77 | org.eclipse.tycho
78 | tycho-gpg-plugin
79 | ${tycho.version}
80 |
81 |
82 | sign-p2-artifacts
83 |
84 | sign-p2-artifacts
85 |
86 |
87 |
88 | --pinentry-mode
89 | loopback
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/perspectives/GranitePerspective.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui.perspectives;
17 |
18 | import org.eclipse.ui.IFolderLayout;
19 | import org.eclipse.ui.IPageLayout;
20 | import org.eclipse.ui.IPerspectiveFactory;
21 | import org.eclipse.ui.console.IConsoleConstants;
22 | import org.eclipse.jdt.ui.JavaUI;
23 |
24 |
25 | /**
26 | * This class is meant to serve as an example for how various contributions
27 | * are made to a perspective. Note that some of the extension point id's are
28 | * referred to as API constants while others are hardcoded and may be subject
29 | * to change.
30 | */
31 | public class GranitePerspective implements IPerspectiveFactory {
32 |
33 | private IPageLayout factory;
34 |
35 | public GranitePerspective() {
36 | super();
37 | }
38 |
39 | public void createInitialLayout(IPageLayout factory) {
40 | this.factory = factory;
41 | addViews();
42 | addActionSets();
43 | addNewWizardShortcuts();
44 | addPerspectiveShortcuts();
45 | addViewShortcuts();
46 | }
47 |
48 | private void addViews() {
49 | // Creates the overall layout for the AEM Perspective.
50 | // Note that each new Folder uses a percentage of the remaining EditorArea.
51 |
52 | IFolderLayout veryBottom =
53 | factory.createFolder(
54 | "veryBottom",
55 | IPageLayout.BOTTOM,
56 | 0.82f,
57 | factory.getEditorArea());
58 | // leftBottom.addView("org.eclipse.wst.server.ui.ServersView");
59 | veryBottom.addView(IConsoleConstants.ID_CONSOLE_VIEW);
60 |
61 | IFolderLayout left =
62 | factory.createFolder(
63 | "topLeft", //NON-NLS-1
64 | IPageLayout.LEFT,
65 | 0.3f,
66 | factory.getEditorArea());
67 | left.addView(IPageLayout.ID_PROJECT_EXPLORER);
68 |
69 | IFolderLayout leftMiddle =
70 | factory.createFolder(
71 | "leftMiddle",
72 | IPageLayout.BOTTOM,
73 | 0.75f,
74 | IPageLayout.ID_PROJECT_EXPLORER);
75 | leftMiddle.addView("org.eclipse.wst.server.ui.ServersView");
76 |
77 | IFolderLayout bottomRight =
78 | factory.createFolder(
79 | "bottomRight", //NON-NLS-1
80 | IPageLayout.BOTTOM,
81 | 0.7f,
82 | factory.getEditorArea());
83 | // bottomRight.addView(IPageLayout.ID_PROP_SHEET);
84 | bottomRight.addView("com.adobe.granite.ide.views.ui.views.JcrPropertiesView");
85 | bottomRight.addView(IPageLayout.ID_PROBLEM_VIEW);
86 | bottomRight.addView("org.eclipse.team.ui.GenericHistoryView"); //NON-NLS-1
87 | // bottomRight.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
88 |
89 | IFolderLayout right =
90 | factory.createFolder(
91 | "right",
92 | IPageLayout.RIGHT,
93 | 0.75f,
94 | factory.getEditorArea());
95 | right.addView(IPageLayout.ID_OUTLINE);
96 | }
97 |
98 | private void addActionSets() {
99 | factory.addActionSet("org.eclipse.debug.ui.launchActionSet"); //NON-NLS-1
100 | factory.addActionSet("org.eclipse.debug.ui.debugActionSet"); //NON-NLS-1
101 | factory.addActionSet("org.eclipse.debug.ui.profileActionSet"); //NON-NLS-1
102 | factory.addActionSet("org.eclipse.jdt.debug.ui.JDTDebugActionSet"); //NON-NLS-1
103 | factory.addActionSet("org.eclipse.jdt.junit.JUnitActionSet"); //NON-NLS-1
104 | factory.addActionSet("org.eclipse.team.ui.actionSet"); //NON-NLS-1
105 | factory.addActionSet("org.eclipse.ant.ui.actionSet.presentation"); //NON-NLS-1
106 | factory.addActionSet(JavaUI.ID_ACTION_SET);
107 | factory.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
108 | factory.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); //NON-NLS-1
109 | }
110 |
111 | private void addPerspectiveShortcuts() {
112 | factory.addPerspectiveShortcut("org.eclipse.team.ui.TeamSynchronizingPerspective"); //NON-NLS-1
113 | factory.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //NON-NLS-1
114 | }
115 |
116 | private void addNewWizardShortcuts() {
117 | factory.addNewWizardShortcut("org.apache.sling.ide.eclipse.ui.wizards.NewSlingProjectWizard");//NON-NLS-1
118 | factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//NON-NLS-1
119 | factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//NON-NLS-1
120 | }
121 |
122 | private void addViewShortcuts() {
123 | // Add entries for the Window/Show View menu
124 | factory.addShowViewShortcut("org.eclipse.ant.ui.views.AntView"); //NON-NLS-1
125 | factory.addShowViewShortcut("org.eclipse.pde.ui.DependenciesView"); //NON-NLS-1
126 | factory.addShowViewShortcut("org.eclipse.jdt.junit.ResultView"); //NON-NLS-1
127 | factory.addShowViewShortcut("org.eclipse.team.ui.GenericHistoryView"); //NON-NLS-1
128 | factory.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
129 | factory.addShowViewShortcut(JavaUI.ID_PACKAGES);
130 | factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
131 | factory.addShowViewShortcut(IPageLayout.ID_OUTLINE);
132 | }
133 |
134 | }
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/wizards/np/NewGraniteProjectWizard.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui.wizards.np;
17 |
18 | import java.util.Iterator;
19 | import java.util.List;
20 |
21 | import org.apache.maven.archetype.catalog.Archetype;
22 | import org.apache.maven.model.Model;
23 | import org.apache.maven.model.Parent;
24 | import org.apache.sling.ide.eclipse.core.ISlingLaunchpadConfiguration;
25 | import org.apache.sling.ide.eclipse.core.internal.ProjectHelper;
26 | import org.apache.sling.ide.eclipse.ui.wizards.np.AbstractNewMavenBasedSlingApplicationWizard;
27 | import org.apache.sling.ide.eclipse.ui.wizards.np.ArchetypeParametersWizardPage;
28 | import org.eclipse.core.resources.IFile;
29 | import org.eclipse.core.resources.IProject;
30 | import org.eclipse.core.runtime.CoreException;
31 | import org.eclipse.core.runtime.IPath;
32 | import org.eclipse.core.runtime.IProgressMonitor;
33 | import org.eclipse.core.runtime.NullProgressMonitor;
34 | import org.eclipse.m2e.core.MavenPlugin;
35 | import org.eclipse.wst.server.core.IModule;
36 |
37 | import com.adobe.granite.ide.eclipse.ui.internal.DefaultCQLaunchpadConfiguration;
38 |
39 | public class NewGraniteProjectWizard extends AbstractNewMavenBasedSlingApplicationWizard {
40 |
41 | @Override
42 | public String doGetWindowTitle() {
43 | return "Create new Adobe AEM application";
44 | }
45 |
46 | @Override
47 | protected ArchetypeParametersWizardPage createArchetypeParametersWizardPage() {
48 | return new SimplerParametersWizardPage(this);
49 | }
50 |
51 | @Override
52 | public boolean acceptsArchetype(Archetype archetype2) {
53 | return (archetype2.getGroupId().equals("com.adobe.aem") &&
54 | archetype2.getArtifactId().equals("aem-project-archetype"));
55 | }
56 |
57 | private IProject getParentProject(List projects) {
58 | for (Iterator it = projects.iterator(); it.hasNext();) {
59 | final IProject project = it.next();
60 | final String packaging = ProjectHelper.getMavenProperty(project, "packaging");
61 | final String artifactId = ProjectHelper.getMavenProperty(project, "artifactId");
62 | if (artifactId!=null && artifactId.endsWith("parent") && packaging!=null && packaging.equals("pom")) {
63 | return project;
64 | }
65 | }
66 | return null;
67 | }
68 |
69 | private String calculateRelativePath(IProject from, IProject to) {
70 | IPath fromPath = from.getRawLocation();
71 | IPath toPath = to.getRawLocation();
72 | toPath.setDevice(null);
73 | fromPath.setDevice(null);
74 | int ssc = fromPath.matchingFirstSegments(toPath);
75 | fromPath = fromPath.removeFirstSegments(ssc);
76 | toPath = toPath.removeFirstSegments(ssc);
77 | StringBuffer relPath = new StringBuffer();
78 | for(int i=0; i projects, IProgressMonitor monitor)
125 | throws CoreException{
126 | IProject parentProject = getParentProject(projects);
127 | if (parentProject!=null) {
128 | fixParentProject(aContentProject, parentProject);
129 | }
130 | super.configureContentProject(aContentProject, projects, monitor);
131 | }
132 |
133 | @Override
134 | protected void configureBundleProject(IProject aBundleProject,
135 | List projects, IProgressMonitor monitor)
136 | throws CoreException {
137 | IProject parentProject = getParentProject(projects);
138 | if (parentProject!=null) {
139 | fixParentProject(aBundleProject, parentProject);
140 | }
141 | super.configureBundleProject(aBundleProject, projects, monitor);
142 | }
143 |
144 | @Override
145 | protected ISlingLaunchpadConfiguration getDefaultConfig() {
146 | return DefaultCQLaunchpadConfiguration.INSTANCE;
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 |
20 | com.adobe.granite.ide
21 | aem-eclipse-developer-tools
22 | 1.4.1-SNAPSHOT
23 | pom
24 |
25 | AEM Eclipse Developer Tools
26 | The Eclipse Plug-In that brings you the full connection to the Adobe Experience Manager.
27 | https://github.com/adobe/aem-eclipse-developer-tools
28 |
29 | 2014
30 |
31 |
32 | The Apache Software License, Version 2.0
33 | http://www.apache.org/licenses/LICENSE-2.0.txt
34 |
35 |
36 |
37 | Adobe
38 | http://www.adobe.com/
39 |
40 |
41 |
42 | Adobe Reference Squad
43 | ref-squad@adobe.com
44 |
45 |
46 |
47 | scm:git:https://github.com/adobe/aem-eclipse-developer-tools.git
48 | scm:git:https://github.com/adobe/aem-eclipse-developer-tools.git
49 | https://github.com/adobe/aem-eclipse-developer-tools.git
50 | HEAD
51 |
52 |
53 |
54 | 4.0.13
55 | 2.1.0
56 | UTF-8
57 | /
58 |
59 |
60 |
61 | com.adobe.granite.ide.target-definition
62 | com.adobe.granite.ide.eclipse-ui
63 | com.adobe.granite.ide.feature
64 | com.adobe.granite.ide.p2update
65 |
66 |
67 |
68 |
69 |
70 | org.eclipse.tycho
71 | tycho-maven-plugin
72 | ${tycho.version}
73 | true
74 |
75 |
76 | org.eclipse.tycho
77 | tycho-versions-plugin
78 | ${tycho.version}
79 |
80 |
81 | org.eclipse.tycho
82 | target-platform-configuration
83 | ${tycho.version}
84 |
85 |
86 |
87 | com.adobe.granite.ide
88 | com.adobe.granite.ide.target-definition
89 | ${project.version}
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | release
101 |
102 | false
103 |
104 |
105 |
106 |
107 | org.apache.maven.plugins
108 | maven-gpg-plugin
109 | 3.2.8
110 |
111 |
112 | sign-artifacts
113 | deploy
114 |
115 | sign
116 |
117 |
118 |
119 | --pinentry-mode
120 | loopback
121 |
122 |
123 |
124 |
125 |
126 |
127 | org.apache.maven.plugins
128 | maven-scm-plugin
129 | ${maven.scm.plugin.version}
130 |
131 |
132 | default-cli
133 |
134 | add
135 | checkin
136 |
137 |
138 | **/META-INF/MANIFEST.MF,**/feature.xml,**/*.product,**/category.xml
139 | **/target/**
140 | Changing the version to reflect the pom versions for the release
141 |
142 |
143 |
144 |
145 |
146 | org.apache.maven.plugins
147 | maven-release-plugin
148 | 3.1.1
149 |
150 | true
151 | clean install
152 | org.eclipse.tycho:tycho-versions-plugin:${tycho.version}:update-eclipse-metadata
153 | org.apache.maven.plugins:maven-scm-plugin:${maven.scm.plugin.version}:add org.apache.maven.plugins:maven-scm-plugin:${maven.scm.plugin.version}:checkin
154 |
155 | org.eclipse.tycho:tycho-versions-plugin:${tycho.version}:update-eclipse-metadata
156 | org.apache.maven.plugins:maven-scm-plugin:${maven.scm.plugin.version}:add org.apache.maven.plugins:maven-scm-plugin:${maven.scm.plugin.version}:checkin
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/wizards/np/SimplerParametersWizardPage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui.wizards.np;
17 |
18 | import java.util.HashMap;
19 | import java.util.Map;
20 | import java.util.Properties;
21 |
22 | import org.apache.maven.archetype.catalog.Archetype;
23 | import org.apache.sling.ide.eclipse.ui.wizards.np.AbstractNewMavenBasedSlingApplicationWizard;
24 | import org.apache.sling.ide.eclipse.ui.wizards.np.ArchetypeParametersWizardPage;
25 | import org.apache.sling.ide.eclipse.ui.wizards.np.ChooseArchetypeWizardPage;
26 | import org.eclipse.core.resources.IProject;
27 | import org.eclipse.core.resources.ResourcesPlugin;
28 | import org.eclipse.swt.SWT;
29 | import org.eclipse.swt.events.ModifyEvent;
30 | import org.eclipse.swt.events.ModifyListener;
31 | import org.eclipse.swt.graphics.Color;
32 | import org.eclipse.swt.layout.GridData;
33 | import org.eclipse.swt.layout.GridLayout;
34 | import org.eclipse.swt.widgets.Composite;
35 | import org.eclipse.swt.widgets.Label;
36 | import org.eclipse.swt.widgets.TableItem;
37 | import org.eclipse.swt.widgets.Text;
38 |
39 | public class SimplerParametersWizardPage extends ArchetypeParametersWizardPage {
40 |
41 | private static final String ARTIFACT_DEFAULT = "example";
42 |
43 | private static final String GROUP_DEFAULT = "org.myorg";
44 |
45 | private static final String NAME_DEFAULT = "Example";
46 |
47 | private Text groupId;
48 |
49 | private Text artifactId;
50 |
51 | private AdvancedSettingsComponent advancedSettings;
52 |
53 | private Text name;
54 |
55 | private final ChooseArchetypeWizardPage chooseArchetypePage;
56 |
57 | protected boolean groupIdChanged;
58 |
59 | protected boolean artifactIdChanged;
60 |
61 | protected boolean nameChanged;
62 |
63 | public SimplerParametersWizardPage(
64 | AbstractNewMavenBasedSlingApplicationWizard parent) {
65 | super(parent);
66 | chooseArchetypePage = parent.getChooseArchetypePage();
67 | }
68 |
69 | public Archetype getChosenArchetype() {
70 | return chooseArchetypePage.getSelectedArchetype();
71 | }
72 |
73 | public void createControl(Composite parent) {
74 | final Composite container = new Composite(parent, SWT.NULL);
75 | GridLayout layout = new GridLayout();
76 | container.setLayout(layout);
77 | layout.numColumns = 2;
78 | layout.verticalSpacing = 9;
79 | Label label;
80 | GridData gd;
81 |
82 | label = new Label(container, SWT.NULL);
83 | label.setText("Na&me:");
84 | name = new Text(container, SWT.BORDER | SWT.SINGLE);
85 | gd = new GridData(GridData.FILL_HORIZONTAL);
86 | name.setLayoutData(gd);
87 | name.setToolTipText("Enter a short human readable name of the project");
88 | name.setText(NAME_DEFAULT);
89 | name.setForeground(new Color(parent.getDisplay(), 100, 100, 100));
90 | name.addModifyListener(new ModifyListener() {
91 | public void modifyText(ModifyEvent e) {
92 | if (!nameChanged) {
93 | nameChanged = true;
94 | name.setForeground(container.getForeground());
95 | }
96 | dialogChanged();
97 | advancedSettings.handleModifyText(AdvancedSettingsComponent.APP_TITLE, name.getText(), false);
98 | }
99 | });
100 |
101 | label = new Label(container, SWT.NULL);
102 | label.setText("&Group Id:");
103 | groupId = new Text(container, SWT.BORDER | SWT.SINGLE);
104 | gd = new GridData(GridData.FILL_HORIZONTAL);
105 | groupId.setLayoutData(gd);
106 | groupId.setText(GROUP_DEFAULT);
107 | groupId.setForeground(new Color(parent.getDisplay(), 100, 100, 100));
108 | groupId.addModifyListener(new ModifyListener() {
109 | public void modifyText(ModifyEvent e) {
110 | if (!groupIdChanged) {
111 | groupIdChanged = true;
112 | groupId.setForeground(container.getForeground());
113 | }
114 | dialogChanged();
115 | advancedSettings.handleModifyText(AdvancedSettingsComponent.GROUP_ID, groupId.getText(), false);
116 | }
117 | });
118 | groupId.setToolTipText("Enter a package-like identifier, eg org.myorg");
119 |
120 | label = new Label(container, SWT.NULL);
121 | label.setText("&Artifact Id:");
122 |
123 | artifactId = new Text(container, SWT.BORDER | SWT.SINGLE);
124 | gd = new GridData(GridData.FILL_HORIZONTAL);
125 | artifactId.setLayoutData(gd);
126 | artifactId.setText(ARTIFACT_DEFAULT);
127 | artifactId.setForeground(new Color(parent.getDisplay(), 100, 100, 100));
128 | artifactId.addModifyListener(new ModifyListener() {
129 | public void modifyText(ModifyEvent e) {
130 | if (!artifactIdChanged) {
131 | artifactIdChanged = true;
132 | artifactId.setForeground(container.getForeground());
133 | }
134 | dialogChanged();
135 | advancedSettings.handleModifyText(AdvancedSettingsComponent.ARTIFACT_ID, artifactId.getText(), false);
136 | }
137 | });
138 | artifactId.setToolTipText("Enter an identifier (without '.') of the project");
139 |
140 | Composite advanced = new Composite(container, SWT.NONE);
141 | gd = new GridData(GridData.FILL_BOTH);
142 | gd.horizontalSpan = 2;
143 | advanced.setLayoutData(gd);
144 | GridLayout layout2 = new GridLayout();
145 | advanced.setLayout(layout2);
146 | layout2.numColumns = 2;
147 | layout2.verticalSpacing = 9;
148 |
149 | gd = new GridData(SWT.FILL, SWT.TOP, true, true, 2, 1);
150 | gd.verticalIndent = 7;
151 | advancedSettings = new AdvancedSettingsComponent(advanced, null, true, this);
152 | advancedSettings.setLayoutData(gd);
153 | advancedSettings.initialize();
154 | setPageComplete(false);
155 | setControl(container);
156 | }
157 |
158 | @Override
159 | public void setVisible(boolean visible) {
160 | super.setVisible(visible);
161 | if (visible) {
162 | advancedSettings.initialize();
163 | }
164 | }
165 |
166 | /**
167 | * Ensures that both text fields are set.
168 | */
169 |
170 | void dialogChanged() {
171 | if (!groupIdChanged || groupId.getText().length() == 0) {
172 | updateStatus("group Id must be specified");
173 | return;
174 | }
175 | if (!artifactIdChanged || artifactId.getText().length() == 0) {
176 | updateStatus("artifact Id must be specified");
177 | return;
178 | }
179 | if (advancedSettings.version.getText().length() == 0) {
180 | updateStatus("version must be specified");
181 | return;
182 | }
183 | if (advancedSettings.javaPackage.getText().length() == 0) {
184 | updateStatus("package must be specified");
185 | return;
186 | }
187 |
188 | IProject existingProject = ResourcesPlugin.getWorkspace().getRoot().getProject(artifactId.getText());
189 |
190 | if (existingProject.exists()) {
191 | updateStatus("A project with the name " + artifactId.getText() + " already exists.");
192 | return;
193 | }
194 |
195 | int cnt = advancedSettings.propertiesTable.getItemCount();
196 | for (int i = 0; i < cnt; i++) {
197 | TableItem item = advancedSettings.propertiesTable.getItem(i);
198 | if (item.getText(1).length() == 0) {
199 | updateStatus(item.getText(0) + " must be specified");
200 | return;
201 | }
202 | }
203 |
204 | updateStatus(null);
205 | }
206 |
207 | private void updateStatus(String message) {
208 | setErrorMessage(message);
209 | setPageComplete(message == null);
210 | }
211 |
212 | public String getGroupId() {
213 | if (!groupIdChanged) {
214 | return "";
215 | }
216 | return groupId.getText();
217 | }
218 |
219 | public String getArtifactId() {
220 | if (!artifactIdChanged) {
221 | return "";
222 | }
223 | return artifactId.getText();
224 | }
225 |
226 | public String getParameterName() {
227 | if (!nameChanged) {
228 | return "";
229 | }
230 | return name.getText();
231 | }
232 |
233 | public String getVersion() {
234 | return advancedSettings.version.getText();
235 | }
236 |
237 | public String getJavaPackage() {
238 | return advancedSettings.javaPackage.getText();
239 | }
240 |
241 | public Map getProperties() {
242 | int cnt = advancedSettings.propertiesTable.getItemCount();
243 | Map p = new HashMap<>();
244 | for (int i = 0; i < cnt; i++) {
245 | TableItem item = advancedSettings.propertiesTable.getItem(i);
246 | p.put(item.getText(0), item.getText(1));
247 | }
248 | return p;
249 | }
250 |
251 | public void setGroupId(String text) {
252 | groupId.setText(text);
253 | groupIdChanged = true;
254 | dialogChanged();
255 | }
256 |
257 | public void setArtifactId(String text) {
258 | artifactId.setText(text);
259 | artifactIdChanged = true;
260 | dialogChanged();
261 | }
262 |
263 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 |
3 | Apache License
4 | Version 2.0, January 2004
5 | http://www.apache.org/licenses/
6 |
7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8 |
9 | 1. Definitions.
10 |
11 | "License" shall mean the terms and conditions for use, reproduction,
12 | and distribution as defined by Sections 1 through 9 of this document.
13 |
14 | "Licensor" shall mean the copyright owner or entity authorized by
15 | the copyright owner that is granting the License.
16 |
17 | "Legal Entity" shall mean the union of the acting entity and all
18 | other entities that control, are controlled by, or are under common
19 | control with that entity. For the purposes of this definition,
20 | "control" means (i) the power, direct or indirect, to cause the
21 | direction or management of such entity, whether by contract or
22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
23 | outstanding shares, or (iii) beneficial ownership of such entity.
24 |
25 | "You" (or "Your") shall mean an individual or Legal Entity
26 | exercising permissions granted by this License.
27 |
28 | "Source" form shall mean the preferred form for making modifications,
29 | including but not limited to software source code, documentation
30 | source, and configuration files.
31 |
32 | "Object" form shall mean any form resulting from mechanical
33 | transformation or translation of a Source form, including but
34 | not limited to compiled object code, generated documentation,
35 | and conversions to other media types.
36 |
37 | "Work" shall mean the work of authorship, whether in Source or
38 | Object form, made available under the License, as indicated by a
39 | copyright notice that is included in or attached to the work
40 | (an example is provided in the Appendix below).
41 |
42 | "Derivative Works" shall mean any work, whether in Source or Object
43 | form, that is based on (or derived from) the Work and for which the
44 | editorial revisions, annotations, elaborations, or other modifications
45 | represent, as a whole, an original work of authorship. For the purposes
46 | of this License, Derivative Works shall not include works that remain
47 | separable from, or merely link (or bind by name) to the interfaces of,
48 | the Work and Derivative Works thereof.
49 |
50 | "Contribution" shall mean any work of authorship, including
51 | the original version of the Work and any modifications or additions
52 | to that Work or Derivative Works thereof, that is intentionally
53 | submitted to Licensor for inclusion in the Work by the copyright owner
54 | or by an individual or Legal Entity authorized to submit on behalf of
55 | the copyright owner. For the purposes of this definition, "submitted"
56 | means any form of electronic, verbal, or written communication sent
57 | to the Licensor or its representatives, including but not limited to
58 | communication on electronic mailing lists, source code control systems,
59 | and issue tracking systems that are managed by, or on behalf of, the
60 | Licensor for the purpose of discussing and improving the Work, but
61 | excluding communication that is conspicuously marked or otherwise
62 | designated in writing by the copyright owner as "Not a Contribution."
63 |
64 | "Contributor" shall mean Licensor and any individual or Legal Entity
65 | on behalf of whom a Contribution has been received by Licensor and
66 | subsequently incorporated within the Work.
67 |
68 | 2. Grant of Copyright License. Subject to the terms and conditions of
69 | this License, each Contributor hereby grants to You a perpetual,
70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71 | copyright license to reproduce, prepare Derivative Works of,
72 | publicly display, publicly perform, sublicense, and distribute the
73 | Work and such Derivative Works in Source or Object form.
74 |
75 | 3. Grant of Patent License. Subject to the terms and conditions of
76 | this License, each Contributor hereby grants to You a perpetual,
77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78 | (except as stated in this section) patent license to make, have made,
79 | use, offer to sell, sell, import, and otherwise transfer the Work,
80 | where such license applies only to those patent claims licensable
81 | by such Contributor that are necessarily infringed by their
82 | Contribution(s) alone or by combination of their Contribution(s)
83 | with the Work to which such Contribution(s) was submitted. If You
84 | institute patent litigation against any entity (including a
85 | cross-claim or counterclaim in a lawsuit) alleging that the Work
86 | or a Contribution incorporated within the Work constitutes direct
87 | or contributory patent infringement, then any patent licenses
88 | granted to You under this License for that Work shall terminate
89 | as of the date such litigation is filed.
90 |
91 | 4. Redistribution. You may reproduce and distribute copies of the
92 | Work or Derivative Works thereof in any medium, with or without
93 | modifications, and in Source or Object form, provided that You
94 | meet the following conditions:
95 |
96 | (a) You must give any other recipients of the Work or
97 | Derivative Works a copy of this License; and
98 |
99 | (b) You must cause any modified files to carry prominent notices
100 | stating that You changed the files; and
101 |
102 | (c) You must retain, in the Source form of any Derivative Works
103 | that You distribute, all copyright, patent, trademark, and
104 | attribution notices from the Source form of the Work,
105 | excluding those notices that do not pertain to any part of
106 | the Derivative Works; and
107 |
108 | (d) If the Work includes a "NOTICE" text file as part of its
109 | distribution, then any Derivative Works that You distribute must
110 | include a readable copy of the attribution notices contained
111 | within such NOTICE file, excluding those notices that do not
112 | pertain to any part of the Derivative Works, in at least one
113 | of the following places: within a NOTICE text file distributed
114 | as part of the Derivative Works; within the Source form or
115 | documentation, if provided along with the Derivative Works; or,
116 | within a display generated by the Derivative Works, if and
117 | wherever such third-party notices normally appear. The contents
118 | of the NOTICE file are for informational purposes only and
119 | do not modify the License. You may add Your own attribution
120 | notices within Derivative Works that You distribute, alongside
121 | or as an addendum to the NOTICE text from the Work, provided
122 | that such additional attribution notices cannot be construed
123 | as modifying the License.
124 |
125 | You may add Your own copyright statement to Your modifications and
126 | may provide additional or different license terms and conditions
127 | for use, reproduction, or distribution of Your modifications, or
128 | for any such Derivative Works as a whole, provided Your use,
129 | reproduction, and distribution of the Work otherwise complies with
130 | the conditions stated in this License.
131 |
132 | 5. Submission of Contributions. Unless You explicitly state otherwise,
133 | any Contribution intentionally submitted for inclusion in the Work
134 | by You to the Licensor shall be under the terms and conditions of
135 | this License, without any additional terms or conditions.
136 | Notwithstanding the above, nothing herein shall supersede or modify
137 | the terms of any separate license agreement you may have executed
138 | with Licensor regarding such Contributions.
139 |
140 | 6. Trademarks. This License does not grant permission to use the trade
141 | names, trademarks, service marks, or product names of the Licensor,
142 | except as required for reasonable and customary use in describing the
143 | origin of the Work and reproducing the content of the NOTICE file.
144 |
145 | 7. Disclaimer of Warranty. Unless required by applicable law or
146 | agreed to in writing, Licensor provides the Work (and each
147 | Contributor provides its Contributions) on an "AS IS" BASIS,
148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149 | implied, including, without limitation, any warranties or conditions
150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151 | PARTICULAR PURPOSE. You are solely responsible for determining the
152 | appropriateness of using or redistributing the Work and assume any
153 | risks associated with Your exercise of permissions under this License.
154 |
155 | 8. Limitation of Liability. In no event and under no legal theory,
156 | whether in tort (including negligence), contract, or otherwise,
157 | unless required by applicable law (such as deliberate and grossly
158 | negligent acts) or agreed to in writing, shall any Contributor be
159 | liable to You for damages, including any direct, indirect, special,
160 | incidental, or consequential damages of any character arising as a
161 | result of this License or out of the use or inability to use the
162 | Work (including but not limited to damages for loss of goodwill,
163 | work stoppage, computer failure or malfunction, or any and all
164 | other commercial damages or losses), even if such Contributor
165 | has been advised of the possibility of such damages.
166 |
167 | 9. Accepting Warranty or Additional Liability. While redistributing
168 | the Work or Derivative Works thereof, You may choose to offer,
169 | and charge a fee for, acceptance of support, warranty, indemnity,
170 | or other liability obligations and/or rights consistent with this
171 | License. However, in accepting such obligations, You may act only
172 | on Your own behalf and on Your sole responsibility, not on behalf
173 | of any other Contributor, and only if You agree to indemnify,
174 | defend, and hold each Contributor harmless for any liability
175 | incurred by, or claims asserted against, such Contributor by reason
176 | of your accepting any such warranty or additional liability.
177 |
178 | END OF TERMS AND CONDITIONS
179 |
180 | APPENDIX: How to apply the Apache License to your work.
181 |
182 | To apply the Apache License to your work, attach the following
183 | boilerplate notice, with the fields enclosed by brackets "[]"
184 | replaced with your own identifying information. (Don't include
185 | the brackets!) The text should be enclosed in the appropriate
186 | comment syntax for the file format. We also recommend that a
187 | file or class name and description of purpose be included on the
188 | same "printed page" as the copyright notice for easier
189 | identification within third-party archives.
190 |
191 | Copyright [yyyy] [name of copyright owner]
192 |
193 | Licensed under the Apache License, Version 2.0 (the "License");
194 | you may not use this file except in compliance with the License.
195 | You may obtain a copy of the License at
196 |
197 | http://www.apache.org/licenses/LICENSE-2.0
198 |
199 | Unless required by applicable law or agreed to in writing, software
200 | distributed under the License is distributed on an "AS IS" BASIS,
201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202 | See the License for the specific language governing permissions and
203 | limitations under the License.
--------------------------------------------------------------------------------
/com.adobe.granite.ide.p2update/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 |
3 | Apache License
4 | Version 2.0, January 2004
5 | http://www.apache.org/licenses/
6 |
7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8 |
9 | 1. Definitions.
10 |
11 | "License" shall mean the terms and conditions for use, reproduction,
12 | and distribution as defined by Sections 1 through 9 of this document.
13 |
14 | "Licensor" shall mean the copyright owner or entity authorized by
15 | the copyright owner that is granting the License.
16 |
17 | "Legal Entity" shall mean the union of the acting entity and all
18 | other entities that control, are controlled by, or are under common
19 | control with that entity. For the purposes of this definition,
20 | "control" means (i) the power, direct or indirect, to cause the
21 | direction or management of such entity, whether by contract or
22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
23 | outstanding shares, or (iii) beneficial ownership of such entity.
24 |
25 | "You" (or "Your") shall mean an individual or Legal Entity
26 | exercising permissions granted by this License.
27 |
28 | "Source" form shall mean the preferred form for making modifications,
29 | including but not limited to software source code, documentation
30 | source, and configuration files.
31 |
32 | "Object" form shall mean any form resulting from mechanical
33 | transformation or translation of a Source form, including but
34 | not limited to compiled object code, generated documentation,
35 | and conversions to other media types.
36 |
37 | "Work" shall mean the work of authorship, whether in Source or
38 | Object form, made available under the License, as indicated by a
39 | copyright notice that is included in or attached to the work
40 | (an example is provided in the Appendix below).
41 |
42 | "Derivative Works" shall mean any work, whether in Source or Object
43 | form, that is based on (or derived from) the Work and for which the
44 | editorial revisions, annotations, elaborations, or other modifications
45 | represent, as a whole, an original work of authorship. For the purposes
46 | of this License, Derivative Works shall not include works that remain
47 | separable from, or merely link (or bind by name) to the interfaces of,
48 | the Work and Derivative Works thereof.
49 |
50 | "Contribution" shall mean any work of authorship, including
51 | the original version of the Work and any modifications or additions
52 | to that Work or Derivative Works thereof, that is intentionally
53 | submitted to Licensor for inclusion in the Work by the copyright owner
54 | or by an individual or Legal Entity authorized to submit on behalf of
55 | the copyright owner. For the purposes of this definition, "submitted"
56 | means any form of electronic, verbal, or written communication sent
57 | to the Licensor or its representatives, including but not limited to
58 | communication on electronic mailing lists, source code control systems,
59 | and issue tracking systems that are managed by, or on behalf of, the
60 | Licensor for the purpose of discussing and improving the Work, but
61 | excluding communication that is conspicuously marked or otherwise
62 | designated in writing by the copyright owner as "Not a Contribution."
63 |
64 | "Contributor" shall mean Licensor and any individual or Legal Entity
65 | on behalf of whom a Contribution has been received by Licensor and
66 | subsequently incorporated within the Work.
67 |
68 | 2. Grant of Copyright License. Subject to the terms and conditions of
69 | this License, each Contributor hereby grants to You a perpetual,
70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71 | copyright license to reproduce, prepare Derivative Works of,
72 | publicly display, publicly perform, sublicense, and distribute the
73 | Work and such Derivative Works in Source or Object form.
74 |
75 | 3. Grant of Patent License. Subject to the terms and conditions of
76 | this License, each Contributor hereby grants to You a perpetual,
77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78 | (except as stated in this section) patent license to make, have made,
79 | use, offer to sell, sell, import, and otherwise transfer the Work,
80 | where such license applies only to those patent claims licensable
81 | by such Contributor that are necessarily infringed by their
82 | Contribution(s) alone or by combination of their Contribution(s)
83 | with the Work to which such Contribution(s) was submitted. If You
84 | institute patent litigation against any entity (including a
85 | cross-claim or counterclaim in a lawsuit) alleging that the Work
86 | or a Contribution incorporated within the Work constitutes direct
87 | or contributory patent infringement, then any patent licenses
88 | granted to You under this License for that Work shall terminate
89 | as of the date such litigation is filed.
90 |
91 | 4. Redistribution. You may reproduce and distribute copies of the
92 | Work or Derivative Works thereof in any medium, with or without
93 | modifications, and in Source or Object form, provided that You
94 | meet the following conditions:
95 |
96 | (a) You must give any other recipients of the Work or
97 | Derivative Works a copy of this License; and
98 |
99 | (b) You must cause any modified files to carry prominent notices
100 | stating that You changed the files; and
101 |
102 | (c) You must retain, in the Source form of any Derivative Works
103 | that You distribute, all copyright, patent, trademark, and
104 | attribution notices from the Source form of the Work,
105 | excluding those notices that do not pertain to any part of
106 | the Derivative Works; and
107 |
108 | (d) If the Work includes a "NOTICE" text file as part of its
109 | distribution, then any Derivative Works that You distribute must
110 | include a readable copy of the attribution notices contained
111 | within such NOTICE file, excluding those notices that do not
112 | pertain to any part of the Derivative Works, in at least one
113 | of the following places: within a NOTICE text file distributed
114 | as part of the Derivative Works; within the Source form or
115 | documentation, if provided along with the Derivative Works; or,
116 | within a display generated by the Derivative Works, if and
117 | wherever such third-party notices normally appear. The contents
118 | of the NOTICE file are for informational purposes only and
119 | do not modify the License. You may add Your own attribution
120 | notices within Derivative Works that You distribute, alongside
121 | or as an addendum to the NOTICE text from the Work, provided
122 | that such additional attribution notices cannot be construed
123 | as modifying the License.
124 |
125 | You may add Your own copyright statement to Your modifications and
126 | may provide additional or different license terms and conditions
127 | for use, reproduction, or distribution of Your modifications, or
128 | for any such Derivative Works as a whole, provided Your use,
129 | reproduction, and distribution of the Work otherwise complies with
130 | the conditions stated in this License.
131 |
132 | 5. Submission of Contributions. Unless You explicitly state otherwise,
133 | any Contribution intentionally submitted for inclusion in the Work
134 | by You to the Licensor shall be under the terms and conditions of
135 | this License, without any additional terms or conditions.
136 | Notwithstanding the above, nothing herein shall supersede or modify
137 | the terms of any separate license agreement you may have executed
138 | with Licensor regarding such Contributions.
139 |
140 | 6. Trademarks. This License does not grant permission to use the trade
141 | names, trademarks, service marks, or product names of the Licensor,
142 | except as required for reasonable and customary use in describing the
143 | origin of the Work and reproducing the content of the NOTICE file.
144 |
145 | 7. Disclaimer of Warranty. Unless required by applicable law or
146 | agreed to in writing, Licensor provides the Work (and each
147 | Contributor provides its Contributions) on an "AS IS" BASIS,
148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149 | implied, including, without limitation, any warranties or conditions
150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151 | PARTICULAR PURPOSE. You are solely responsible for determining the
152 | appropriateness of using or redistributing the Work and assume any
153 | risks associated with Your exercise of permissions under this License.
154 |
155 | 8. Limitation of Liability. In no event and under no legal theory,
156 | whether in tort (including negligence), contract, or otherwise,
157 | unless required by applicable law (such as deliberate and grossly
158 | negligent acts) or agreed to in writing, shall any Contributor be
159 | liable to You for damages, including any direct, indirect, special,
160 | incidental, or consequential damages of any character arising as a
161 | result of this License or out of the use or inability to use the
162 | Work (including but not limited to damages for loss of goodwill,
163 | work stoppage, computer failure or malfunction, or any and all
164 | other commercial damages or losses), even if such Contributor
165 | has been advised of the possibility of such damages.
166 |
167 | 9. Accepting Warranty or Additional Liability. While redistributing
168 | the Work or Derivative Works thereof, You may choose to offer,
169 | and charge a fee for, acceptance of support, warranty, indemnity,
170 | or other liability obligations and/or rights consistent with this
171 | License. However, in accepting such obligations, You may act only
172 | on Your own behalf and on Your sole responsibility, not on behalf
173 | of any other Contributor, and only if You agree to indemnify,
174 | defend, and hold each Contributor harmless for any liability
175 | incurred by, or claims asserted against, such Contributor by reason
176 | of your accepting any such warranty or additional liability.
177 |
178 | END OF TERMS AND CONDITIONS
179 |
180 | APPENDIX: How to apply the Apache License to your work.
181 |
182 | To apply the Apache License to your work, attach the following
183 | boilerplate notice, with the fields enclosed by brackets "[]"
184 | replaced with your own identifying information. (Don't include
185 | the brackets!) The text should be enclosed in the appropriate
186 | comment syntax for the file format. We also recommend that a
187 | file or class name and description of purpose be included on the
188 | same "printed page" as the copyright notice for easier
189 | identification within third-party archives.
190 |
191 | Copyright [yyyy] [name of copyright owner]
192 |
193 | Licensed under the Apache License, Version 2.0 (the "License");
194 | you may not use this file except in compliance with the License.
195 | You may obtain a copy of the License at
196 |
197 | http://www.apache.org/licenses/LICENSE-2.0
198 |
199 | Unless required by applicable law or agreed to in writing, software
200 | distributed under the License is distributed on an "AS IS" BASIS,
201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202 | See the License for the specific language governing permissions and
203 | limitations under the License.
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
24 |
25 |
32 |
33 |
34 |
36 |
41 |
42 |
43 |
45 |
47 |
49 |
50 |
51 |
52 |
53 |
54 |
56 |
60 |
61 |
64 |
65 |
67 |
68 |
69 |
72 |
73 |
74 |
77 |
78 |
79 |
82 |
83 |
84 |
87 |
88 |
89 |
92 |
93 |
94 |
97 |
98 |
99 |
102 |
103 |
104 |
105 |
108 |
109 |
110 |
113 |
114 |
115 |
116 |
117 |
119 |
120 |
124 |
125 |
126 |
127 |
128 |
130 |
132 |
136 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
146 |
149 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
165 |
166 |
167 |
169 |
170 |
171 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
210 |
211 |
212 |
213 |
214 |
215 |
221 |
222 |
223 |
224 |
226 |
229 |
230 |
236 |
237 |
238 |
239 |
241 |
244 |
245 |
251 |
252 | Import content from a remote Repository into the local Workspace.
253 |
254 |
255 |
256 |
257 |
258 |
260 |
265 |
266 |
267 |
268 |
269 |
271 |
272 |
273 |
274 |
275 |
278 |
279 |
280 |
281 |
283 |
287 |
288 |
289 |
290 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.feature/feature.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | Apache License
10 | Version 2.0, January 2004
11 | http://www.apache.org/licenses/
12 |
13 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14 |
15 | 1. Definitions.
16 |
17 | "License" shall mean the terms and conditions for use, reproduction,
18 | and distribution as defined by Sections 1 through 9 of this document.
19 |
20 | "Licensor" shall mean the copyright owner or entity authorized by
21 | the copyright owner that is granting the License.
22 |
23 | "Legal Entity" shall mean the union of the acting entity and all
24 | other entities that control, are controlled by, or are under common
25 | control with that entity. For the purposes of this definition,
26 | "control" means (i) the power, direct or indirect, to cause the
27 | direction or management of such entity, whether by contract or
28 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
29 | outstanding shares, or (iii) beneficial ownership of such entity.
30 |
31 | "You" (or "Your") shall mean an individual or Legal Entity
32 | exercising permissions granted by this License.
33 |
34 | "Source" form shall mean the preferred form for making modifications,
35 | including but not limited to software source code, documentation
36 | source, and configuration files.
37 |
38 | "Object" form shall mean any form resulting from mechanical
39 | transformation or translation of a Source form, including but
40 | not limited to compiled object code, generated documentation,
41 | and conversions to other media types.
42 |
43 | "Work" shall mean the work of authorship, whether in Source or
44 | Object form, made available under the License, as indicated by a
45 | copyright notice that is included in or attached to the work
46 | (an example is provided in the Appendix below).
47 |
48 | "Derivative Works" shall mean any work, whether in Source or Object
49 | form, that is based on (or derived from) the Work and for which the
50 | editorial revisions, annotations, elaborations, or other modifications
51 | represent, as a whole, an original work of authorship. For the purposes
52 | of this License, Derivative Works shall not include works that remain
53 | separable from, or merely link (or bind by name) to the interfaces of,
54 | the Work and Derivative Works thereof.
55 |
56 | "Contribution" shall mean any work of authorship, including
57 | the original version of the Work and any modifications or additions
58 | to that Work or Derivative Works thereof, that is intentionally
59 | submitted to Licensor for inclusion in the Work by the copyright owner
60 | or by an individual or Legal Entity authorized to submit on behalf of
61 | the copyright owner. For the purposes of this definition, "submitted"
62 | means any form of electronic, verbal, or written communication sent
63 | to the Licensor or its representatives, including but not limited to
64 | communication on electronic mailing lists, source code control systems,
65 | and issue tracking systems that are managed by, or on behalf of, the
66 | Licensor for the purpose of discussing and improving the Work, but
67 | excluding communication that is conspicuously marked or otherwise
68 | designated in writing by the copyright owner as "Not a Contribution."
69 |
70 | "Contributor" shall mean Licensor and any individual or Legal Entity
71 | on behalf of whom a Contribution has been received by Licensor and
72 | subsequently incorporated within the Work.
73 |
74 | 2. Grant of Copyright License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | copyright license to reproduce, prepare Derivative Works of,
78 | publicly display, publicly perform, sublicense, and distribute the
79 | Work and such Derivative Works in Source or Object form.
80 |
81 | 3. Grant of Patent License. Subject to the terms and conditions of
82 | this License, each Contributor hereby grants to You a perpetual,
83 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84 | (except as stated in this section) patent license to make, have made,
85 | use, offer to sell, sell, import, and otherwise transfer the Work,
86 | where such license applies only to those patent claims licensable
87 | by such Contributor that are necessarily infringed by their
88 | Contribution(s) alone or by combination of their Contribution(s)
89 | with the Work to which such Contribution(s) was submitted. If You
90 | institute patent litigation against any entity (including a
91 | cross-claim or counterclaim in a lawsuit) alleging that the Work
92 | or a Contribution incorporated within the Work constitutes direct
93 | or contributory patent infringement, then any patent licenses
94 | granted to You under this License for that Work shall terminate
95 | as of the date such litigation is filed.
96 |
97 | 4. Redistribution. You may reproduce and distribute copies of the
98 | Work or Derivative Works thereof in any medium, with or without
99 | modifications, and in Source or Object form, provided that You
100 | meet the following conditions:
101 |
102 | (a) You must give any other recipients of the Work or
103 | Derivative Works a copy of this License; and
104 |
105 | (b) You must cause any modified files to carry prominent notices
106 | stating that You changed the files; and
107 |
108 | (c) You must retain, in the Source form of any Derivative Works
109 | that You distribute, all copyright, patent, trademark, and
110 | attribution notices from the Source form of the Work,
111 | excluding those notices that do not pertain to any part of
112 | the Derivative Works; and
113 |
114 | (d) If the Work includes a "NOTICE" text file as part of its
115 | distribution, then any Derivative Works that You distribute must
116 | include a readable copy of the attribution notices contained
117 | within such NOTICE file, excluding those notices that do not
118 | pertain to any part of the Derivative Works, in at least one
119 | of the following places: within a NOTICE text file distributed
120 | as part of the Derivative Works; within the Source form or
121 | documentation, if provided along with the Derivative Works; or,
122 | within a display generated by the Derivative Works, if and
123 | wherever such third-party notices normally appear. The contents
124 | of the NOTICE file are for informational purposes only and
125 | do not modify the License. You may add Your own attribution
126 | notices within Derivative Works that You distribute, alongside
127 | or as an addendum to the NOTICE text from the Work, provided
128 | that such additional attribution notices cannot be construed
129 | as modifying the License.
130 |
131 | You may add Your own copyright statement to Your modifications and
132 | may provide additional or different license terms and conditions
133 | for use, reproduction, or distribution of Your modifications, or
134 | for any such Derivative Works as a whole, provided Your use,
135 | reproduction, and distribution of the Work otherwise complies with
136 | the conditions stated in this License.
137 |
138 | 5. Submission of Contributions. Unless You explicitly state otherwise,
139 | any Contribution intentionally submitted for inclusion in the Work
140 | by You to the Licensor shall be under the terms and conditions of
141 | this License, without any additional terms or conditions.
142 | Notwithstanding the above, nothing herein shall supersede or modify
143 | the terms of any separate license agreement you may have executed
144 | with Licensor regarding such Contributions.
145 |
146 | 6. Trademarks. This License does not grant permission to use the trade
147 | names, trademarks, service marks, or product names of the Licensor,
148 | except as required for reasonable and customary use in describing the
149 | origin of the Work and reproducing the content of the NOTICE file.
150 |
151 | 7. Disclaimer of Warranty. Unless required by applicable law or
152 | agreed to in writing, Licensor provides the Work (and each
153 | Contributor provides its Contributions) on an "AS IS" BASIS,
154 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155 | implied, including, without limitation, any warranties or conditions
156 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157 | PARTICULAR PURPOSE. You are solely responsible for determining the
158 | appropriateness of using or redistributing the Work and assume any
159 | risks associated with Your exercise of permissions under this License.
160 |
161 | 8. Limitation of Liability. In no event and under no legal theory,
162 | whether in tort (including negligence), contract, or otherwise,
163 | unless required by applicable law (such as deliberate and grossly
164 | negligent acts) or agreed to in writing, shall any Contributor be
165 | liable to You for damages, including any direct, indirect, special,
166 | incidental, or consequential damages of any character arising as a
167 | result of this License or out of the use or inability to use the
168 | Work (including but not limited to damages for loss of goodwill,
169 | work stoppage, computer failure or malfunction, or any and all
170 | other commercial damages or losses), even if such Contributor
171 | has been advised of the possibility of such damages.
172 |
173 | 9. Accepting Warranty or Additional Liability. While redistributing
174 | the Work or Derivative Works thereof, You may choose to offer,
175 | and charge a fee for, acceptance of support, warranty, indemnity,
176 | or other liability obligations and/or rights consistent with this
177 | License. However, in accepting such obligations, You may act only
178 | on Your own behalf and on Your sole responsibility, not on behalf
179 | of any other Contributor, and only if You agree to indemnify,
180 | defend, and hold each Contributor harmless for any liability
181 | incurred by, or claims asserted against, such Contributor by reason
182 | of your accepting any such warranty or additional liability.
183 |
184 | END OF TERMS AND CONDITIONS
185 |
186 | APPENDIX: How to apply the Apache License to your work.
187 |
188 | To apply the Apache License to your work, attach the following
189 | boilerplate notice, with the fields enclosed by brackets "[]"
190 | replaced with your own identifying information. (Don't include
191 | the brackets!) The text should be enclosed in the appropriate
192 | comment syntax for the file format. We also recommend that a
193 | file or class name and description of purpose be included on the
194 | same "printed page" as the copyright notice for easier
195 | identification within third-party archives.
196 |
197 | Copyright [yyyy] [name of copyright owner]
198 |
199 | Licensed under the Apache License, Version 2.0 (the "License");
200 | you may not use this file except in compliance with the License.
201 | You may obtain a copy of the License at
202 |
203 | http://www.apache.org/licenses/LICENSE-2.0
204 |
205 | Unless required by applicable law or agreed to in writing, software
206 | distributed under the License is distributed on an "AS IS" BASIS,
207 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208 | See the License for the specific language governing permissions and
209 | limitations under the License.
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/com.adobe.granite.ide.eclipse-ui/src/main/java/com/adobe/granite/ide/eclipse/ui/wizards/np/AdvancedSettingsComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Adobe Systems Incorporated
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 | package com.adobe.granite.ide.eclipse.ui.wizards.np;
17 |
18 | import java.util.LinkedHashMap;
19 | import java.util.List;
20 | import java.util.Map;
21 |
22 | import org.apache.maven.archetype.catalog.Archetype;
23 | import org.apache.maven.archetype.metadata.RequiredProperty;
24 | import org.eclipse.core.runtime.NullProgressMonitor;
25 | import org.eclipse.jface.viewers.CellEditor;
26 | import org.eclipse.jface.viewers.CellNavigationStrategy;
27 | import org.eclipse.jface.viewers.ColumnViewerEditor;
28 | import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
29 | import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
30 | import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
31 | import org.eclipse.jface.viewers.ICellModifier;
32 | import org.eclipse.jface.viewers.TableViewer;
33 | import org.eclipse.jface.viewers.TableViewerEditor;
34 | import org.eclipse.jface.viewers.TableViewerFocusCellManager;
35 | import org.eclipse.jface.viewers.TextCellEditor;
36 | import org.eclipse.m2e.core.project.ProjectImportConfiguration;
37 | import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
38 | import org.eclipse.m2e.core.ui.internal.archetype.ArchetypePlugin;
39 | import org.eclipse.m2e.core.ui.internal.archetype.MavenArchetype;
40 | import org.eclipse.swt.SWT;
41 | import org.eclipse.swt.events.KeyAdapter;
42 | import org.eclipse.swt.events.KeyEvent;
43 | import org.eclipse.swt.events.ModifyEvent;
44 | import org.eclipse.swt.events.ModifyListener;
45 | import org.eclipse.swt.graphics.Point;
46 | import org.eclipse.swt.layout.GridData;
47 | import org.eclipse.swt.layout.GridLayout;
48 | import org.eclipse.swt.widgets.Composite;
49 | import org.eclipse.swt.widgets.Label;
50 | import org.eclipse.swt.widgets.Shell;
51 | import org.eclipse.swt.widgets.Table;
52 | import org.eclipse.swt.widgets.TableColumn;
53 | import org.eclipse.swt.widgets.TableItem;
54 | import org.eclipse.swt.widgets.Text;
55 | import org.eclipse.ui.forms.events.ExpansionAdapter;
56 | import org.eclipse.ui.forms.events.ExpansionEvent;
57 | import org.eclipse.ui.forms.widgets.ExpandableComposite;
58 |
59 | public class AdvancedSettingsComponent extends ExpandableComposite {
60 |
61 | private static final String KEY_PROPERTY = "key";
62 |
63 | private static final String VALUE_PROPERTY = "value";
64 |
65 | private static final String DEFAULT_VALUE_PROPERTY = "defaultValue";
66 |
67 | public static final String GROUP_ID = "groupId";
68 |
69 | public static final String ARTIFACT_ID = "artifactId";
70 |
71 | public static final String APP_ID = "appId";
72 |
73 | public static final String APP_TITLE = "appTitle";
74 |
75 | Text javaPackage;
76 |
77 | private boolean javaPackageModified;
78 |
79 | private TableViewer propertiesViewer;
80 |
81 | Table propertiesTable;
82 |
83 | private Map properties = new LinkedHashMap();
84 |
85 | Text version;
86 |
87 | private final SimplerParametersWizardPage wizardPage;
88 |
89 | /**
90 | * Creates a new component.
91 | *
92 | * @param wizardPage
93 | */
94 | public AdvancedSettingsComponent(final Composite parent,
95 | final ProjectImportConfiguration propectImportConfiguration,
96 | final boolean enableProjectNameTemplate,
97 | SimplerParametersWizardPage wizardPage) {
98 | super(parent, ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE
99 | | ExpandableComposite.EXPANDED);
100 | this.wizardPage = wizardPage;
101 | setText("Advanced");
102 | final Composite advancedComposite = new Composite(this, SWT.NONE);
103 | setClient(advancedComposite);
104 | addExpansionListener(new ExpansionAdapter() {
105 | public void expansionStateChanged(ExpansionEvent e) {
106 | Shell shell = parent.getShell();
107 | Point minSize = shell.getMinimumSize();
108 | shell.setMinimumSize(shell.getSize().x, minSize.y);
109 | shell.pack();
110 | parent.layout();
111 | shell.setMinimumSize(minSize);
112 | }
113 | });
114 | GridLayout gridLayout = new GridLayout();
115 | gridLayout.marginLeft = 11;
116 | gridLayout.numColumns = 2;
117 | advancedComposite.setLayout(gridLayout);
118 | createAdvancedSection(advancedComposite);
119 | }
120 |
121 | public void createAdvancedSection(Composite container) {
122 | Label label;
123 | GridData gd;
124 |
125 | label = new Label(container, SWT.NULL);
126 | label.setText("&Version:");
127 |
128 | version = new Text(container, SWT.BORDER | SWT.SINGLE);
129 | gd = new GridData(GridData.FILL_HORIZONTAL);
130 | version.setLayoutData(gd);
131 | version.setText("0.0.1-SNAPSHOT");
132 | version.addModifyListener(new ModifyListener() {
133 | public void modifyText(ModifyEvent e) {
134 | wizardPage.dialogChanged();
135 | }
136 | });
137 |
138 | label = new Label(container, SWT.NULL);
139 | label.setText("&Package:");
140 |
141 | javaPackage = new Text(container, SWT.BORDER | SWT.SINGLE);
142 | gd = new GridData(GridData.FILL_HORIZONTAL);
143 | javaPackage.setLayoutData(gd);
144 | javaPackageModified = false;
145 | javaPackage.addKeyListener(new KeyAdapter() {
146 | @Override
147 | public void keyPressed(KeyEvent e) {
148 | javaPackageModified = true;
149 | }
150 | });
151 | javaPackage.addModifyListener(new ModifyListener() {
152 | public void modifyText(ModifyEvent e) {
153 | wizardPage.dialogChanged();
154 | }
155 | });
156 |
157 | label = new Label(container, SWT.NULL);
158 | gd = new GridData(SWT.LEFT, SWT.TOP, false, false);
159 | label.setLayoutData(gd);
160 | label.setText("&Parameters:");
161 |
162 | propertiesViewer = new TableViewer(container, SWT.BORDER
163 | | SWT.FULL_SELECTION);
164 | propertiesTable = propertiesViewer.getTable();
165 | propertiesTable.setLinesVisible(true);
166 | propertiesTable.setHeaderVisible(true);
167 | propertiesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
168 | true, 2, 2));
169 |
170 | CellNavigationStrategy strategy = new CellNavigationStrategy();
171 | TableViewerFocusCellManager focusCellMgr = new TableViewerFocusCellManager(
172 | propertiesViewer, new FocusCellOwnerDrawHighlighter(
173 | propertiesViewer), strategy);
174 |
175 | ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(
176 | propertiesViewer) {
177 |
178 | @Override
179 | protected boolean isEditorActivationEvent(
180 | ColumnViewerEditorActivationEvent event) {
181 | return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
182 | || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
183 | || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
184 | || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
185 | }
186 | };
187 | int features = ColumnViewerEditor.TABBING_HORIZONTAL
188 | | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
189 | | ColumnViewerEditor.TABBING_VERTICAL
190 | | ColumnViewerEditor.KEYBOARD_ACTIVATION
191 | | ColumnViewerEditor.KEEP_EDITOR_ON_DOUBLE_CLICK;
192 | TableViewerEditor.create(propertiesViewer, focusCellMgr, actSupport,
193 | features);
194 |
195 | TableColumn propertiesTableNameColumn = new TableColumn(
196 | propertiesTable, SWT.NONE);
197 | propertiesTableNameColumn.setWidth(180);
198 | propertiesTableNameColumn.setText("Name");
199 |
200 | TableColumn propertiesTableValueColumn = new TableColumn(
201 | propertiesTable, SWT.NONE);
202 | propertiesTableValueColumn.setWidth(300);
203 | propertiesTableValueColumn.setText("Value");
204 |
205 | TableColumn propertiesTableDefaultValueColumn = new TableColumn(
206 | propertiesTable, SWT.NONE);
207 | propertiesTableDefaultValueColumn.setWidth(300);
208 | propertiesTableDefaultValueColumn.setText("Default");
209 |
210 | propertiesViewer.setColumnProperties(new String[] {
211 | KEY_PROPERTY,
212 | VALUE_PROPERTY,
213 | DEFAULT_VALUE_PROPERTY});
214 |
215 | propertiesViewer.setCellEditors(new CellEditor[] {
216 | null /* cannot edit the name */,
217 | new TextCellEditor(propertiesTable, SWT.NONE) });
218 | propertiesViewer.setCellModifier(new ICellModifier() {
219 | public boolean canModify(Object element, String property) {
220 | return true;
221 | }
222 |
223 | public void modify(Object element, String property, Object value) {
224 | if (element instanceof TableItem) {
225 | TableItem item = (TableItem) element;
226 | item.setText(
227 | getTextIndex(property),
228 | String.valueOf(value));
229 | handleModifyText(item.getText(0), String.valueOf(value), true);
230 | wizardPage.dialogChanged();
231 | }
232 | }
233 |
234 | public Object getValue(Object element, String property) {
235 | if (element instanceof TableItem) {
236 | return ((TableItem) element)
237 | .getText(getTextIndex(property));
238 | }
239 | return null;
240 | }
241 | });
242 |
243 | }
244 |
245 | protected int getTextIndex(String property) {
246 | if (KEY_PROPERTY.equals(property)) {
247 | return 0;
248 | } else {
249 | return 1;
250 | }
251 | }
252 |
253 | @SuppressWarnings("restriction")
254 | void initialize() {
255 | if (propertiesTable == null) {
256 | return;
257 | }
258 |
259 | Archetype archetype = wizardPage.getChosenArchetype();
260 | if (archetype == null) {
261 | return;
262 | }
263 |
264 | try {
265 | ArchetypePlugin archetypePlugin = M2EUIPluginActivator.getDefault().getArchetypePlugin();
266 | List requiredProps = archetypePlugin.getRequiredProperties(new MavenArchetype(archetype), new NullProgressMonitor());
267 | properties.clear();
268 | for (RequiredProperty prop : requiredProps) {
269 | properties.put(prop.getKey(), new RequiredPropertyWrapper(prop));
270 | }
271 | updateTable();
272 | } catch (Exception e) {
273 | throw new RuntimeException("Could not process archetype: "
274 | + e.getMessage(), e);
275 | }
276 |
277 | }
278 |
279 | @SuppressWarnings("restriction")
280 | public void handleModifyText(String propertyKey, String newValue, boolean updateMainControls) {
281 | RequiredPropertyWrapper property = properties.get(propertyKey);
282 | if (property != null) {
283 | property.setValue(newValue);
284 | property.setModified(true);
285 |
286 | PropUtils.updateProperties(properties);
287 |
288 | if (updateMainControls) {
289 | RequiredPropertyWrapper groupId = properties.get(GROUP_ID);
290 | if (groupId != null && groupId.getValue() != null) {
291 | wizardPage.setGroupId(groupId.getValue());
292 | if (!javaPackageModified) {
293 | javaPackage.setText(SimplerParametersWizardPage.getDefaultJavaPackage(groupId.getValue(), ""));
294 | }
295 | }
296 | RequiredPropertyWrapper artifactId = properties.get(ARTIFACT_ID);
297 | if (artifactId != null && artifactId.getValue() != null) {
298 | wizardPage.setArtifactId(artifactId.getValue());
299 | }
300 | }
301 | }
302 | updateTable();
303 | }
304 |
305 | public void updateTable() {
306 | Table table = propertiesViewer.getTable();
307 | table.setItemCount(properties.size());
308 | int i = 0;
309 | for (String key : properties.keySet()) {
310 | RequiredPropertyWrapper property = properties.get(key);
311 | TableItem item = table.getItem(i++);
312 | item.setText(0, property.getKey());
313 | item.setText(1, property.getValue() != null ? property.getValue() : "");
314 | item.setText(2, property.getDefaultValue() != null ? property.getDefaultValue() : "");
315 | item.setData(item);
316 | }
317 |
318 | }
319 | }
--------------------------------------------------------------------------------