├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── images ├── HTMLAngularDemo.gif └── NewAngularProjectWizard.png ├── license.txt ├── pom.xml ├── pushToBintray.sh ├── ts.eclipse.ide.angular.cli ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── icons │ └── full │ │ ├── obj16 │ │ ├── angular.png │ │ ├── class.gif │ │ ├── component.png │ │ ├── directive.png │ │ ├── ember.png │ │ ├── enum.gif │ │ ├── guard.png │ │ ├── interface.png │ │ ├── module.png │ │ ├── ng-build.gif │ │ ├── ng-e2e.png │ │ ├── ng-serve.gif │ │ ├── ng-test.png │ │ ├── pipe.png │ │ └── service.png │ │ └── wizban │ │ └── angular_wizban.png ├── jsonschema │ ├── angular-cli.json │ └── ember-cli.json ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── ts │ └── eclipse │ └── ide │ └── angular │ ├── cli │ ├── AngularCLIPlugin.java │ ├── NgBlueprint.java │ ├── NgCommand.java │ ├── launch │ │ └── AngularCLILaunchConstants.java │ ├── preferences │ │ └── AngularCLIPreferenceConstants.java │ └── utils │ │ ├── CLIProcessHelper.java │ │ ├── CLIStatus.java │ │ └── NgVersionJob.java │ └── internal │ └── cli │ ├── AngularCLIImageResource.java │ ├── AngularCLIMessages.java │ ├── AngularCLIMessages.properties │ ├── AngularCLIProject.java │ ├── AngularCLIProjectSettings.java │ ├── AngularCLIPropertyTester.java │ ├── Trace.java │ ├── editor │ ├── AngularCLIEditor.java │ ├── NgBuildAction.java │ ├── NgE2eAction.java │ ├── NgServeAction.java │ ├── NgTestAction.java │ └── OverviewPage.java │ ├── jobs │ ├── NgGenerateJob.java │ ├── NgProjectJob.java │ └── NgServeJob.java │ ├── json │ ├── AngularCLIJson.java │ ├── App.java │ ├── Defaults.java │ ├── GenerateDefaults.java │ ├── Inline.java │ └── Spec.java │ ├── launch │ ├── AngularCLILaunchConfigurationDelegate.java │ ├── AngularCLILaunchHelper.java │ ├── shortcut │ │ ├── AngularCLILaunchShortcut.java │ │ ├── NgBuildLaunchShortcut.java │ │ ├── NgE2eLaunchShortcut.java │ │ ├── NgServeLaunchShortcut.java │ │ └── NgTestLaunchShortcut.java │ └── ui │ │ ├── AngularCLILaunchTabGroup.java │ │ └── MainTab.java │ ├── preferences │ ├── AngularCLIConfigurationBlock.java │ ├── AngularCLIPreferenceInitializer.java │ └── AngularCLIPreferencePage.java │ ├── terminal │ ├── NgBuildCommandInterpreter.java │ ├── NgCommandInterpreterFactory.java │ ├── NgGenerateCommandInterpreter.java │ ├── NgProjectCommandInterpreter.java │ └── NgServeCommandInterpreter.java │ └── wizards │ ├── AbstractNewNgGenerateWizard.java │ ├── NewAngularProjectParamsWizardPage.java │ ├── NewAngularProjectWizard.java │ ├── NewNgClassWizard.java │ ├── NewNgClassWizardPage.java │ ├── NewNgComponentWizard.java │ ├── NewNgComponentWizardPage.java │ ├── NewNgDirectiveWizard.java │ ├── NewNgDirectiveWizardPage.java │ ├── NewNgEnumWizard.java │ ├── NewNgEnumWizardPage.java │ ├── NewNgGuardWizard.java │ ├── NewNgGuardWizardPage.java │ ├── NewNgInterfaceWizard.java │ ├── NewNgInterfaceWizardPage.java │ ├── NewNgModuleWizard.java │ ├── NewNgModuleWizardPage.java │ ├── NewNgPipeWizard.java │ ├── NewNgPipeWizardPage.java │ ├── NewNgServiceWizard.java │ ├── NewNgServiceWizardPage.java │ ├── NgGenerateBlueprintWizardPage.java │ └── WizardNewNgProjectCreationPage.java ├── ts.eclipse.ide.angular.core.tests ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── pom.xml └── src │ └── ts │ └── eclipse │ └── ide │ └── angular │ └── core │ └── hml │ ├── DomElementSchemaRegistryTest.java │ ├── HTMLAngularCompletionTest.java │ └── HTMLAngularValidatorTest.java ├── ts.eclipse.ide.angular.core ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── ts │ └── eclipse │ └── ide │ └── angular │ ├── core │ ├── AngularCorePlugin.java │ ├── AngularProject.java │ ├── AngularProjectSettings.java │ ├── html │ │ ├── AbstractNgBindingCollector.java │ │ ├── INgBindingCollector.java │ │ ├── INgBindingManager.java │ │ ├── INgBindingType.java │ │ └── NgBindingTypeException.java │ ├── template │ │ ├── AngularContext.java │ │ └── AngularContextType.java │ └── utils │ │ ├── AngularDOMUtils.java │ │ └── DOMUtils.java │ └── internal │ └── core │ ├── AngularCoreMessages.java │ ├── AngularCoreMessages.properties │ ├── AngularNatureTester.java │ ├── Trace.java │ ├── html │ ├── AbstractNgBindingType.java │ ├── BaseEventBinding.java │ ├── BasePropertyAndEventBinding.java │ ├── BasePropertyBinding.java │ ├── EventBinding.java │ ├── EventBindingCanonicalSyntax.java │ ├── HTMLAngularTemplateParticipant.java │ ├── HashBindingCanonicalSyntax.java │ ├── LetBindingCanonicalSyntax.java │ ├── NgBindingManager.java │ ├── PropertyAndEventBinding.java │ ├── PropertyAndEventBindingCanonicalSyntax.java │ ├── PropertyBinding.java │ ├── PropertyBindingCanonicalSyntax.java │ ├── RefBindingCanonicalSyntax.java │ ├── TemplateDirective.java │ ├── VarBindingCanonicalSyntax.java │ ├── directives │ │ ├── Directive.java │ │ ├── INgDirectiveRegistry.java │ │ ├── NgDirectiveRegistry.java │ │ ├── core_directives.json │ │ └── form_directives.json │ └── schema │ │ ├── DomElementSchemaRegistry.java │ │ └── IElementSchemaRegistry.java │ └── validation │ ├── AbstractHTMLAngularValidator.java │ ├── HTMLAngularAttributeValidator.java │ └── HTMLAngularTagValidator.java ├── ts.eclipse.ide.angular.ui ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── css │ └── dark │ │ └── preferencestyle.css ├── icons │ └── full │ │ └── obj16 │ │ └── angular.png ├── plugin.properties ├── plugin.xml ├── pom.xml ├── snippets │ └── Angular2Snippet.ts ├── src │ └── ts │ │ └── eclipse │ │ └── ide │ │ └── angular │ │ ├── internal │ │ └── ui │ │ │ ├── AngularImageResource.java │ │ │ ├── AngularUIMessages.java │ │ │ ├── AngularUIMessages.properties │ │ │ ├── AngularUIStartup.java │ │ │ ├── Trace.java │ │ │ ├── autoedit │ │ │ └── StructuredAutoEditStrategyAngular.java │ │ │ ├── contentassist │ │ │ ├── HTMLAngularCompletionCollector.java │ │ │ ├── HTMLAngularCompletionProposal.java │ │ │ ├── HTMLAngularTagsCompletionProposalComputer.java │ │ │ └── TypeScriptAngularTemplateCompletionProposalComputer.java │ │ │ ├── perspectives │ │ │ └── AngularPerspectiveFactory.java │ │ │ ├── preferences │ │ │ ├── AngularGlobalPreferencesPage.java │ │ │ ├── AngularMainPropertyPage.java │ │ │ ├── AngularUIPreferenceInitializer.java │ │ │ ├── AngularUIPreferenceNames.java │ │ │ ├── PreferenceConstants.java │ │ │ └── html │ │ │ │ ├── HTMLAngularEditorPreferencesPage.java │ │ │ │ ├── HTMLAngularEditorSyntaxColoringPreferencePage.java │ │ │ │ ├── HTMLAngularGlobalPreferencesPage.java │ │ │ │ └── HTMLAngularTypingPreferencePage.java │ │ │ ├── style │ │ │ ├── IStyleConstantsForAngular.java │ │ │ └── SemanticHighlightingManager.java │ │ │ └── taginfo │ │ │ └── HTMLAngularTagInfoHoverProcessor.java │ │ └── ui │ │ ├── AngularUIPlugin.java │ │ └── style │ │ ├── AbstractAngularExpressionSemanticHighlighting.java │ │ ├── AbstractAngularSemanticHighlighting.java │ │ ├── AngularExpressionBorderSemanticHighlighting.java │ │ ├── AngularExpressionSemanticHighlighting.java │ │ └── DirectiveSemanticHighlighting.java ├── syntaxes │ ├── source.ng.css.json │ ├── styles.ng.json │ └── template.ng.json └── templates │ ├── htmlangular2-templates.properties │ ├── htmlangular2-templates.xml │ ├── typescriptangular2-templates.properties │ └── typescriptangular2-templates.xml └── update-site ├── .classpath ├── .project ├── .settings ├── org.eclipse.core.resources.prefs └── org.eclipse.m2e.core.prefs ├── angular-feature ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── build.properties ├── epl-v10.html ├── feature.properties ├── feature.xml ├── license.html ├── pom.xml └── sourceTemplateFeature │ └── .gitkeep ├── angular.ide ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── category.xml └── pom.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.settings 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | notifications: 7 | email: false 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular Eclipse 2 | 3 | [![Build Status](https://secure.travis-ci.org/angelozerr/angular-eclipse.png)](http://travis-ci.org/angelozerr/angular-eclipse) 4 | [![Eclipse install](https://marketplace.eclipse.org/sites/all/themes/solstice/public/images/marketplace/btn-install.png)](http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=3037144) 5 | 6 | [Angular Eclipse](https://github.com/angelozerr/angular-eclipse) which is based on [TypeScript IDE](https://github.com/angelozerr/typescript.java) is a set of plugins which currently supports versions 2 to 7 of [Angular](https://angular.io/) : 7 | 8 | * `Completion, validation, hover, hyperlink` for `Angular template` defined in the `HTML` or `TypeScript` file by integrating [@angular/language-service](https://github.com/angular/angular/tree/master/packages/language-service): 9 | 10 | ![HTML Angular](images/HTMLAngularDemo.gif) 11 | 12 | * `Angular Wizards/Launches` to create an Angular project, create components, build an application, start a server, etc. by integrating [@angular/cli](https://github.com/angular/angular-cli): 13 | 14 | ![New Angular Project Wizard](images/NewAngularProjectWizard.png) 15 | 16 | Please start with [Getting Started](https://github.com/angelozerr/angular-eclipse/wiki/Getting-Started). 17 | -------------------------------------------------------------------------------- /images/HTMLAngularDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/images/HTMLAngularDemo.gif -------------------------------------------------------------------------------- /images/NewAngularProjectWizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/images/NewAngularProjectWizard.png -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2016 Angelo ZERR. 2 | All rights reserved. This program and the accompanying materials 3 | are made available under the terms of the Eclipse Public License v1.0 4 | which accompanies this distribution, and is available at 5 | http://www.eclipse.org/legal/epl-v10.html 6 | 7 | Contributors: 8 | Angelo Zerr - initial API and implementation 9 | -------------------------------------------------------------------------------- /pushToBintray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Sample Usage: pushToBintray.sh username apikey owner repo package version pathToP2Repo 3 | API=https://api.bintray.com 4 | BINTRAY_USER=$1 5 | BINTRAY_API_KEY=$2 6 | BINTRAY_OWNER=$3 7 | BINTRAY_REPO=$4 8 | PCK_NAME=$5 9 | PCK_VERSION=$6 10 | PATH_TO_REPOSITORY=$7 11 | 12 | function main() { 13 | deploy_updatesite 14 | } 15 | 16 | function deploy_updatesite() { 17 | echo "${BINTRAY_USER}" 18 | echo "${BINTRAY_API_KEY}" 19 | echo "${BINTRAY_OWNER}" 20 | echo "${BINTRAY_REPO}" 21 | echo "${PCK_NAME}" 22 | echo "${PCK_VERSION}" 23 | echo "${PATH_TO_REPOSITORY}" 24 | 25 | if [ ! -z "$PATH_TO_REPOSITORY" ]; then 26 | cd $PATH_TO_REPOSITORY 27 | fi 28 | 29 | 30 | FILES=./* 31 | BINARYDIR=./binary/* 32 | PLUGINDIR=./plugins/* 33 | FEATUREDIR=./features/* 34 | 35 | for f in $FILES; 36 | do 37 | if [ ! -d $f ]; then 38 | echo "Processing $f file..." 39 | if [[ "$f" == *content.jar ]] || [[ "$f" == *artifacts.jar ]] 40 | then 41 | echo "Uploading p2 metadata file directly to the repository" 42 | curl -X PUT -T $f -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/content/${BINTRAY_OWNER}/${BINTRAY_REPO}/$f;publish=0 43 | else 44 | curl -X PUT -T $f -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/content/${BINTRAY_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${PCK_VERSION}/$f;publish=0 45 | fi 46 | echo "" 47 | fi 48 | done 49 | 50 | echo "Processing features dir $FEATUREDIR file..." 51 | for f in $FEATUREDIR; 52 | do 53 | echo "Processing feature: $f file..." 54 | curl -X PUT -T $f -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/content/${BINTRAY_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${PCK_VERSION}/$f;publish=0 55 | echo "" 56 | done 57 | 58 | echo "Processing plugin dir $PLUGINDIR file..." 59 | 60 | for f in $PLUGINDIR; 61 | do 62 | # take action on each file. $f store current file name 63 | echo "Processing plugin: $f file..." 64 | curl -X PUT -T $f -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/content/${BINTRAY_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${PCK_VERSION}/$f;publish=0 65 | echo "" 66 | done 67 | 68 | echo "Processing binary dir $BINARYDIR file..." 69 | 70 | echo "Publishing the new version" 71 | curl -X POST -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/content/${BINTRAY_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${PCK_VERSION}/publish -d "{ \"discard\": \"false\" }" 72 | 73 | } 74 | 75 | 76 | main "$@" -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ts.eclipse.ide.angular.cli 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.pde.PluginNature 32 | org.eclipse.jdt.core.javanature 33 | 34 | 35 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.8 9 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %providerName 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: ts.eclipse.ide.angular.cli;singleton:=true 7 | Bundle-Version: 1.4.0.qualifier 8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 9 | Require-Bundle: org.eclipse.core.runtime, 10 | org.eclipse.core.resources, 11 | org.eclipse.ui.ide, 12 | org.eclipse.ui, 13 | org.eclipse.debug.core, 14 | org.eclipse.debug.ui, 15 | ts.eclipse.ide.core, 16 | ts.eclipse.ide.ui, 17 | org.eclipse.ui.forms, 18 | ts.core, 19 | ts.eclipse.ide.angular.core, 20 | org.eclipse.core.externaltools, 21 | ts.eclipse.ide.terminal.interpreter, 22 | org.eclipse.wst.sse.ui, 23 | org.eclipse.core.expressions, 24 | ts.eclipse.ide.json.ui, 25 | ts.eclipse.ide.json.core, 26 | org.eclipse.json, 27 | org.eclipse.core.variables, 28 | com.google.gson, 29 | org.eclipse.tm.terminal.view.core, 30 | org.eclipse.jface.text 31 | Bundle-ActivationPolicy: lazy 32 | Bundle-Activator: ts.eclipse.ide.angular.cli.AngularCLIPlugin 33 | Export-Package: ts.eclipse.ide.angular.cli, 34 | ts.eclipse.ide.angular.cli.launch, 35 | ts.eclipse.ide.angular.cli.preferences 36 | 37 | 38 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/build.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2013 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | source.. = src/ 12 | output.. = bin/ 13 | bin.includes = META-INF/,\ 14 | .,\ 15 | plugin.properties,\ 16 | plugin.xml,\ 17 | icons/,\ 18 | jsonschema/ 19 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/angular.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/class.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/class.gif -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/component.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/directive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/directive.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/ember.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/ember.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/enum.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/enum.gif -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/guard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/guard.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/interface.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/module.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/ng-build.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/ng-build.gif -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/ng-e2e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/ng-e2e.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/ng-serve.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/ng-serve.gif -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/ng-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/ng-test.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/pipe.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/obj16/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/obj16/service.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/icons/full/wizban/angular_wizban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angular-eclipse/b8ca7be5016c31052dfdcd3c2f95584bf0783aa6/ts.eclipse.ide.angular.cli/icons/full/wizban/angular_wizban.png -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/jsonschema/ember-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Ember CLI Config Schema", 4 | "type": "object", 5 | "properties": { 6 | "port": { 7 | "description": "Server port (4200 by default)", 8 | "type": "number", 9 | "default": 4200 10 | }, 11 | "host": { 12 | "description": "Listens on all interfaces by default", 13 | "type": "string" 14 | }, 15 | "proxy": { 16 | "description": "Server proxy", 17 | "type": "string" 18 | }, 19 | "insecure-proxy": { 20 | "description": "Set false to proxy self-signed SSL certificates", 21 | "type": "boolean", 22 | "default": false 23 | }, 24 | "watcher": { 25 | "description": "Watcher", 26 | "type": "string", 27 | "default": "events" 28 | }, 29 | "live-reload": { 30 | "description": "Enable live reload", 31 | "type": "boolean", 32 | "default": true 33 | }, 34 | "live-reload-host": { 35 | "description": "Defaults to host", 36 | "type": "string" 37 | }, 38 | "live-reload-port": { 39 | "description": "Defaults to port number within [49152...65535])", 40 | "type": "number", 41 | "default": 49152 42 | }, 43 | "environment": { 44 | "description": "Environement", 45 | "enum": [ 46 | "development", 47 | "production" 48 | ], 49 | "default": "development" 50 | }, 51 | "output-path": { 52 | "description": "Output path", 53 | "type": "string", 54 | "default": "dist/" 55 | }, 56 | "ssl": { 57 | "description": "Enable SSL", 58 | "type": "boolean", 59 | "default": false 60 | }, 61 | "ssl-key": { 62 | "description": "SSL key", 63 | "type": "string", 64 | "default": "ssl/server.key" 65 | }, 66 | "ssl-cert": { 67 | "description": "SSL certificate", 68 | "type": "string", 69 | "default": "ssl/server.crt" 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/plugin.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2015-2016 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | pluginName=Angular - CLI 12 | providerName=Angelo ZERR 13 | 14 | # Wizards 15 | NewAngularProjectWizard.name=Angular Project 16 | NewAngularProjectWizard.desc=Create an Angular project by using angular-cli. 17 | NewNgModuleWizard.name=Module 18 | NewNgModuleWizard.desc=Create Angular Module by using angular-cli. 19 | NewNgComponentWizard.name=Component 20 | NewNgComponentWizard.desc=Create Angular Component by using angular-cli. 21 | NewNgDirectiveWizard.name=Directive 22 | NewNgDirectiveWizard.desc=Create Angular Directive by using angular-cli. 23 | NewNgPipeWizard.name=Pipe 24 | NewNgPipeWizard.desc=Create Angular Pipe by using angular-cli. 25 | NewNgServiceWizard.name=Service 26 | NewNgServiceWizard.desc=Create Angular Service by using angular-cli. 27 | NewNgGuardWizard.name=Guard 28 | NewNgGuardWizard.desc=Create Angular Guard by using angular-cli. 29 | NewNgClassWizard.name=Class 30 | NewNgClassWizard.desc=Create Angular Class by using angular-cli. 31 | NewNgInterfaceWizard.name=Interface 32 | NewNgInterfaceWizard.desc=Create Angular Interface by using angular-cli. 33 | NewNgEnumWizard.name=Enum 34 | NewNgEnumWizard.desc=Create Angular Enum by using angular-cli. 35 | 36 | # Launch 37 | AngularCLILaunchConfigurationDelegate.label=AngularCLI 38 | 39 | # Preferences 40 | AngularCLIPreferencePage.name=CLI 41 | 42 | # Terminal Interpreter 43 | interpreter.ng.name=ng 44 | 45 | # JSON Schema 46 | angular_cli_Content_Type_Extension_Element=Angular CLI 47 | angular_cli_Editor.name=ng Editor 48 | ember_cli_Content_Type_Extension_Element=Ember CLI 49 | ember_cli_Editor.name=Ember Editor 50 | 51 | # Launch Shortcut 52 | NgServeLaunchShortcut.label=ng serve 53 | NgServeLaunchShortcut.description=Start server (ng serve) 54 | NgBuildLaunchShortcut.label=ng build 55 | NgBuildLaunchShortcut.description=Creating a build (ng build) 56 | NgTestLaunchShortcut.label=ng test 57 | NgTestLaunchShortcut.description=Running unit tests (ng test) 58 | NgE2eLaunchShortcut.label=ng e2e 59 | NgE2eLaunchShortcut.description=Running end-to-end tests (ng e2e) -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | ts.eclipse.ide.angular.cli 4 | eclipse-plugin 5 | 6 | fr.opensagres.angular 7 | angular-eclipse 8 | 1.4.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/AngularCLIPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.cli; 12 | 13 | import org.eclipse.core.runtime.IStatus; 14 | import org.eclipse.core.runtime.Status; 15 | import org.eclipse.ui.plugin.AbstractUIPlugin; 16 | import org.osgi.framework.BundleContext; 17 | 18 | /** 19 | * The activator class controls the plug-in life cycle 20 | */ 21 | public class AngularCLIPlugin extends AbstractUIPlugin { 22 | 23 | // The plug-in ID 24 | public static final String PLUGIN_ID = "ts.eclipse.ide.angular.cli"; //$NON-NLS-1$ 25 | 26 | // The shared instance 27 | private static AngularCLIPlugin plugin; 28 | 29 | /** 30 | * The constructor 31 | */ 32 | public AngularCLIPlugin() { 33 | } 34 | 35 | @Override 36 | public void start(BundleContext context) throws Exception { 37 | super.start(context); 38 | plugin = this; 39 | } 40 | 41 | @Override 42 | public void stop(BundleContext context) throws Exception { 43 | plugin = null; 44 | super.stop(context); 45 | } 46 | 47 | /** 48 | * Returns the shared instance 49 | * 50 | * @return the shared instance 51 | */ 52 | public static AngularCLIPlugin getDefault() { 53 | return plugin; 54 | } 55 | 56 | public static void logError(Throwable e) { 57 | getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e)); 58 | } 59 | 60 | public static void logError(Throwable e, String message) { 61 | getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e)); 62 | } 63 | 64 | public static void logInfo(String info) { 65 | getDefault().getLog().log(new Status(IStatus.INFO, PLUGIN_ID, info)); 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/NgBlueprint.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.cli; 2 | 3 | public enum NgBlueprint { 4 | 5 | MODULE, COMPONENT, DIRECTIVE, PIPE, SERVICE, GUARD, CLASS, INTERFACE, ENUM; 6 | 7 | private final String blueprint; 8 | 9 | private NgBlueprint() { 10 | this.blueprint = name().toLowerCase(); 11 | } 12 | 13 | public String getBlueprint() { 14 | return blueprint; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/NgCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.cli; 12 | 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | /** 17 | * Available default ng commands. 18 | * 19 | */ 20 | public enum NgCommand { 21 | 22 | NEW("new"), INIT("init"), GENERATE("generate", "g"), SERVE("serve", "server", 23 | "s"), BUILD("build"), TEST("test"), E2E("e2e"); 24 | 25 | private static final Map commandMaps; 26 | 27 | static { 28 | commandMaps = new HashMap(); 29 | NgCommand[] commands = NgCommand.values(); 30 | for (NgCommand command : commands) { 31 | for (String alias : command.getAliases()) { 32 | commandMaps.put(alias, command); 33 | } 34 | } 35 | } 36 | 37 | private final String[] aliases; 38 | 39 | private NgCommand(String... aliases) { 40 | this.aliases = aliases; 41 | } 42 | 43 | public String[] getAliases() { 44 | return aliases; 45 | } 46 | 47 | public static NgCommand getCommand(String cmd) { 48 | return commandMaps.get(cmd.toLowerCase()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/launch/AngularCLILaunchConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.cli.launch; 12 | 13 | import org.eclipse.core.externaltools.internal.IExternalToolConstants; 14 | 15 | import ts.eclipse.ide.angular.cli.AngularCLIPlugin; 16 | import ts.eclipse.ide.core.TypeScriptCorePlugin; 17 | 18 | /** 19 | * Angular cli launch constants. 20 | * 21 | */ 22 | public class AngularCLILaunchConstants { 23 | 24 | // Launch constants 25 | public static final String LAUNCH_CONFIGURATION_ID = AngularCLIPlugin.PLUGIN_ID 26 | + ".angularCLILaunchConfigurationType"; //$NON-NLS-1$ 27 | public static final String NODE_FILE_PATH = TypeScriptCorePlugin.PLUGIN_ID + ".NODE_FILE_PATH"; //$NON-NLS-1$ 28 | public static final String NG_FILE_PATH = TypeScriptCorePlugin.PLUGIN_ID + ".NG_FILE_PATH"; //$NON-NLS-1$ 29 | public static final String EXECUTE_NG_WITH_FILE = TypeScriptCorePlugin.PLUGIN_ID + ".EXECUTE_NG_WITH_FILE"; //$NON-NLS-1$ 30 | public static final String WORKING_DIR = IExternalToolConstants.ATTR_WORKING_DIRECTORY; //$NON-NLS-1$ 31 | public static final String OPERATION = TypeScriptCorePlugin.PLUGIN_ID + ".OPERATION"; //$NON-NLS-1$ 32 | public static final String OPERATION_PARAMETERS = TypeScriptCorePlugin.PLUGIN_ID + ".OPERATION_PARAMETERS"; //$NON-NLS-1$ 33 | } 34 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/preferences/AngularCLIPreferenceConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.cli.preferences; 12 | 13 | /** 14 | * Angular cli preferences constants. 15 | * 16 | */ 17 | public class AngularCLIPreferenceConstants { 18 | 19 | public static final String NG_USE_GLOBAL_INSTALLATION = "ngUseGlobalInstallation"; //$NON-NLS-1$ 20 | public static final String NG_CUSTOM_FILE_PATH = "ngCustomFilePath"; //$NON-NLS-1$ 21 | public static final String EXECUTE_NG_WITH_FILE = "executeNgWithFile"; //$NON-NLS-1$ 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/utils/CLIStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * Springrbua 11 | */ 12 | package ts.eclipse.ide.angular.cli.utils; 13 | 14 | import java.io.File; 15 | 16 | import ts.eclipse.ide.ui.preferences.StatusInfo; 17 | 18 | /** Class which holds the status of a specific Angular-CLI installation. */ 19 | public class CLIStatus extends StatusInfo { 20 | 21 | private final File ngFile; 22 | private String version; 23 | 24 | public CLIStatus(File ngFile, String errorMessage) { 25 | if (errorMessage != null) { 26 | setError(errorMessage); 27 | } 28 | this.ngFile = ngFile; 29 | } 30 | 31 | public File getNgFile() { 32 | return ngFile; 33 | } 34 | 35 | public void setVersion(String version) { 36 | this.version = version; 37 | } 38 | 39 | public String getVersion() { 40 | return version; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/cli/utils/NgVersionJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * Springrbua 11 | */ 12 | package ts.eclipse.ide.angular.cli.utils; 13 | 14 | import java.io.File; 15 | import java.io.IOException; 16 | 17 | import org.eclipse.core.runtime.IProgressMonitor; 18 | import org.eclipse.core.runtime.IStatus; 19 | import org.eclipse.core.runtime.Status; 20 | import org.eclipse.core.runtime.jobs.Job; 21 | import org.eclipse.osgi.util.NLS; 22 | 23 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 24 | import ts.utils.FileUtils; 25 | import ts.utils.StringUtils; 26 | 27 | /** Class for executing "ng --version" Command. */ 28 | public class NgVersionJob extends Job { 29 | 30 | private File nodeFile; 31 | private File ngFile; 32 | 33 | public NgVersionJob() { 34 | super(AngularCLIMessages.AngularCLIConfigurationBlock_ValidatingNgCli_jobName); 35 | } 36 | 37 | /** Sets the NodeJS-File for this Job. */ 38 | public void setNodeFile(File nodeFile) { 39 | this.nodeFile = nodeFile; 40 | } 41 | 42 | /** Sets the Ng-File for this Job. */ 43 | public void setNgFile(File ngFile) { 44 | this.ngFile = ngFile; 45 | } 46 | 47 | @Override 48 | protected IStatus run(IProgressMonitor monitor) { 49 | if (monitor.isCanceled()) { 50 | return Status.CANCEL_STATUS; 51 | } 52 | File currentNgFile = ngFile; 53 | if (currentNgFile == null) { 54 | return Status.CANCEL_STATUS; 55 | } 56 | String version = null; 57 | String errorMessage = null; 58 | try { 59 | version = CLIProcessHelper.getNgVersion(currentNgFile, nodeFile); 60 | } catch (IOException e) { 61 | errorMessage = e.getMessage(); 62 | } 63 | final CLIStatus status = StringUtils.isEmpty(version) ? new CLIStatus(null, 64 | errorMessage != null ? errorMessage 65 | : NLS.bind(AngularCLIMessages.AngularCLIConfigurationBlock_ngCustomFile_invalid_error, 66 | FileUtils.getPath(currentNgFile))) 67 | : new CLIStatus(currentNgFile, null); 68 | status.setVersion(version); 69 | if (monitor.isCanceled() || !currentNgFile.equals(ngFile)) { 70 | return Status.CANCEL_STATUS; 71 | } 72 | return status; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/AngularCLIProjectSettings.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.internal.cli; 2 | 3 | import java.io.File; 4 | 5 | import org.eclipse.core.resources.IProject; 6 | import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; 7 | 8 | import ts.eclipse.ide.angular.cli.AngularCLIPlugin; 9 | import ts.eclipse.ide.angular.cli.preferences.AngularCLIPreferenceConstants; 10 | import ts.eclipse.ide.core.resources.AbstractTypeScriptSettings; 11 | import ts.utils.StringUtils; 12 | 13 | public class AngularCLIProjectSettings extends AbstractTypeScriptSettings { 14 | 15 | public AngularCLIProjectSettings(IProject project) { 16 | super(project, AngularCLIPlugin.PLUGIN_ID); 17 | } 18 | 19 | @Override 20 | public void preferenceChange(PreferenceChangeEvent event) { 21 | 22 | } 23 | 24 | public File getNgFile() { 25 | String path = super.getStringPreferencesValue(AngularCLIPreferenceConstants.NG_CUSTOM_FILE_PATH, null); 26 | if (!StringUtils.isEmpty(path)) { 27 | return resolvePath(path); 28 | } 29 | return null; 30 | } 31 | 32 | public boolean isExecuteNgWithFile() { 33 | return super.getBooleanPreferencesValue(AngularCLIPreferenceConstants.EXECUTE_NG_WITH_FILE, false); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/AngularCLIPropertyTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli; 12 | 13 | import org.eclipse.core.expressions.PropertyTester; 14 | import org.eclipse.core.resources.IResource; 15 | import org.eclipse.core.runtime.IAdaptable; 16 | 17 | /** 18 | * Angular CLI Property tester. 19 | * 20 | */ 21 | public class AngularCLIPropertyTester extends PropertyTester { 22 | 23 | private static final String IS_ANGULAR_CLI_PROJECT_PROPERTY = "isAngularCLIProject"; 24 | 25 | public AngularCLIPropertyTester() { 26 | // Default constructor is required for property tester 27 | } 28 | 29 | /** 30 | * Tests if the receiver object is a project is a Angular CLI project and 31 | * false otherwise. 32 | * 33 | * @return true if the receiver object is a project is a Angular CLI project 34 | * and false otherwise. 35 | */ 36 | @Override 37 | public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { 38 | if (IS_ANGULAR_CLI_PROJECT_PROPERTY.equals(property)) { 39 | return testIsAngularCLIProject(receiver); 40 | } 41 | return false; 42 | } 43 | 44 | private boolean testIsAngularCLIProject(Object receiver) { 45 | if (receiver instanceof IAdaptable) { 46 | IResource resource = (IResource) ((IAdaptable) receiver).getAdapter(IResource.class); 47 | if (resource != null) { 48 | return AngularCLIProject.isAngularCLIProject(resource.getProject()); 49 | } 50 | } 51 | return false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/Trace.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli; 12 | 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | 18 | import org.eclipse.core.runtime.IStatus; 19 | import org.eclipse.core.runtime.Status; 20 | 21 | import ts.eclipse.ide.angular.cli.AngularCLIPlugin; 22 | 23 | /** 24 | * Helper class to route trace output. 25 | */ 26 | public class Trace { 27 | public static final byte CONFIG = 0; 28 | public static final byte INFO = 1; 29 | public static final byte WARNING = 2; 30 | public static final byte SEVERE = 3; 31 | public static final byte FINEST = 4; 32 | public static final byte FINER = 5; 33 | public static final byte PERFORMANCE = 6; 34 | public static final byte EXTENSION_POINT = 7; 35 | 36 | private static final String[] levelNames = new String[] { "CONFIG ", "INFO ", "WARNING", "SEVERE ", "FINER ", 37 | "FINEST ", "PERF ", "EXTENSION" }; 38 | 39 | private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS"); 40 | 41 | private static Set logged = new HashSet(); 42 | 43 | /** 44 | * Trace constructor comment. 45 | */ 46 | private Trace() { 47 | super(); 48 | } 49 | 50 | /** 51 | * Trace the given text. 52 | * 53 | * @param level 54 | * a trace level 55 | * @param s 56 | * a message 57 | */ 58 | public static void trace(byte level, String s) { 59 | trace(level, s, null); 60 | } 61 | 62 | /** 63 | * Trace the given message and exception. 64 | * 65 | * @param level 66 | * a trace level 67 | * @param s 68 | * a message 69 | * @param t 70 | * a throwable 71 | */ 72 | public static void trace(byte level, String s, Throwable t) { 73 | if (s == null) 74 | return; 75 | 76 | if (level == SEVERE) { 77 | if (!logged.contains(s)) { 78 | AngularCLIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, AngularCLIPlugin.PLUGIN_ID, s, t)); 79 | logged.add(s); 80 | } 81 | } 82 | 83 | if (!AngularCLIPlugin.getDefault().isDebugging()) 84 | return; 85 | 86 | StringBuilder sb = new StringBuilder(AngularCLIPlugin.PLUGIN_ID); 87 | sb.append(" "); 88 | sb.append(levelNames[level]); 89 | sb.append(" "); 90 | sb.append(sdf.format(new Date())); 91 | sb.append(" "); 92 | sb.append(s); 93 | System.out.println(sb.toString()); 94 | if (t != null) 95 | t.printStackTrace(); 96 | } 97 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/editor/AngularCLIEditor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.editor; 12 | 13 | import org.eclipse.ui.PartInitException; 14 | 15 | import ts.eclipse.ide.json.ui.AbstractFormEditor; 16 | 17 | /** 18 | * angular-cli.json editor composed with multiple page: 19 | * 20 | *
    21 | *
  • Overview page.
  • 22 | *
  • Source page.
  • 23 | *
24 | * 25 | */ 26 | public class AngularCLIEditor extends AbstractFormEditor { 27 | 28 | @Override 29 | protected void doAddPages() throws PartInitException { 30 | addPage(new OverviewPage(this)); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/editor/NgBuildAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.editor; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.jface.dialogs.ErrorDialog; 16 | import org.eclipse.ui.IEditorPart; 17 | 18 | import ts.eclipse.ide.angular.cli.NgCommand; 19 | import ts.eclipse.ide.angular.internal.cli.AngularCLIImageResource; 20 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 21 | import ts.eclipse.ide.angular.internal.cli.launch.AngularCLILaunchHelper; 22 | import ts.eclipse.ide.json.ui.actions.AbstractFileAction; 23 | 24 | /** 25 | * "ng build" action. 26 | * 27 | */ 28 | public class NgBuildAction extends AbstractFileAction { 29 | 30 | public NgBuildAction(IEditorPart editor) { 31 | super(editor); 32 | super.setText(AngularCLIMessages.AngularCLIEditor_NgBuildAction_text); 33 | super.setImageDescriptor(AngularCLIImageResource.getImageDescriptor(AngularCLIImageResource.IMG_NG_BUILD)); 34 | } 35 | 36 | @Override 37 | public void run() { 38 | IFile file = getFile(); 39 | if (file != null) { 40 | try { 41 | AngularCLILaunchHelper.launch(NgCommand.BUILD, file.getProject()); 42 | } catch (CoreException e) { 43 | ErrorDialog.openError(getEditor().getSite().getShell(), 44 | AngularCLIMessages.AngularCLIEditor_NgCommand_dialog_title, 45 | AngularCLIMessages.AngularCLIEditor_NgCommand_failed, e.getStatus()); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/editor/NgE2eAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.editor; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.jface.dialogs.ErrorDialog; 16 | import org.eclipse.ui.IEditorPart; 17 | 18 | import ts.eclipse.ide.angular.cli.NgCommand; 19 | import ts.eclipse.ide.angular.internal.cli.AngularCLIImageResource; 20 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 21 | import ts.eclipse.ide.angular.internal.cli.launch.AngularCLILaunchHelper; 22 | import ts.eclipse.ide.json.ui.actions.AbstractFileAction; 23 | 24 | /** 25 | * "ng e2e" action. 26 | * 27 | */ 28 | public class NgE2eAction extends AbstractFileAction { 29 | 30 | public NgE2eAction(IEditorPart editor) { 31 | super(editor); 32 | super.setText(AngularCLIMessages.AngularCLIEditor_NgE2eAction_text); 33 | super.setImageDescriptor(AngularCLIImageResource.getImageDescriptor(AngularCLIImageResource.IMG_NG_E2E)); 34 | } 35 | 36 | @Override 37 | public void run() { 38 | IFile file = getFile(); 39 | if (file != null) { 40 | try { 41 | AngularCLILaunchHelper.launch(NgCommand.E2E, file.getProject()); 42 | } catch (CoreException e) { 43 | ErrorDialog.openError(getEditor().getSite().getShell(), 44 | AngularCLIMessages.AngularCLIEditor_NgCommand_dialog_title, 45 | AngularCLIMessages.AngularCLIEditor_NgCommand_failed, e.getStatus()); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/editor/NgServeAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.editor; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.jface.dialogs.ErrorDialog; 16 | import org.eclipse.ui.IEditorPart; 17 | 18 | import ts.eclipse.ide.angular.cli.NgCommand; 19 | import ts.eclipse.ide.angular.internal.cli.AngularCLIImageResource; 20 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 21 | import ts.eclipse.ide.angular.internal.cli.launch.AngularCLILaunchHelper; 22 | import ts.eclipse.ide.json.ui.actions.AbstractFileAction; 23 | 24 | /** 25 | * "ng serve" action. 26 | * 27 | */ 28 | public class NgServeAction extends AbstractFileAction { 29 | 30 | public NgServeAction(IEditorPart editor) { 31 | super(editor); 32 | super.setText(AngularCLIMessages.AngularCLIEditor_NgServeAction_text); 33 | super.setImageDescriptor(AngularCLIImageResource.getImageDescriptor(AngularCLIImageResource.IMG_NG_SERVE)); 34 | } 35 | 36 | @Override 37 | public void run() { 38 | IFile file = getFile(); 39 | if (file != null) { 40 | try { 41 | AngularCLILaunchHelper.launch(NgCommand.SERVE, file.getProject()); 42 | } catch (CoreException e) { 43 | ErrorDialog.openError(getEditor().getSite().getShell(), 44 | AngularCLIMessages.AngularCLIEditor_NgCommand_dialog_title, 45 | AngularCLIMessages.AngularCLIEditor_NgCommand_failed, e.getStatus()); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/editor/NgTestAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.editor; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.jface.dialogs.ErrorDialog; 16 | import org.eclipse.ui.IEditorPart; 17 | 18 | import ts.eclipse.ide.angular.cli.NgCommand; 19 | import ts.eclipse.ide.angular.internal.cli.AngularCLIImageResource; 20 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 21 | import ts.eclipse.ide.angular.internal.cli.launch.AngularCLILaunchHelper; 22 | import ts.eclipse.ide.json.ui.actions.AbstractFileAction; 23 | 24 | /** 25 | * "ng test" action. 26 | * 27 | */ 28 | public class NgTestAction extends AbstractFileAction { 29 | 30 | public NgTestAction(IEditorPart editor) { 31 | super(editor); 32 | super.setText(AngularCLIMessages.AngularCLIEditor_NgTestAction_text); 33 | super.setImageDescriptor(AngularCLIImageResource.getImageDescriptor(AngularCLIImageResource.IMG_NG_TEST)); 34 | } 35 | 36 | @Override 37 | public void run() { 38 | IFile file = getFile(); 39 | if (file != null) { 40 | try { 41 | AngularCLILaunchHelper.launch(NgCommand.TEST, file.getProject()); 42 | } catch (CoreException e) { 43 | ErrorDialog.openError(getEditor().getSite().getShell(), 44 | AngularCLIMessages.AngularCLIEditor_NgCommand_dialog_title, 45 | AngularCLIMessages.AngularCLIEditor_NgCommand_failed, e.getStatus()); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/jobs/NgServeJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.jobs; 13 | 14 | import java.net.URL; 15 | 16 | import org.eclipse.core.runtime.IProgressMonitor; 17 | import org.eclipse.core.runtime.IStatus; 18 | import org.eclipse.core.runtime.Status; 19 | import org.eclipse.ui.PlatformUI; 20 | import org.eclipse.ui.browser.IWebBrowser; 21 | import org.eclipse.ui.browser.IWorkbenchBrowserSupport; 22 | import org.eclipse.ui.progress.UIJob; 23 | 24 | import ts.eclipse.ide.angular.cli.AngularCLIPlugin; 25 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 26 | 27 | /** 28 | * Open a Web Browser with the given server URL. 29 | * 30 | */ 31 | public class NgServeJob extends UIJob { 32 | 33 | private final String serverURL; 34 | 35 | public NgServeJob(String serverURL) { 36 | super(AngularCLIMessages.NgServeJob_jobName); 37 | this.serverURL = serverURL; 38 | } 39 | 40 | @Override 41 | public IStatus runInUIThread(IProgressMonitor monitor) { 42 | try { 43 | IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport(); 44 | IWebBrowser browser = browserSupport.createBrowser( 45 | IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, null, null, null); 46 | browser.openURL(new URL(serverURL)); 47 | } catch (Exception e) { 48 | return new Status(IStatus.ERROR, AngularCLIPlugin.PLUGIN_ID, AngularCLIMessages.NgServeJob_error, e); 49 | } 50 | return Status.OK_STATUS; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/json/App.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.json; 13 | 14 | /** 15 | * Pojo for "app" of angular-cli.json 16 | * 17 | */ 18 | public class App { 19 | 20 | private String root; 21 | private String prefix; 22 | private String outDir; 23 | 24 | public String getRoot() { 25 | return root; 26 | } 27 | 28 | public String getPrefix() { 29 | return prefix; 30 | } 31 | 32 | public String getOutDir() { 33 | return outDir; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/json/Defaults.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.json; 13 | 14 | import com.google.gson.annotations.SerializedName; 15 | 16 | /** 17 | * Pojo for "defaults" of angular-cli.json 18 | * 19 | */ 20 | public class Defaults { 21 | 22 | private String styleExt; 23 | 24 | @SerializedName("class") 25 | private GenerateDefaults cliClass; 26 | 27 | private GenerateDefaults component; 28 | 29 | private GenerateDefaults directive; 30 | 31 | @SerializedName("enum") 32 | private GenerateDefaults cliEnum; 33 | 34 | private GenerateDefaults guard; 35 | 36 | @SerializedName("interface") 37 | private GenerateDefaults cliInterface; 38 | 39 | private GenerateDefaults module; 40 | 41 | private GenerateDefaults pipe; 42 | 43 | private GenerateDefaults service; 44 | 45 | public String getStyleExt() { 46 | return styleExt; 47 | } 48 | 49 | public GenerateDefaults getCliClass() { 50 | return cliClass; 51 | } 52 | 53 | public GenerateDefaults getComponent() { 54 | return component; 55 | } 56 | 57 | public GenerateDefaults getDirective() { 58 | return directive; 59 | } 60 | 61 | public GenerateDefaults getCliEnum() { 62 | return cliEnum; 63 | } 64 | 65 | public GenerateDefaults getGuard() { 66 | return guard; 67 | } 68 | 69 | public GenerateDefaults getCliInterface() { 70 | return cliInterface; 71 | } 72 | 73 | public GenerateDefaults getModule() { 74 | return module; 75 | } 76 | 77 | public GenerateDefaults getPipe() { 78 | return pipe; 79 | } 80 | 81 | public GenerateDefaults getService() { 82 | return service; 83 | } 84 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/json/GenerateDefaults.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Springrbua - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.json; 13 | 14 | import com.google.gson.annotations.SerializedName; 15 | 16 | /** 17 | * Pojo for different "defaults" for the generate commands of angular-cli.json. 18 | * Note, that not every "defaults" supports all of the fields. 19 | * 20 | */ 21 | public class GenerateDefaults { 22 | 23 | // Constants for ViewEncapsulation 24 | public static final String VE_EMULATED = "Emulated"; 25 | public static final String VE_NATIVE = "Native"; 26 | public static final String VE_NONE = "None"; 27 | 28 | // Constants for ChangeDetectionStrategy 29 | public static final String CD_ON_PUSH = "OnPush"; 30 | public static final String CD_DEFAULT = "Default"; 31 | 32 | @SerializedName("change-detection") 33 | private String changeDetection; 34 | 35 | private boolean flat; 36 | 37 | @SerializedName("inline-style") 38 | private boolean inlineStyle; 39 | 40 | @SerializedName("inline-template") 41 | private boolean inlineTemplate; 42 | 43 | private String prefix; 44 | 45 | private boolean spec; 46 | 47 | @SerializedName("view-encapsulation") 48 | private String viewEncapsulation; 49 | 50 | public String getChangeDetection() { 51 | return checkChangeDetection(changeDetection); 52 | } 53 | 54 | public static String checkChangeDetection(String cd) { 55 | if (cd != null) { 56 | switch (cd) { 57 | case CD_DEFAULT: 58 | case CD_ON_PUSH: 59 | return cd; 60 | default: 61 | return CD_DEFAULT; 62 | } 63 | } 64 | return CD_DEFAULT; 65 | } 66 | 67 | public boolean isFlat() { 68 | return flat; 69 | } 70 | 71 | public boolean isInlineStyle() { 72 | return inlineStyle; 73 | } 74 | 75 | public boolean isInlineTemplate() { 76 | return inlineTemplate; 77 | } 78 | 79 | public String getPrefix() { 80 | return prefix; 81 | } 82 | 83 | public boolean isSpec() { 84 | return spec; 85 | } 86 | 87 | public String getViewEncapsulation() { 88 | return checkViewEncapsulation(viewEncapsulation); 89 | } 90 | 91 | public static String checkViewEncapsulation(String ve) { 92 | if (ve != null) { 93 | switch (ve) { 94 | case VE_EMULATED: 95 | case VE_NATIVE: 96 | case VE_NONE: 97 | return ve; 98 | default: 99 | return VE_EMULATED; 100 | } 101 | } 102 | return VE_EMULATED; 103 | } 104 | 105 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/json/Inline.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Springrbua - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.json; 13 | 14 | /** 15 | * Pojo for "inline" of angular-cli.json 16 | * 17 | */ 18 | public class Inline { 19 | 20 | private boolean template; 21 | 22 | private boolean style; 23 | 24 | public boolean isTemplate() { 25 | return template; 26 | } 27 | 28 | public boolean isStyle() { 29 | return style; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/json/Spec.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Springrbua - initial API and implementation 10 | * 11 | */ 12 | 13 | package ts.eclipse.ide.angular.internal.cli.json; 14 | 15 | import com.google.gson.annotations.SerializedName; 16 | 17 | /** 18 | * Pojo for "spec" of angular-cli.json 19 | * 20 | */ 21 | public class Spec { 22 | 23 | @SerializedName("class") 24 | private boolean cls; 25 | 26 | private boolean component; 27 | 28 | private boolean directive; 29 | 30 | private boolean module; 31 | 32 | private boolean pipe; 33 | 34 | private boolean service; 35 | 36 | private boolean guard; 37 | 38 | public boolean isClass() { 39 | return cls; 40 | } 41 | 42 | public boolean isComponent() { 43 | return component; 44 | } 45 | 46 | public boolean isDirective() { 47 | return directive; 48 | } 49 | 50 | public boolean isModule() { 51 | return module; 52 | } 53 | 54 | public boolean isPipe() { 55 | return pipe; 56 | } 57 | 58 | public boolean isService() { 59 | return service; 60 | } 61 | 62 | public boolean isGuard() { 63 | return guard; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/shortcut/AngularCLILaunchShortcut.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.shortcut; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.core.resources.IResource; 15 | import org.eclipse.core.runtime.CoreException; 16 | import org.eclipse.debug.ui.ILaunchShortcut; 17 | import org.eclipse.jface.viewers.ISelection; 18 | import org.eclipse.jface.viewers.IStructuredSelection; 19 | import org.eclipse.ui.IEditorInput; 20 | import org.eclipse.ui.IEditorPart; 21 | import org.eclipse.ui.IFileEditorInput; 22 | 23 | import ts.eclipse.ide.angular.cli.NgCommand; 24 | import ts.eclipse.ide.angular.internal.cli.Trace; 25 | import ts.eclipse.ide.angular.internal.cli.launch.AngularCLILaunchHelper; 26 | 27 | /** 28 | * Base class for Launch configuration shortcut for angular-cli 29 | */ 30 | public class AngularCLILaunchShortcut implements ILaunchShortcut { 31 | 32 | private final NgCommand ngCommand; 33 | 34 | public AngularCLILaunchShortcut(NgCommand ngCommand) { 35 | this.ngCommand = ngCommand; 36 | } 37 | 38 | @Override 39 | public void launch(ISelection selection, String mode) { 40 | try { 41 | Object objSelected = ((IStructuredSelection) selection).getFirstElement(); 42 | if (objSelected instanceof IResource) { 43 | AngularCLILaunchHelper.launch(ngCommand, ((IResource) objSelected).getProject(), mode); 44 | } 45 | } catch (CoreException e) { 46 | Trace.trace(Trace.SEVERE, e.getLocalizedMessage()); 47 | } 48 | } 49 | 50 | @Override 51 | public void launch(IEditorPart editor, String mode) { 52 | try { 53 | IEditorInput editorInput = editor.getEditorInput(); 54 | if (editorInput instanceof IFileEditorInput) { 55 | IFile file = ((IFileEditorInput) editorInput).getFile(); 56 | AngularCLILaunchHelper.launch(ngCommand, file.getProject(), mode); 57 | } 58 | } catch (CoreException e) { 59 | Trace.trace(Trace.SEVERE, e.getLocalizedMessage()); 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/shortcut/NgBuildLaunchShortcut.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.shortcut; 12 | 13 | import ts.eclipse.ide.angular.cli.NgCommand; 14 | 15 | /** 16 | * Launch configuration shortcut for "ng build". 17 | * 18 | */ 19 | public class NgBuildLaunchShortcut extends AngularCLILaunchShortcut { 20 | 21 | public NgBuildLaunchShortcut() { 22 | super(NgCommand.BUILD); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/shortcut/NgE2eLaunchShortcut.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.shortcut; 12 | 13 | import ts.eclipse.ide.angular.cli.NgCommand; 14 | 15 | /** 16 | * Launch configuration shortcut for "ng e2e". 17 | * 18 | */ 19 | public class NgE2eLaunchShortcut extends AngularCLILaunchShortcut { 20 | 21 | public NgE2eLaunchShortcut() { 22 | super(NgCommand.E2E); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/shortcut/NgServeLaunchShortcut.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.shortcut; 12 | 13 | import ts.eclipse.ide.angular.cli.NgCommand; 14 | 15 | /** 16 | * Launch configuration shortcut for "ng serve". 17 | * 18 | */ 19 | public class NgServeLaunchShortcut extends AngularCLILaunchShortcut { 20 | 21 | public NgServeLaunchShortcut() { 22 | super(NgCommand.SERVE); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/shortcut/NgTestLaunchShortcut.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.shortcut; 12 | 13 | import ts.eclipse.ide.angular.cli.NgCommand; 14 | 15 | /** 16 | * Launch configuration shortcut for "ng test". 17 | * 18 | */ 19 | public class NgTestLaunchShortcut extends AngularCLILaunchShortcut { 20 | 21 | public NgTestLaunchShortcut() { 22 | super(NgCommand.TEST); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/launch/ui/AngularCLILaunchTabGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.launch.ui; 12 | 13 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 14 | import org.eclipse.debug.ui.CommonTab; 15 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 16 | import org.eclipse.debug.ui.ILaunchConfigurationTab; 17 | import org.eclipse.debug.ui.RefreshTab; 18 | 19 | /** 20 | * ng launch tab group. 21 | * 22 | */ 23 | public class AngularCLILaunchTabGroup extends AbstractLaunchConfigurationTabGroup { 24 | 25 | @Override 26 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 27 | ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new MainTab(), new RefreshTab(), 28 | new CommonTab() }; 29 | setTabs(tabs); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/preferences/AngularCLIPreferenceInitializer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.cli.preferences; 12 | 13 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 14 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; 15 | 16 | import ts.eclipse.ide.angular.cli.AngularCLIPlugin; 17 | import ts.eclipse.ide.angular.cli.preferences.AngularCLIPreferenceConstants; 18 | import ts.eclipse.ide.core.utils.PreferencesHelper; 19 | 20 | /** 21 | * Angular cli preferences initializer. 22 | * 23 | */ 24 | public class AngularCLIPreferenceInitializer extends AbstractPreferenceInitializer { 25 | 26 | @Override 27 | public void initializeDefaultPreferences() { 28 | IEclipsePreferences node = PreferencesHelper 29 | .getWorkspaceDefaultPreferences(AngularCLIPlugin.PLUGIN_ID); 30 | 31 | // initialize properties for direct access of node.js server (start an 32 | // internal process) 33 | initializeCliPreferences(node); 34 | } 35 | 36 | private void initializeCliPreferences(IEclipsePreferences node) { 37 | node.putBoolean(AngularCLIPreferenceConstants.NG_USE_GLOBAL_INSTALLATION, true); 38 | node.put(AngularCLIPreferenceConstants.NG_CUSTOM_FILE_PATH, ""); 39 | node.putBoolean(AngularCLIPreferenceConstants.EXECUTE_NG_WITH_FILE, false); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/terminal/NgGenerateCommandInterpreter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.terminal; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | import org.eclipse.core.resources.IContainer; 18 | import org.eclipse.core.resources.ResourcesPlugin; 19 | 20 | import ts.eclipse.ide.angular.internal.cli.jobs.NgGenerateJob; 21 | import ts.eclipse.ide.terminal.interpreter.AbstractCommandInterpreter; 22 | 23 | /** 24 | * "ng generate ..." interpreter to refresh the generated resources. 25 | * 26 | */ 27 | public class NgGenerateCommandInterpreter extends AbstractCommandInterpreter { 28 | 29 | private static final String CREATE = "create"; 30 | 31 | private final List fileNames; 32 | private final String blueprint; 33 | 34 | public NgGenerateCommandInterpreter(String blueprint, String workingDir) { 35 | super(workingDir); 36 | this.fileNames = new ArrayList(); 37 | this.blueprint = blueprint; 38 | } 39 | 40 | @Override 41 | public void execute(String newWorkingDir) { 42 | final IContainer[] c = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocation(getWorkingDirPath()); 43 | if (c != null && c.length > 0) { 44 | // Refresh generated files and select it in the Project Explorer. 45 | NgGenerateJob job = new NgGenerateJob(fileNames, c[0], blueprint); 46 | job.setRule(ResourcesPlugin.getWorkspace().getRoot()); 47 | job.schedule(); 48 | } 49 | 50 | } 51 | 52 | @Override 53 | public void onTrace(String line) { 54 | line = line.trim(); 55 | if (line.startsWith(CREATE)) { 56 | fileNames.add(""); 57 | } else { 58 | if (!fileNames.isEmpty()) { 59 | int index = fileNames.size() - 1; 60 | String name = fileNames.get(index) + line.trim(); 61 | // in angular cli 1.5, we have 62 | // create src/app/y.ts (19 bytes), we need to remove the ( 63 | int bracket = name.indexOf("("); 64 | if (bracket != -1) { 65 | name = name.substring(0, bracket).trim(); 66 | } 67 | fileNames.set(index, name); 68 | } 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/terminal/NgProjectCommandInterpreter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | * some code copied/pasted from org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob 12 | */ 13 | package ts.eclipse.ide.angular.internal.cli.terminal; 14 | 15 | import java.io.File; 16 | 17 | import org.eclipse.core.resources.ResourcesPlugin; 18 | 19 | import ts.eclipse.ide.angular.internal.cli.jobs.NgProjectJob; 20 | import ts.eclipse.ide.terminal.interpreter.AbstractCommandInterpreter; 21 | 22 | /** 23 | * (ng new or ng init) interpreter to create an Eclipse project at the end of 24 | * the process and open the generated angular-cli.json file. 25 | * 26 | */ 27 | public class NgProjectCommandInterpreter extends AbstractCommandInterpreter { 28 | 29 | private final File projectDir; 30 | 31 | public NgProjectCommandInterpreter(File projectDir, String workingDir) { 32 | super(workingDir); 33 | this.projectDir = projectDir; 34 | } 35 | 36 | @Override 37 | public void execute(String newWorkingDir) { 38 | // Refresh Eclipse project and open angular-cli.json 39 | NgProjectJob job = new NgProjectJob(projectDir); 40 | job.setRule(ResourcesPlugin.getWorkspace().getRoot()); 41 | job.schedule(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/terminal/NgServeCommandInterpreter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.terminal; 13 | 14 | import java.net.URL; 15 | 16 | import ts.eclipse.ide.angular.internal.cli.jobs.NgServeJob; 17 | import ts.eclipse.ide.terminal.interpreter.AbstractCommandInterpreter; 18 | 19 | /** 20 | * "ng serve" interpreter to open a WebBrowser when trace "NG Live Development 21 | * Server is running on http://localhost:4200. **" appears. 22 | * 23 | */ 24 | public class NgServeCommandInterpreter extends AbstractCommandInterpreter { 25 | 26 | private static final String HTTP = "http"; 27 | 28 | private boolean open; // Has the browser already been opened? 29 | 30 | public NgServeCommandInterpreter(String workingDir) { 31 | super(workingDir); 32 | } 33 | 34 | @Override 35 | public void execute(String newWorkingDir) { 36 | // Do nothing, the open of web browser is done when trace "Serving on 37 | // http://localhost:4200/" 38 | // is found. 39 | } 40 | 41 | @Override 42 | public void onTrace(String line) { 43 | // track 44 | // ** NG Live Development Server is running on http://localhost:4200. ** 45 | // ** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 ** 46 | if (!open) { 47 | int startIndex = line.indexOf(HTTP); 48 | if (startIndex != -1) { 49 | int endIndex = line.indexOf(".", startIndex); 50 | if (endIndex == -1) { 51 | endIndex = line.indexOf(" ", startIndex); 52 | } 53 | final String serverURL = line.substring(startIndex, endIndex != -1 ? endIndex : line.length()).trim(); 54 | 55 | // Basic URL-Validation 56 | URL u; 57 | try { 58 | u = new URL(serverURL); // this would check for the protocol 59 | u.toURI(); // extra checking required for validation of URI 60 | 61 | // Open a Web Browser with the given server URL 62 | new NgServeJob(serverURL).schedule(); 63 | open = true; 64 | } catch (Exception ignore) { 65 | } 66 | } 67 | } 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgClassWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Class with "ng generate class $name". 22 | * 23 | */ 24 | public class NewNgClassWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgClassWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgClassWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgClassWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgClassWizardPage mainPage = (NewNgClassWizardPage)getMainPage(); 44 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgComponentWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | import ts.eclipse.ide.angular.internal.cli.json.GenerateDefaults; 20 | 21 | /** 22 | * Wizard to generate Angular Component with "ng generate component $name". 23 | * 24 | */ 25 | public class NewNgComponentWizard extends AbstractNewNgGenerateWizard { 26 | 27 | public NewNgComponentWizard() { 28 | } 29 | 30 | @Override 31 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 32 | return new NewNgComponentWizardPage(folder); 33 | } 34 | 35 | @Override 36 | public void init(IWorkbench workbench, IStructuredSelection selection) { 37 | super.init(workbench, selection); 38 | super.setWindowTitle(AngularCLIMessages.NewNgComponentWizard_windowTitle); 39 | } 40 | 41 | @Override 42 | protected void appendOperationParameters(StringBuilder sb) { 43 | super.appendOperationParameters(sb); 44 | NewNgComponentWizardPage mainPage = (NewNgComponentWizardPage)getMainPage(); 45 | sb.append(' ').append("--prefix ").append(mainPage.getPrefix()); 46 | if (mainPage.isInlineTemplate()) 47 | sb.append(' ').append("--inline-template"); 48 | if (mainPage.isInlineStyle()) 49 | sb.append(' ').append("--inline-style"); 50 | if (mainPage.isSkipImport()) 51 | sb.append(' ').append("--skip-import"); 52 | if (mainPage.isExport()) 53 | sb.append(' ').append("--export"); 54 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 55 | sb.append(' ').append("--flat ").append(mainPage.isFlat()); 56 | String viewEncapsulation = mainPage.getViewEncapsulation(); 57 | if (!GenerateDefaults.VE_EMULATED.equals(viewEncapsulation)) 58 | sb.append(' ').append("--view-encapsulation ").append(viewEncapsulation); 59 | String changeDetection = mainPage.getChangeDetection(); 60 | if (!GenerateDefaults.CD_DEFAULT.equals(changeDetection)) 61 | sb.append(' ').append("--change-detection ").append(changeDetection); 62 | } 63 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgDirectiveWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Directive with "ng generate directive $name". 22 | * 23 | */ 24 | public class NewNgDirectiveWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgDirectiveWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgDirectiveWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgDirectiveWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgDirectiveWizardPage mainPage = (NewNgDirectiveWizardPage)getMainPage(); 44 | sb.append(' ').append("--prefix ").append(mainPage.getPrefix()); 45 | if (mainPage.isSkipImport()) 46 | sb.append(' ').append("--skip-import"); 47 | if (mainPage.isExport()) 48 | sb.append(' ').append("--export"); 49 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 50 | sb.append(' ').append("--flat ").append(mainPage.isFlat()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgEnumWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Enum with "ng generate enum $name". 22 | * 23 | */ 24 | public class NewNgEnumWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgEnumWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgEnumWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgEnumWizard_windowTitle); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgEnumWizardPage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | 16 | import ts.eclipse.ide.angular.cli.NgBlueprint; 17 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 18 | import ts.eclipse.ide.angular.internal.cli.json.AngularCLIJson; 19 | 20 | /** 21 | * Wizard page for Angular Enum. 22 | * 23 | */ 24 | public class NewNgEnumWizardPage extends NgGenerateBlueprintWizardPage { 25 | 26 | private static final String PAGE_NAME = "ngEnum"; 27 | 28 | protected NewNgEnumWizardPage(IContainer folder) { 29 | super(PAGE_NAME, AngularCLIMessages.NewNgEnumWizardPage_title, null, NgBlueprint.ENUM, folder); 30 | super.setDescription(AngularCLIMessages.NewNgEnumWizardPage_description); 31 | } 32 | 33 | @Override 34 | protected String[] getGeneratedFilesImpl() { 35 | AngularCLIJson cliJson = getAngularCLIJson(); 36 | String name = getBlueprintName(); 37 | return new String[] { cliJson.getEnumFileName(name) }; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgGuardWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Springrbua - initial implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Guard with "ng generate Guard $name". 22 | * 23 | */ 24 | public class NewNgGuardWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgGuardWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgGuardWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgGuardWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgGuardWizardPage mainPage = (NewNgGuardWizardPage)getMainPage(); 44 | sb.append(' ').append("--flat ").append(mainPage.isFlat()); 45 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgInterfaceWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Interface with "ng generate interface $name". 22 | * 23 | */ 24 | public class NewNgInterfaceWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgInterfaceWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgInterfaceWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgInterfaceWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgInterfaceWizardPage mainPage = (NewNgInterfaceWizardPage)getMainPage(); 44 | String prefix = mainPage.getPrefix(); 45 | if (prefix != null && prefix.length() > 0) 46 | sb.append(' ').append("--prefix ").append(prefix); 47 | } 48 | } -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgModuleWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Springrbua - initial implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Module with "ng generate module $name". 22 | * 23 | */ 24 | public class NewNgModuleWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgModuleWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgModuleWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgModuleWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgModuleWizardPage mainPage = (NewNgModuleWizardPage)getMainPage(); 44 | if (mainPage.isFlat()) 45 | sb.append(' ').append("--flat"); 46 | if (mainPage.isRouting()) 47 | sb.append(' ').append("--routing"); 48 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgPipeWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Pipe with "ng generate pipe $name". 22 | * 23 | */ 24 | public class NewNgPipeWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgPipeWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgPipeWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgPipeWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgPipeWizardPage mainPage = (NewNgPipeWizardPage)getMainPage(); 44 | if (mainPage.isSkipImport()) 45 | sb.append(' ').append("--skip-import"); 46 | if (mainPage.isExport()) 47 | sb.append(' ').append("--export"); 48 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 49 | sb.append(' ').append("--flat ").append(mainPage.isFlat()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.cli/src/ts/eclipse/ide/angular/internal/cli/wizards/NewNgServiceWizard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | * 11 | */ 12 | package ts.eclipse.ide.angular.internal.cli.wizards; 13 | 14 | import org.eclipse.core.resources.IContainer; 15 | import org.eclipse.jface.viewers.IStructuredSelection; 16 | import org.eclipse.ui.IWorkbench; 17 | 18 | import ts.eclipse.ide.angular.internal.cli.AngularCLIMessages; 19 | 20 | /** 21 | * Wizard to generate Angular Service with "ng generate service $name". 22 | * 23 | */ 24 | public class NewNgServiceWizard extends AbstractNewNgGenerateWizard { 25 | 26 | public NewNgServiceWizard() { 27 | } 28 | 29 | @Override 30 | protected NgGenerateBlueprintWizardPage createMainPage(IContainer folder) { 31 | return new NewNgServiceWizardPage(folder); 32 | } 33 | 34 | @Override 35 | public void init(IWorkbench workbench, IStructuredSelection selection) { 36 | super.init(workbench, selection); 37 | super.setWindowTitle(AngularCLIMessages.NewNgServiceWizard_windowTitle); 38 | } 39 | 40 | @Override 41 | protected void appendOperationParameters(StringBuilder sb) { 42 | super.appendOperationParameters(sb); 43 | NewNgServiceWizardPage mainPage = (NewNgServiceWizardPage)getMainPage(); 44 | sb.append(' ').append("--flat ").append(mainPage.isFlat()); 45 | sb.append(' ').append("--spec ").append(mainPage.isSpec()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ts.eclipse.ide.angular.core.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.pde.PluginNature 32 | org.eclipse.jdt.core.javanature 33 | 34 | 35 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.8 9 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %providerName 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: ts.eclipse.ide.angular.core.tests;singleton:=true 7 | Bundle-Version: 1.4.0.qualifier 8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 9 | Require-Bundle: org.junit;bundle-version="4.11.0", 10 | org.eclipse.wst.xml.core;bundle-version="1.1.1000", 11 | org.eclipse.wst.sse.core;bundle-version="1.1.1000", 12 | org.eclipse.core.runtime;bundle-version="3.12.0", 13 | org.eclipse.core.resources;bundle-version="3.11.0", 14 | ts.eclipse.ide.angular.core, 15 | org.eclipse.wst.html.core;bundle-version="1.2.0", 16 | org.eclipse.wst.validation, 17 | ts.core;bundle-version="1.0.0" 18 | Bundle-ActivationPolicy: lazy 19 | 20 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/build.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2013 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | source.. = src/ 12 | output.. = bin/ 13 | bin.includes = META-INF/,\ 14 | .,\ 15 | plugin.properties -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/plugin.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2015-2016 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | pluginName=Angular - Eclipse - Core Test 12 | providerName=Angelo ZERR -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | ts.eclipse.ide.angular.core.tests 4 | eclipse-test-plugin 5 | 6 | fr.opensagres.angular 7 | angular-eclipse 8 | 1.4.0-SNAPSHOT 9 | 10 | 11 | src 12 | 13 | 14 | org.eclipse.tycho 15 | tycho-surefire-plugin 16 | ${tycho-version} 17 | 18 | false 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core.tests/src/ts/eclipse/ide/angular/core/hml/DomElementSchemaRegistryTest.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core.hml; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import ts.eclipse.ide.angular.internal.core.html.schema.DomElementSchemaRegistry; 7 | 8 | public class DomElementSchemaRegistryTest { 9 | 10 | @Test 11 | public void propertyExists() { 12 | boolean result = DomElementSchemaRegistry.INSTANCE.hasProperty("button", "value"); 13 | Assert.assertTrue(result); 14 | } 15 | 16 | @Test 17 | public void propertyNotExists() { 18 | boolean result = DomElementSchemaRegistry.INSTANCE.hasProperty("button", "click"); 19 | Assert.assertFalse(result); 20 | } 21 | 22 | @Test 23 | public void eventExists() { 24 | boolean result = DomElementSchemaRegistry.INSTANCE.hasEvent("button", "click"); 25 | Assert.assertTrue(result); 26 | } 27 | 28 | @Test 29 | public void eventNotExists() { 30 | boolean result = DomElementSchemaRegistry.INSTANCE.hasEvent("button", "value"); 31 | Assert.assertFalse(result); 32 | } 33 | 34 | @Test 35 | public void propertyTextContentExists() { 36 | boolean result = DomElementSchemaRegistry.INSTANCE.hasProperty("button", "textContent"); 37 | Assert.assertTrue(result); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ts.eclipse.ide.angular.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.m2e.core.maven2Nature 31 | org.eclipse.pde.PluginNature 32 | org.eclipse.jdt.core.javanature 33 | 34 | 35 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.8 9 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %providerName 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: ts.eclipse.ide.angular.core;singleton:=true 7 | Bundle-Version: 1.4.0.qualifier 8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 9 | Require-Bundle: org.eclipse.core.runtime, 10 | org.eclipse.core.resources, 11 | ts.repository, 12 | ts.core, 13 | ts.eclipse, 14 | org.eclipse.core.commands, 15 | org.eclipse.core.expressions, 16 | org.eclipse.wst.sse.core, 17 | org.eclipse.wst.xml.core, 18 | org.eclipse.wst.html.core;bundle-version="1.2.0", 19 | ts.eclipse.ide.core, 20 | com.google.gson, 21 | ts.eclipse.ide.jsdt.core 22 | Export-Package: ts.eclipse.ide.angular.core, 23 | ts.eclipse.ide.angular.core.html, 24 | ts.eclipse.ide.angular.core.template, 25 | ts.eclipse.ide.angular.core.utils, 26 | ts.eclipse.ide.angular.internal.core.html.schema;x-friends:="ts.eclipse.ide.angular.core.tests" 27 | Bundle-ActivationPolicy: lazy 28 | Bundle-Activator: ts.eclipse.ide.angular.core.AngularCorePlugin 29 | Import-Package: com.eclipsesource.json;version="[0.9.4,0.9.5)" 30 | 31 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/build.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2013 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | source.. = src/ 12 | output.. = bin/ 13 | bin.includes = META-INF/,\ 14 | .,\ 15 | plugin.properties,\ 16 | plugin.xml 17 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/plugin.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2015-2017 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | pluginName=Angular - Eclipse - Core IDE 12 | providerName=Angelo ZERR 13 | 14 | # Angular plugin 15 | @angular/language-service.description=Angular Language Service provides completion, definition, diagnostic for Angular. 16 | @angular/language-service.url= -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | ts.eclipse.ide.angular.core 4 | eclipse-plugin 5 | 6 | fr.opensagres.angular 7 | angular-eclipse 8 | 1.4.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/AngularCorePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core; 12 | 13 | import org.eclipse.core.runtime.Plugin; 14 | import org.osgi.framework.BundleContext; 15 | 16 | import ts.eclipse.ide.angular.core.html.INgBindingManager; 17 | import ts.eclipse.ide.angular.internal.core.html.NgBindingManager; 18 | 19 | /** 20 | * The activator class controls the plug-in life cycle 21 | */ 22 | public class AngularCorePlugin extends Plugin { 23 | 24 | public static final String PLUGIN_ID = "ts.eclipse.ide.angular.core"; //$NON-NLS-1$ 25 | 26 | // The shared instance. 27 | private static AngularCorePlugin plugin; 28 | 29 | /** 30 | * The constructor. 31 | */ 32 | public AngularCorePlugin() { 33 | super(); 34 | plugin = this; 35 | } 36 | 37 | @Override 38 | public void start(BundleContext context) throws Exception { 39 | super.start(context); 40 | } 41 | 42 | /** 43 | * Returns the shared instance 44 | * 45 | * @return the shared instance 46 | */ 47 | public static AngularCorePlugin getDefault() { 48 | return plugin; 49 | } 50 | 51 | public static INgBindingManager getBindingManager() { 52 | return NgBindingManager.INSTANCE; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/AngularProject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core; 12 | 13 | import org.eclipse.core.resources.IProject; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.core.runtime.IStatus; 16 | import org.eclipse.core.runtime.Status; 17 | 18 | import ts.client.ISupportable; 19 | import ts.eclipse.ide.core.resources.IIDETypeScriptProject; 20 | import ts.eclipse.ide.core.utils.TypeScriptResourceUtil; 21 | import ts.utils.VersionHelper; 22 | 23 | /** 24 | * Angular project. 25 | * 26 | */ 27 | public class AngularProject { 28 | 29 | private static final String ANGULAR_PROJECT = AngularProject.class.getName(); 30 | 31 | private static final ISupportable ANGULAR_LANGUAGE_SERVICE_CAPABILITY = new ISupportable() { 32 | 33 | @Override 34 | public boolean canSupport(String version) { 35 | return VersionHelper.canSupport(version, "2.4.0"); 36 | } 37 | }; 38 | 39 | private final AngularProjectSettings settings; 40 | 41 | AngularProject(IIDETypeScriptProject tsProject) { 42 | tsProject.setData(ANGULAR_PROJECT, this); 43 | this.settings = new AngularProjectSettings(tsProject.getProject()); 44 | } 45 | 46 | public static boolean isAngularProject(IProject project) { 47 | if (!TypeScriptResourceUtil.isTypeScriptProject(project)) { 48 | return false; 49 | } 50 | return true; 51 | } 52 | 53 | public static AngularProject getAngularProject(IProject project) throws CoreException { 54 | if (!isAngularProject(project)) { 55 | throw new CoreException(new Status(IStatus.ERROR, AngularCorePlugin.PLUGIN_ID, 56 | "The project " + project.getName() + " is not an angular project.")); 57 | } 58 | IIDETypeScriptProject tsProject = TypeScriptResourceUtil.getTypeScriptProject(project); 59 | AngularProject angularProject = tsProject.getData(ANGULAR_PROJECT); 60 | if (angularProject == null) { 61 | angularProject = new AngularProject(tsProject); 62 | } 63 | return angularProject; 64 | } 65 | 66 | public AngularProjectSettings getSettings() { 67 | return settings; 68 | } 69 | 70 | public static boolean canSupportAngularLanguageService(IProject project) { 71 | if (isAngularProject(project)) { 72 | try { 73 | IIDETypeScriptProject tsProject = TypeScriptResourceUtil.getTypeScriptProject(project); 74 | return tsProject.canSupport(ANGULAR_LANGUAGE_SERVICE_CAPABILITY); 75 | } catch (CoreException e) { 76 | return false; 77 | } 78 | } 79 | return false; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/AngularProjectSettings.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core; 2 | 3 | import org.eclipse.core.resources.IProject; 4 | import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; 5 | 6 | import ts.eclipse.ide.core.resources.AbstractTypeScriptSettings; 7 | 8 | public class AngularProjectSettings extends AbstractTypeScriptSettings { 9 | 10 | public static final String DEFAULT_START_SYMBOL = "{{"; 11 | public static final String DEFAULT_END_SYMBOL = "}}"; 12 | 13 | public AngularProjectSettings(IProject project) { 14 | super(project, AngularCorePlugin.PLUGIN_ID); 15 | } 16 | 17 | @Override 18 | public void preferenceChange(PreferenceChangeEvent event) { 19 | 20 | } 21 | 22 | public String getStartSymbol() { 23 | return DEFAULT_START_SYMBOL; 24 | } 25 | 26 | public String getEndSymbol() { 27 | return DEFAULT_END_SYMBOL; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/html/AbstractNgBindingCollector.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core.html; 2 | 3 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; 4 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 5 | import org.w3c.dom.Attr; 6 | 7 | public abstract class AbstractNgBindingCollector implements INgBindingCollector { 8 | 9 | private final IDOMElement element; 10 | private final IDOMAttr attr; 11 | private final boolean fullMatch; 12 | 13 | public AbstractNgBindingCollector(IDOMElement element, IDOMAttr attr, boolean fullMatch) { 14 | this.element = element; 15 | this.attr = attr; 16 | this.fullMatch = fullMatch; 17 | } 18 | 19 | @Override 20 | public final void collect(String matchingString, String name, String description, INgBindingType bindingType) { 21 | if (isMatch(name, matchingString) && isDontExists(element, name, bindingType)) { 22 | doCollect(name, getDescription(name, description, bindingType), bindingType); 23 | } 24 | } 25 | 26 | private String getDescription(String name, String description, INgBindingType bindingType) { 27 | if (description != null) { 28 | return description; 29 | } 30 | return bindingType.formatAttr(name); 31 | } 32 | 33 | protected boolean isDontExists(IDOMElement element, String name, INgBindingType bindingType) { 34 | Attr existingAttr = element.getAttributeNode(bindingType.formatAttr(name)); 35 | if (existingAttr == null) { 36 | return true; 37 | } 38 | return existingAttr.equals(attr); 39 | } 40 | 41 | protected abstract void doCollect(String name, String description, INgBindingType bindingType); 42 | 43 | protected boolean isMatch(String name, String matchingString) { 44 | if (fullMatch) { 45 | return matchingString.equals(name); 46 | } 47 | return name.startsWith(matchingString); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/html/INgBindingCollector.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core.html; 2 | 3 | public interface INgBindingCollector { 4 | 5 | void collect(String matchingString, String name, String description, INgBindingType bindingType); 6 | } 7 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/html/INgBindingManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core.html; 12 | 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.wst.sse.core.internal.validate.ValidationMessage; 15 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 16 | 17 | public interface INgBindingManager { 18 | 19 | /** 20 | * Returns the ng binding type for the given attribute name and null 21 | * otherwise. 22 | * 23 | * @param attrName 24 | * @return the ng binding type for the given attribute name and null 25 | * otherwise. 26 | */ 27 | INgBindingType getType(String attrName); 28 | 29 | boolean isNgBindingType(String attrName); 30 | 31 | ValidationMessage validate(IDOMElement target, String attrName, IFile file); 32 | 33 | void collect(IDOMElement target, String attrName, IFile file, INgBindingCollector collector);; 34 | } 35 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/html/INgBindingType.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core.html; 2 | 3 | import org.eclipse.core.resources.IFile; 4 | import org.eclipse.wst.sse.core.internal.validate.ValidationMessage; 5 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 6 | 7 | public interface INgBindingType { 8 | 9 | String formatAttr(String name); 10 | 11 | boolean match(String attrName); 12 | 13 | ValidationMessage validate(IDOMElement target, String attrName, IFile file); 14 | 15 | void collect(IDOMElement target, String attrName, boolean fullMatch, IFile file, INgBindingCollector collector); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/html/NgBindingTypeException.java: -------------------------------------------------------------------------------- 1 | package ts.eclipse.ide.angular.core.html; 2 | 3 | import ts.TypeScriptException; 4 | 5 | public class NgBindingTypeException extends TypeScriptException { 6 | 7 | private final int severity; 8 | 9 | public NgBindingTypeException(String message, int severity) { 10 | super(message); 11 | this.severity = severity; 12 | } 13 | 14 | public int getSeverity() { 15 | return severity; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/template/AngularContext.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core.template; 12 | 13 | import org.eclipse.jface.text.IDocument; 14 | import org.eclipse.jface.text.Position; 15 | import org.eclipse.jface.text.templates.TemplateContextType; 16 | 17 | import ts.eclipse.ide.jsdt.core.template.AbstractTypeScriptContext; 18 | 19 | /** 20 | * Angular template context. 21 | * 22 | */ 23 | public class AngularContext extends AbstractTypeScriptContext { 24 | 25 | public AngularContext(TemplateContextType type, IDocument document, int offset, int length) { 26 | super(type, document, offset, length); 27 | } 28 | 29 | public AngularContext(TemplateContextType type, IDocument document, Position position) { 30 | super(type, document, position); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/template/AngularContextType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core.template; 12 | 13 | import org.eclipse.jface.text.IDocument; 14 | import org.eclipse.jface.text.Position; 15 | 16 | import ts.eclipse.ide.jsdt.core.template.AbstractTypeScriptContextType; 17 | 18 | /** 19 | * Angular template context type. 20 | * 21 | */ 22 | public class AngularContextType extends AbstractTypeScriptContextType { 23 | 24 | public static final String NAME = "Angular"; //$NON-NLS-1$ 25 | 26 | public AngularContextType() { 27 | super(NAME); 28 | } 29 | 30 | @Override 31 | public AngularContext createContext(IDocument document, Position position) { 32 | return new AngularContext(this, document, position); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/core/utils/AngularDOMUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.core.utils; 12 | 13 | import org.eclipse.core.resources.IProject; 14 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; 15 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 16 | 17 | /** 18 | * Angular DOM utilities. 19 | * 20 | */ 21 | public class AngularDOMUtils { 22 | 23 | public static Object getAngularDirective(IProject project, IDOMElement node) { 24 | // TODO Auto-generated method stub 25 | return null; 26 | } 27 | 28 | public static Object getAngularDirective(IProject project, IDOMAttr node) { 29 | // TODO Auto-generated method stub 30 | return null; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/internal/core/AngularCoreMessages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 Angelo ZERR. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Angelo Zerr - initial API and implementation 10 | */ 11 | package ts.eclipse.ide.angular.internal.core; 12 | 13 | import java.util.MissingResourceException; 14 | import java.util.ResourceBundle; 15 | 16 | import org.eclipse.osgi.util.NLS; 17 | 18 | /** 19 | * Angular Core messages. 20 | * 21 | */ 22 | public class AngularCoreMessages extends NLS { 23 | 24 | private static final String BUNDLE_NAME = "ts.eclipse.ide.angular.internal.core.AngularCoreMessages"; //$NON-NLS-1$ 25 | 26 | private static ResourceBundle fResourceBundle; 27 | 28 | // HTML Angular Bindings errors 29 | public static String AttributeBindingSyntax_error; 30 | public static String UndefinedPropertyBinding_error; 31 | public static String UndefinedEventBinding_error; 32 | public static String UndefinedKeyEventBinding_error; 33 | public static String UndefinedPropertyAndEventBinding_error; 34 | public static String LetOnlySupportedOnTemplateElements_error; 35 | public static String VarDontAllow_error; 36 | public static String VarDeprecatedOnTemplate_error; 37 | public static String VarDeprecatedOnNonTemplate_error; 38 | public static String RefDontAllow_error; 39 | 40 | public static ResourceBundle getResourceBundle() { 41 | try { 42 | if (fResourceBundle == null) 43 | fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); 44 | } catch (MissingResourceException x) { 45 | fResourceBundle = null; 46 | } 47 | return fResourceBundle; 48 | } 49 | 50 | static { 51 | NLS.initializeMessages(BUNDLE_NAME, AngularCoreMessages.class); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ts.eclipse.ide.angular.core/src/ts/eclipse/ide/angular/internal/core/AngularCoreMessages.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2015-2016 Angelo Zerr and others. 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Angelo Zerr - Initial API and implementation 10 | ############################################################################### 11 | 12 | AttributeBindingSyntax_error=Binding syntax error: the attribute ''{0}'' must be closed with ''{1}''. 13 | UndefinedPropertyBinding_error=Undefined ng property binding ''{0}''. 14 | UndefinedEventBinding_error=Undefined ng event binding ''{0}''. 15 | UndefinedKeyEventBinding_error=Undefined key event part ''{0}''. 16 | UndefinedPropertyAndEventBinding_error=Undefined ng property/event binding ''{0}''. 17 | LetOnlySupportedOnTemplateElements_error="let-" is only supported on template elements. 18 | VarDontAllow_error="-" is not allowed in variable names 19 | VarDeprecatedOnTemplate_error="var-" on