├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── angularjs-eclipse-feature ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.m2e.core.prefs ├── build.properties ├── epl-v10.html ├── feature.properties ├── feature.xml ├── license.html ├── pom.xml └── sourceTemplateFeature │ └── .gitkeep ├── angularjs-eclipse-jsp-feature ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.m2e.core.prefs ├── build.properties ├── epl-v10.html ├── feature.properties ├── feature.xml ├── license.html ├── pom.xml └── sourceTemplateFeature │ └── .gitkeep ├── angularjs-eclipse-php-feature ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.m2e.core.prefs ├── build.properties ├── epl-v10.html ├── feature.properties ├── feature.xml ├── license.html ├── pom.xml └── sourceTemplateFeature │ └── .gitkeep ├── license.txt ├── org.eclipse.angularjs.core.tests ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.pde.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ └── core │ └── utils │ └── AngularRegionUtilsTest.java ├── org.eclipse.angularjs.core ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ ├── core │ ├── AngularCoreConstants.java │ ├── AngularCorePlugin.java │ ├── AngularCorePreferencesSupport.java │ ├── AngularElement.java │ ├── AngularProject.java │ ├── BaseModel.java │ ├── CustomAngularModulesRegistry.java │ ├── IDefinitionAware.java │ ├── Module.java │ ├── ModulesFolder.java │ ├── ScriptsFolder.java │ ├── launchConfigurations │ │ └── IProtractorLaunchConfigurationConstants.java │ ├── link │ │ ├── AngularLink.java │ │ ├── AngularLinkHelper.java │ │ └── AngularLinkResource.java │ └── utils │ │ ├── AngularDOMUtils.java │ │ ├── AngularELRegion.java │ │ ├── AngularRegionUtils.java │ │ ├── AngularScopeHelper.java │ │ ├── DOMUtils.java │ │ └── HyperlinkUtils.java │ └── internal │ └── core │ ├── AngularCoreMessages.java │ ├── AngularCoreMessages.properties │ ├── Logger.java │ ├── Trace.java │ ├── launchConfigurations │ ├── ProtractorLaunchConfigurationDelegate.java │ └── ProtractorLauncher.java │ ├── preferences │ ├── AngularCorePreferenceConstants.java │ └── AngularCorePreferenceInitializer.java │ └── validation │ ├── AbstractHTMLAngularValidator.java │ ├── HTMLAngularAttributeValidator.java │ └── HTMLAngularTagValidator.java ├── org.eclipse.angularjs.jsp.core ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ └── jsp │ └── internal │ └── core │ ├── AngularJSPCorePlugin.java │ └── Trace.java ├── org.eclipse.angularjs.jsp.ui ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ └── jsp │ └── internal │ └── ui │ ├── AngularJSPUIPlugin.java │ └── Trace.java ├── org.eclipse.angularjs.php.core ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ └── php │ └── internal │ └── core │ ├── AngularPHPCorePlugin.java │ └── Trace.java ├── org.eclipse.angularjs.php.ui ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ └── php │ └── internal │ └── ui │ ├── AngularPHPUIPlugin.java │ └── Trace.java ├── org.eclipse.angularjs.repository ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── angularjs-eclipse.p2f ├── category.xml └── pom.xml ├── org.eclipse.angularjs.ui ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .gitignore │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── css │ └── dark │ │ └── preferencestyle.css ├── icons │ └── full │ │ ├── elcl16 │ │ ├── goto_def.gif │ │ ├── link_to_ctrl.gif │ │ ├── refresh.gif │ │ └── unlink_to_ctrl.gif │ │ ├── eview16 │ │ └── explorer.png │ │ └── obj16 │ │ ├── angularjs.png │ │ ├── angularjs_checked.png │ │ ├── controller.png │ │ ├── controller_checked.png │ │ ├── directive.png │ │ ├── directive_param.png │ │ ├── factory.png │ │ ├── filter.png │ │ ├── folder.gif │ │ ├── property.png │ │ ├── protractor.png │ │ ├── provider.png │ │ ├── routeProvider.gif │ │ ├── routeProvider_when.gif │ │ └── service.png ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── org │ └── eclipse │ └── angularjs │ ├── internal │ └── ui │ │ ├── AngularELWordFinder.java │ │ ├── AngularNatureTester.java │ │ ├── AngularUIMessages.java │ │ ├── AngularUIMessages.properties │ │ ├── AngularUIPlugin.java │ │ ├── AngularUIStartup.java │ │ ├── ImageResource.java │ │ ├── Trace.java │ │ ├── actions │ │ └── OpenAngularElementAction.java │ │ ├── autoedit │ │ └── StructuredAutoEditStrategyAngular.java │ │ ├── contentassist │ │ ├── AngularMarkupCompletionProposal.java │ │ ├── HTMLAngularCompletionProposal.java │ │ ├── JSAngularCompletionProposal.java │ │ └── MarkupAngularCompletionProposal.java │ │ ├── dialogs │ │ ├── FilteredAngularElementsSelectionDialog.java │ │ └── OpenAngularElementSelectionDialog.java │ │ ├── handlers │ │ └── ConvertProjectToAngularCommandHandler.java │ │ ├── hyperlink │ │ ├── HTMLAngularHyperLink.java │ │ └── HTMLAngularHyperLinkDetector.java │ │ ├── launchConfigurations │ │ ├── MainTab.java │ │ ├── ProtractorLaunchShortcut.java │ │ ├── ProtractorLaunchTabGroup.java │ │ └── ProtractorTab.java │ │ ├── outline │ │ └── AngularContentOutlineConfiguration.java │ │ ├── preferences │ │ ├── AngularGlobalPreferencesPage.java │ │ ├── AngularUIPreferenceInitializer.java │ │ ├── AngularUIPreferenceNames.java │ │ ├── PreferenceConstants.java │ │ ├── html │ │ │ ├── HTMLAngularEditorPreferencesPage.java │ │ │ ├── HTMLAngularEditorSyntaxColoringPreferencePage.java │ │ │ ├── HTMLAngularGlobalPreferencesPage.java │ │ │ └── HTMLAngularTypingPreferencePage.java │ │ └── protractor │ │ │ └── ProtractorPreferencesPage.java │ │ ├── properties │ │ ├── AbstractAngularFieldEditorPropertyPage.java │ │ ├── AngularMainPropertyPage.java │ │ ├── DirectivesPropertyPage.java │ │ └── ExpressionPropertyPage.java │ │ ├── style │ │ ├── IStyleConstantsForAngular.java │ │ └── SemanticHighlightingManager.java │ │ ├── taginfo │ │ ├── HTMLAngularTagInfoHoverProcessor.java │ │ └── HTMLAngularTernTypeCollector.java │ │ ├── utils │ │ ├── DOMUIUtils.java │ │ └── HTMLAngularPrinter.java │ │ ├── viewers │ │ ├── AngularElementLabelProvider.java │ │ ├── AngularExplorerContentProvider.java │ │ ├── AngularExplorerLabelProvider.java │ │ ├── AngularOutlineLabelProvider.java │ │ └── AngularOutlineLabelProviderOLD.java │ │ └── views │ │ ├── AngularContentOutlinePage.java │ │ ├── AngularExplorerView.java │ │ ├── AngularExplorerViewOLD.java │ │ ├── actions │ │ ├── LexicalSortingAction.java │ │ ├── LinkToControllerAction.java │ │ ├── RefreshExplorerAction.java │ │ └── UnLinkToControllerAction.java │ │ └── actionsOLD │ │ ├── GoToDefinitionAction.java │ │ ├── LexicalSortingAction.java │ │ ├── LinkToControllerAction.java │ │ ├── RefreshExplorerAction.java │ │ └── UnLinkToControllerAction.java │ └── ui │ ├── contentassist │ └── HTMLAngularTagsCompletionProposalComputer.java │ └── style │ ├── AbstractAngularExpressionSemanticHighlighting.java │ ├── AbstractAngularSemanticHighlighting.java │ ├── AngularExpressionBorderSemanticHighlighting.java │ ├── AngularExpressionSemanticHighlighting.java │ ├── DirectiveParameterSemanticHighlighting.java │ └── DirectiveSemanticHighlighting.java ├── pom.xml ├── pushToBintray.sh └── samples ├── AngularJS-Directive-Controllers ├── .project ├── .tern-project ├── app │ ├── controllers │ │ ├── master-controller.js │ │ └── slave-controller.js │ ├── directives │ │ ├── master.js │ │ └── slave.js │ └── main.js └── index.htm ├── ToDoMVC ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ └── org.eclipse.wst.jsdt.ui.superType.name ├── .tern-project └── WebContent │ ├── todo-require │ ├── bower.json │ ├── bower_components │ │ ├── angular │ │ │ └── angular.js │ │ ├── requirejs │ │ │ └── require.js │ │ └── todomvc-common │ │ │ ├── base.css │ │ │ ├── base.js │ │ │ └── bg.png │ ├── index.html │ └── js │ │ ├── app.js │ │ ├── controllers │ │ └── todo.js │ │ ├── directives │ │ └── todoFocus.js │ │ ├── main.js │ │ └── services │ │ └── todoStorage.js │ └── todo │ ├── bower.json │ ├── bower_components │ ├── angular-route │ │ └── angular-route.js │ ├── angular │ │ └── angular.js │ └── todomvc-common │ │ ├── base.css │ │ ├── base.js │ │ └── bg.png │ ├── index.html │ ├── js │ ├── app.js │ ├── controllers │ │ └── todoCtrl.js │ ├── directives │ │ ├── todoEscape.js │ │ └── todoFocus.js │ └── services │ │ └── todoStorage.js │ └── test │ ├── config │ └── karma.conf.js │ ├── package.json │ ├── readme.md │ └── unit │ ├── directivesSpec.js │ └── todoCtrlSpec.js ├── angular-bootstrap ├── .project ├── .tern-project ├── app.js └── index.html ├── angularjs-controller-tutorial ├── .project ├── .tern-project └── contact.html ├── basic ├── .project ├── .tern-project ├── boolean.html └── string.html ├── custom-directive ├── .project ├── .tern-project ├── directive-with-parameters.html ├── directive-with-parameters.html.jsp ├── index.html └── script.js ├── store ├── .project ├── .settings │ └── org.eclipse.wst.validation.prefs ├── .tern-project └── app │ ├── app.js │ ├── css │ └── bootstrap.min.css │ ├── index.html │ └── js │ └── angular.1.2.21.min.js ├── todos-controllerAs ├── .project ├── .settings │ └── tern.eclipse.ide.core.prefs ├── .tern-project ├── index.html ├── todo.css └── todo.js ├── todos-interpolateProvider ├── .project ├── .settings │ ├── org.eclipse.angularjs.core.prefs │ ├── org.eclipse.wst.validation.prefs │ └── tern.eclipse.ide.core.prefs ├── .tern-port ├── .tern-project ├── index.html ├── index.html.jsp ├── todo.css └── todo.js ├── todos-requirejs ├── .project ├── .settings │ └── tern.eclipse.ide.core.prefs ├── .tern-project ├── WebContent │ ├── bower.json │ ├── bower_components │ │ ├── angular │ │ │ └── angular.js │ │ ├── requirejs │ │ │ └── require.js │ │ └── todomvc-common │ │ │ ├── base.css │ │ │ ├── base.js │ │ │ └── bg.png │ ├── index.html │ └── js │ │ ├── app.js │ │ ├── controllers │ │ └── todo.js │ │ ├── directives │ │ └── todoFocus.js │ │ ├── main.js │ │ └── services │ │ └── todoStorage.js └── angular-mock.js └── todos ├── .project ├── .settings └── tern.eclipse.ide.core.prefs ├── .tern-project ├── index.html ├── todo.css └── todo.js /.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.settings 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | 5 | install: echo "I trust Maven." 6 | 7 | # don't just run the tests, also run Findbugs and friends 8 | script: mvn verify 9 | 10 | notifications: 11 | email: 12 | recipients: 13 | - angelo.zerr@gmail.com -------------------------------------------------------------------------------- /angularjs-eclipse-feature/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | angularjs-eclipse-feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.pde.FeatureNature 22 | 23 | 24 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = epl-v10.html,\ 2 | feature.properties,\ 3 | feature.xml,\ 4 | license.html -------------------------------------------------------------------------------- /angularjs-eclipse-feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | %description 12 | 13 | 14 | 15 | %copyright 16 | 17 | 18 | 19 | %license 20 | 21 | 22 | 28 | 29 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | fr.opensagres.angularjs 5 | angularjs-eclipse 6 | 1.3.0-SNAPSHOT 7 | 8 | angularjs-eclipse-feature 9 | eclipse-feature 10 | -------------------------------------------------------------------------------- /angularjs-eclipse-feature/sourceTemplateFeature/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/angularjs-eclipse-feature/sourceTemplateFeature/.gitkeep -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | angularjs-eclipse-jsp-feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.pde.FeatureNature 22 | 23 | 24 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = epl-v10.html,\ 2 | feature.properties,\ 3 | feature.xml,\ 4 | license.html -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | %description 12 | 13 | 14 | 15 | %copyright 16 | 17 | 18 | 19 | %license 20 | 21 | 22 | 28 | 29 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | fr.opensagres.angularjs 5 | angularjs-eclipse 6 | 1.3.0-SNAPSHOT 7 | 8 | angularjs-eclipse-jsp-feature 9 | eclipse-feature 10 | -------------------------------------------------------------------------------- /angularjs-eclipse-jsp-feature/sourceTemplateFeature/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/angularjs-eclipse-jsp-feature/sourceTemplateFeature/.gitkeep -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | angularjs-eclipse-php-feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.pde.FeatureNature 22 | 23 | 24 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = epl-v10.html,\ 2 | feature.properties,\ 3 | feature.xml,\ 4 | license.html -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | %description 12 | 13 | 14 | 15 | %copyright 16 | 17 | 18 | 19 | %license 20 | 21 | 22 | 28 | 29 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | fr.opensagres.angularjs 5 | angularjs-eclipse 6 | 1.3.0-SNAPSHOT 7 | 8 | angularjs-eclipse-php-feature 9 | eclipse-feature 10 | -------------------------------------------------------------------------------- /angularjs-eclipse-php-feature/sourceTemplateFeature/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/angularjs-eclipse-php-feature/sourceTemplateFeature/.gitkeep -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=false 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Tests 4 | Bundle-SymbolicName: org.eclipse.angularjs.core.tests 5 | Bundle-Version: 1.3.0.qualifier 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 7 | Require-Bundle: org.junit;bundle-version="4.11.0", 8 | org.eclipse.angularjs.core, 9 | org.eclipse.wst.xml.core, 10 | org.eclipse.wst.sse.core, 11 | org.eclipse.core.resources 12 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.core.tests 4 | eclipse-test-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core.tests/src/org/eclipse/angularjs/core/utils/AngularRegionUtilsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core.utils; 12 | 13 | import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; 14 | import org.junit.Assert; 15 | import org.junit.Test; 16 | 17 | public class AngularRegionUtilsTest { 18 | 19 | @Test 20 | public void offsetBeforeStartEL() { 21 | AngularELRegion region = AngularRegionUtils.getAngularELRegion( 22 | DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 588, 23 | "{{", "}}"); 24 | Assert.assertNull(region); 25 | } 26 | 27 | @Test 28 | public void offsetAfterStartEL() { 29 | AngularELRegion region = AngularRegionUtils.getAngularELRegion( 30 | DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 590, 31 | "{{", "}}"); 32 | Assert.assertNotNull(region); 33 | Assert.assertEquals("todo.text + to", region.getExpression()); 34 | Assert.assertEquals(0, region.getExpressionOffset()); 35 | } 36 | 37 | @Test 38 | public void offsetBeforeEndEL() { 39 | AngularELRegion region = AngularRegionUtils.getAngularELRegion( 40 | DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 603, 41 | "{{", "}}"); 42 | Assert.assertNotNull(region); 43 | Assert.assertEquals("todo.text + to", region.getExpression()); 44 | Assert.assertEquals(13, region.getExpressionOffset()); 45 | } 46 | 47 | @Test 48 | public void offsetAfterEndEL() { 49 | AngularELRegion region = AngularRegionUtils.getAngularELRegion( 50 | DOMRegionContext.XML_CONTENT, "{{todo.text + to}}", 588, 604, 51 | "{{", "}}"); 52 | Assert.assertNotNull(region); 53 | Assert.assertEquals("todo.text + to", region.getExpression()); 54 | Assert.assertEquals(14, region.getExpressionOffset()); 55 | } 56 | 57 | @Test 58 | public void test2() { 59 | AngularELRegion region = AngularRegionUtils.getAngularELRegion( 60 | DOMRegionContext.XML_CONTENT, "{{", 588, 604, "{{", "}}"); 61 | Assert.assertNull(region); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.core;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Require-Bundle: org.eclipse.core.runtime, 9 | org.eclipse.wst.sse.core, 10 | org.eclipse.core.filebuffers, 11 | org.eclipse.wst.html.core;bundle-version="1.2.0", 12 | org.eclipse.wst.xml.core, 13 | org.eclipse.core.resources, 14 | org.eclipse.wst.common.uriresolver, 15 | tern.core, 16 | tern.eclipse, 17 | tern.server.nodejs, 18 | tern.eclipse.ide.core, 19 | org.eclipse.wst.validation, 20 | org.eclipse.core.filesystem, 21 | tern.eclipse.ide.server.nodejs.core, 22 | org.eclipse.debug.core, 23 | org.eclipse.core.externaltools 24 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 25 | Bundle-ActivationPolicy: lazy 26 | Bundle-Activator: org.eclipse.angularjs.core.AngularCorePlugin 27 | Export-Package: org.eclipse.angularjs.core, 28 | org.eclipse.angularjs.core.launchConfigurations, 29 | org.eclipse.angularjs.core.link, 30 | org.eclipse.angularjs.core.utils 31 | Import-Package: com.eclipsesource.json;version="[0.9.4,0.9.5)" 32 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties 7 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS Core 13 | 14 | angularNature=AngularJS Nature 15 | angularContentType=AngularJS Source File 16 | 17 | HTMLAngularValidator.name=HTML Angular Syntax Validator 18 | 19 | # Protractor 20 | ProtractorLaunchConfigurationDelegate.name=Protractor -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | 18 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.core 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/AngularCoreConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | /** 14 | * AngularJS constants. 15 | * 16 | */ 17 | public class AngularCoreConstants { 18 | 19 | /** 20 | * Preferences constants for AngularJS directives. 21 | */ 22 | public static final String DIRECTIVE_USE_ORIGINAL_NAME = "directiveUseOriginalName"; //$NON-NLS-1$ 23 | public static String DIRECTIVE_STARTS_WITH_NOTHING = "directiveStartsWithNothing"; //$NON-NLS-1$ 24 | public static String DIRECTIVE_STARTS_WITH_DATA = "directiveStartsWithData"; //$NON-NLS-1$ 25 | public static String DIRECTIVE_STARTS_WITH_X = "directiveStartsWithX"; //$NON-NLS-1$ 26 | public static String DIRECTIVE_COLON_DELIMITER = "directiveColonDelimiter"; //$NON-NLS-1$ 27 | public static final String DIRECTIVE_MINUS_DELIMITER = "directiveMinusDelimiter"; //$NON-NLS-1$ 28 | public static final String DIRECTIVE_UNDERSCORE_DELIMITER = "directiveUnderscoreDelimiter"; //$NON-NLS-1$ 29 | public static final String EXPRESSION_START_SYMBOL = "startSymbol"; //$NON-NLS-1$ 30 | public static final String EXPRESSION_END_SYMBOL = "endSymbol"; //$NON-NLS-1$ 31 | 32 | /** 33 | * Protactor 34 | */ 35 | public static final String PROTRACTOR_DEFAULT_CLI_FILE = "protractorDefaultCliFile"; //$NON-NLS-1$ 36 | public static final String PROTRACTOR_NODEJS_DEBUGGER = "protractorNodeJSDebugger"; //$NON-NLS-1$ 37 | public static final String PROTRACTOR_NODEJS_INSTALL = "protractorNodeJSInstall"; //$NON-NLS-1$ 38 | public static final String PROTRACTOR_NODEJS_PATH = "protractorNodeJSPath"; //$NON-NLS-1$ 39 | } 40 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/AngularCorePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import org.eclipse.core.runtime.Plugin; 14 | import org.osgi.framework.BundleContext; 15 | 16 | /** 17 | * Angular Core Plugin. 18 | * 19 | */ 20 | public class AngularCorePlugin extends Plugin { 21 | 22 | public static final String PLUGIN_ID = "org.eclipse.angularjs.core"; //$NON-NLS-1$ 23 | 24 | // The shared instance. 25 | private static AngularCorePlugin plugin; 26 | 27 | /** 28 | * The constructor. 29 | */ 30 | public AngularCorePlugin() { 31 | super(); 32 | plugin = this; 33 | } 34 | 35 | @Override 36 | public void start(BundleContext context) throws Exception { 37 | super.start(context); 38 | } 39 | 40 | @Override 41 | public void stop(BundleContext context) throws Exception { 42 | plugin = null; 43 | super.stop(context); 44 | } 45 | 46 | /** 47 | * Returns the shared instance 48 | * 49 | * @return the shared instance 50 | */ 51 | public static AngularCorePlugin getDefault() { 52 | return plugin; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/AngularElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import tern.angular.AngularType; 14 | import tern.angular.protocol.definition.TernAngularDefinitionQuery; 15 | import tern.server.protocol.definition.ITernDefinitionCollector; 16 | 17 | public class AngularElement extends BaseModel implements IDefinitionAware { 18 | 19 | private final AngularType angularType; 20 | private final Module module; 21 | 22 | public AngularElement(String name, AngularType angularType, Module module) { 23 | super(name, Type.AngularElement, module.getScriptPath()); 24 | this.angularType = angularType; 25 | this.module = module; 26 | } 27 | 28 | public Module getModule() { 29 | return module; 30 | } 31 | 32 | @Override 33 | public void findDefinition(ITernDefinitionCollector collector) { 34 | // Find definition of the angular element 35 | TernAngularDefinitionQuery query = new TernAngularDefinitionQuery( 36 | angularType); 37 | query.getScope().setModule(getModule().getName()); 38 | query.setExpression(super.getName()); 39 | super.execute(query, collector); 40 | } 41 | 42 | public AngularType getAngularType() { 43 | return angularType; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/BaseModel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import org.eclipse.core.runtime.CoreException; 14 | 15 | import tern.ITernProject; 16 | import tern.angular.protocol.completions.TernAngularCompletionsQuery; 17 | import tern.angular.protocol.definition.TernAngularDefinitionQuery; 18 | import tern.eclipse.ide.core.IIDETernProject; 19 | import tern.scriptpath.ITernScriptPath; 20 | import tern.server.protocol.completions.ITernCompletionCollector; 21 | import tern.server.protocol.definition.ITernDefinitionCollector; 22 | 23 | public class BaseModel { 24 | 25 | public enum Type { 26 | ScriptsFolder, ModulesFolder, Module, AngularElement 27 | } 28 | 29 | private final String name; 30 | private final Type type; 31 | private final ITernScriptPath scriptPath; 32 | 33 | public BaseModel(String name, Type type, ITernScriptPath scriptPath) { 34 | this.type = type; 35 | this.name = name; 36 | this.scriptPath = scriptPath; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public Type getType() { 44 | return type; 45 | } 46 | 47 | public ITernScriptPath getScriptPath() { 48 | return scriptPath; 49 | } 50 | 51 | protected IIDETernProject getTernProject() throws CoreException { 52 | return (IIDETernProject) getProject(); 53 | } 54 | 55 | public ITernProject getProject() { 56 | return scriptPath.getOwnerProject(); 57 | } 58 | 59 | protected void execute(TernAngularCompletionsQuery query, 60 | ITernCompletionCollector collector) { 61 | try { 62 | IIDETernProject ternProject = getTernProject(); 63 | ternProject.request(query, null, scriptPath, null, null, collector); 64 | } catch (Exception e) { 65 | e.printStackTrace(); 66 | } 67 | } 68 | 69 | protected void execute(TernAngularDefinitionQuery query, 70 | ITernDefinitionCollector collector) { 71 | try { 72 | IIDETernProject ternProject = getTernProject(); 73 | ternProject.request(query, null, scriptPath, null, null, collector); 74 | } catch (Exception e) { 75 | e.printStackTrace(); 76 | } 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/IDefinitionAware.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import tern.server.protocol.definition.ITernDefinitionCollector; 14 | 15 | public interface IDefinitionAware { 16 | 17 | void findDefinition(ITernDefinitionCollector collector); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/ModulesFolder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | import tern.angular.AngularType; 17 | import tern.angular.protocol.completions.TernAngularCompletionsQuery; 18 | import tern.scriptpath.ITernScriptPath; 19 | import tern.server.ITernServer; 20 | import tern.server.protocol.IJSONObjectHelper; 21 | import tern.server.protocol.completions.ITernCompletionCollector; 22 | import tern.server.protocol.completions.TernCompletionProposalRec; 23 | 24 | public class ModulesFolder extends BaseModel implements 25 | ITernCompletionCollector { 26 | 27 | private List modules; 28 | 29 | public ModulesFolder(ITernScriptPath scriptPath) { 30 | super("modules", Type.ModulesFolder, scriptPath); 31 | } 32 | 33 | public Object[] getModules() { 34 | if (modules == null) { 35 | modules = new ArrayList(); 36 | // load all modules 37 | TernAngularCompletionsQuery query = new TernAngularCompletionsQuery( 38 | AngularType.module); 39 | query.setExpression(""); 40 | super.execute(query, this); 41 | } 42 | return modules.toArray(); 43 | } 44 | 45 | @Override 46 | public void addProposal(TernCompletionProposalRec proposal, 47 | Object completion, IJSONObjectHelper jsonObjectHelper) { 48 | modules.add(new Module(proposal.name, getScriptPath())); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/ScriptsFolder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core; 12 | 13 | import tern.scriptpath.ITernScriptPath; 14 | 15 | public class ScriptsFolder extends BaseModel { 16 | 17 | public ScriptsFolder(ITernScriptPath scriptPath) { 18 | super("scripts", Type.ScriptsFolder, scriptPath); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/launchConfigurations/IProtractorLaunchConfigurationConstants.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 org.eclipse.angularjs.core.launchConfigurations; 12 | 13 | /** 14 | * Constants for Protractor launch. 15 | * 16 | */ 17 | public interface IProtractorLaunchConfigurationConstants { 18 | 19 | String ID_PROTRACTOR_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.angularjs.core.protractor"; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/link/AngularLink.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core.link; 12 | 13 | public class AngularLink { 14 | 15 | private final String elementId; 16 | private final String module; 17 | private final String controller; 18 | 19 | public AngularLink(String elementId, String module, String controller) { 20 | this.elementId = elementId; 21 | this.module = module; 22 | this.controller = controller; 23 | } 24 | 25 | public String getElementId() { 26 | return elementId; 27 | } 28 | 29 | public String getModule() { 30 | return module; 31 | } 32 | 33 | public String getController() { 34 | return controller; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/utils/AngularELRegion.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core.utils; 12 | 13 | public class AngularELRegion { 14 | 15 | private final String expression; 16 | private final int expressionOffset; 17 | 18 | public AngularELRegion(String expression, int expressionOffset) { 19 | this.expression = expression; 20 | this.expressionOffset = expressionOffset; 21 | } 22 | 23 | public String getExpression() { 24 | return expression; 25 | } 26 | 27 | public int getExpressionOffset() { 28 | return expressionOffset; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/utils/AngularScopeHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core.utils; 12 | 13 | import org.eclipse.angularjs.core.link.AngularLink; 14 | import org.eclipse.angularjs.core.link.AngularLinkHelper; 15 | import org.eclipse.angularjs.core.link.AngularLinkResource; 16 | import org.eclipse.core.resources.IFile; 17 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; 18 | import org.w3c.dom.Node; 19 | 20 | import tern.angular.AngularType; 21 | import tern.angular.modules.Controller; 22 | import tern.angular.modules.DOMDirectiveProvider; 23 | import tern.angular.protocol.HTMLTernAngularHelper; 24 | import tern.angular.protocol.TernAngularQuery; 25 | import tern.scriptpath.ITernScriptPath; 26 | import tern.utils.StringUtils; 27 | 28 | /** 29 | * Angular scope helper. 30 | * 31 | */ 32 | public class AngularScopeHelper { 33 | 34 | public static String getAngularValue(IDOMAttr attr, AngularType angularType) { 35 | if (angularType == AngularType.controller) { 36 | return Controller.getName(attr.getValue()); 37 | } 38 | return attr.getValue(); 39 | } 40 | 41 | public static ITernScriptPath populateScope(Node element, IFile file, AngularType angularType, 42 | TernAngularQuery query) throws Exception { 43 | ITernScriptPath scriptPath = null; 44 | HTMLTernAngularHelper.populateScope(element, DOMDirectiveProvider.getInstance(), file.getProject(), query); 45 | AngularLinkResource info = null; 46 | if (angularType != AngularType.module) { 47 | // Check if query has module defined. 48 | if (!query.hasModule()) { 49 | info = AngularLinkHelper.getControllerInfo(file); 50 | if (info != null) { 51 | AngularLink resourceLink = info.getResourceLink(); 52 | if (resourceLink != null) { 53 | // Load needed files 54 | query.getScope().setModule(resourceLink.getModule()); 55 | if (angularType != AngularType.controller) { 56 | if (!query.hasControllers() && !StringUtils.isEmpty(resourceLink.getController())) { 57 | query.getScope().getControllers().add(resourceLink.getController()); 58 | } 59 | } 60 | } 61 | } 62 | } 63 | } 64 | return scriptPath; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/utils/HyperlinkUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.core.utils; 12 | 13 | import org.eclipse.angularjs.core.AngularProject; 14 | import org.eclipse.jface.text.IRegion; 15 | import org.eclipse.jface.text.Region; 16 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; 17 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 18 | 19 | import tern.utils.StringUtils; 20 | 21 | public class HyperlinkUtils { 22 | 23 | public static IRegion getNameRegion(IDOMAttr attr) { 24 | int regOffset = attr.getNameRegionStartOffset(); 25 | int regLength = attr.getNameRegionText().length(); 26 | return new Region(regOffset, regLength); 27 | } 28 | 29 | public static IRegion getValueRegion(IDOMAttr attr) { 30 | int regOffset = attr.getValueRegionStartOffset(); 31 | int regLength = attr.getValueRegionText().length(); 32 | String attValue = attr.getValueRegionText(); 33 | if (StringUtils.isQuoted(attValue)) { 34 | regOffset++; 35 | regLength -= 2; 36 | } 37 | return new Region(regOffset, regLength); 38 | } 39 | 40 | public static IRegion getElementRegion(IDOMElement element) { 41 | int endOffset; 42 | if (element.hasEndTag() && element.isClosed()) 43 | endOffset = element.getStartEndOffset(); 44 | else 45 | endOffset = element.getEndOffset(); 46 | return new Region(element.getStartOffset(), endOffset 47 | - element.getStartOffset()); 48 | } 49 | 50 | public static String getExpressionContent(final String expr) { 51 | String expression = expr; 52 | if (expression 53 | .startsWith(AngularProject.DEFAULT_START_SYMBOL)) { 54 | expression = expression.substring( 55 | AngularProject.DEFAULT_START_SYMBOL.length(), 56 | expression.length()); 57 | } 58 | if (expression.endsWith(AngularProject.DEFAULT_END_SYMBOL)) { 59 | expression = expression.substring(0, expression.length() 60 | - AngularProject.DEFAULT_END_SYMBOL.length()); 61 | } 62 | return expression; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/AngularCoreMessages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.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 final class AngularCoreMessages extends NLS { 23 | 24 | private static final String BUNDLE_NAME = "org.eclipse.angularjs.internal.core.AngularCoreMessages"; //$NON-NLS-1$ 25 | 26 | private static ResourceBundle fResourceBundle; 27 | 28 | // Validation 29 | public static String Validation_AngularElementNotFound; 30 | 31 | private AngularCoreMessages() { 32 | } 33 | 34 | public static ResourceBundle getResourceBundle() { 35 | try { 36 | if (fResourceBundle == null) 37 | fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); 38 | } catch (MissingResourceException x) { 39 | fResourceBundle = null; 40 | } 41 | return fResourceBundle; 42 | } 43 | 44 | static { 45 | NLS.initializeMessages(BUNDLE_NAME, AngularCoreMessages.class); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/AngularCoreMessages.properties: -------------------------------------------------------------------------------- 1 | # Validation 2 | Validation_AngularElementNotFound=Cannot find {0} with name {1}. -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/launchConfigurations/ProtractorLaunchConfigurationDelegate.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 org.eclipse.angularjs.internal.core.launchConfigurations; 12 | 13 | import org.eclipse.core.runtime.CoreException; 14 | import org.eclipse.debug.core.ILaunchConfiguration; 15 | 16 | import tern.eclipse.ide.server.nodejs.core.debugger.launchConfigurations.AbstractNodejsCliFileLaunchConfigurationDelegate; 17 | import tern.eclipse.ide.server.nodejs.core.debugger.launchConfigurations.AbstractNodejsCliFileLauncher; 18 | import tern.eclipse.ide.server.nodejs.core.debugger.launchConfigurations.NodejsCliFileConfigException; 19 | 20 | /** 21 | * Protractor launch configuration delegate. 22 | * 23 | */ 24 | public class ProtractorLaunchConfigurationDelegate extends AbstractNodejsCliFileLaunchConfigurationDelegate { 25 | 26 | @Override 27 | protected AbstractNodejsCliFileLauncher createLauncher(ILaunchConfiguration configuration, String mode) 28 | throws NodejsCliFileConfigException, CoreException { 29 | return new ProtractorLauncher(configuration, mode); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/launchConfigurations/ProtractorLauncher.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 org.eclipse.angularjs.internal.core.launchConfigurations; 12 | 13 | import org.eclipse.core.runtime.CoreException; 14 | import org.eclipse.debug.core.ILaunchConfiguration; 15 | 16 | import tern.eclipse.ide.server.nodejs.core.debugger.INodejsDebugger; 17 | import tern.eclipse.ide.server.nodejs.core.debugger.launchConfigurations.AbstractNodejsCliFileLauncher; 18 | import tern.eclipse.ide.server.nodejs.core.debugger.launchConfigurations.NodejsCliFileConfigException; 19 | 20 | /** 21 | * Launch protractor with tern debugger {@link INodejsDebugger}. 22 | * 23 | */ 24 | public class ProtractorLauncher extends AbstractNodejsCliFileLauncher { 25 | 26 | public ProtractorLauncher(ILaunchConfiguration configuration, String mode) 27 | throws NodejsCliFileConfigException, CoreException { 28 | super(configuration, mode); 29 | } 30 | 31 | @Override 32 | public String generateLaunchConfigurationName() { 33 | return "Protractor for " + getConfigFile().getFullPath().toString(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/preferences/AngularCorePreferenceInitializer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.core.preferences; 12 | 13 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 14 | 15 | public class AngularCorePreferenceInitializer extends 16 | AbstractPreferenceInitializer { 17 | 18 | @Override 19 | public void initializeDefaultPreferences() { 20 | AngularCorePreferenceConstants.initializeDefaultValues(); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /org.eclipse.angularjs.core/src/org/eclipse/angularjs/internal/core/validation/HTMLAngularTagValidator.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 org.eclipse.angularjs.internal.core.validation; 12 | 13 | import org.eclipse.wst.html.core.validate.extension.IHTMLCustomTagValidator; 14 | import org.eclipse.wst.sse.core.internal.validate.ValidationMessage; 15 | import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; 16 | 17 | import tern.angular.modules.Restriction; 18 | 19 | /** 20 | * Custom HTML angular tag validator to ignore error like 'Unknown tag 21 | * (ng-pluralize)' for angular tag element which is an angular directive which 22 | * have 'E' restriction (like ng-pluralize). 23 | * 24 | *
25 |  *    // ng-pluralize is not marked as error because it's an angular directive with restrict 'E'
26 |  * 
27 | */ 28 | public class HTMLAngularTagValidator extends AbstractHTMLAngularValidator implements IHTMLCustomTagValidator { 29 | 30 | @Override 31 | public boolean canValidate(IDOMElement target) { 32 | if (hasAngularNature()) { 33 | // the project has angular nature 34 | // return true if the tag element is an known angular directive (ex 35 | // 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.jsp.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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.jsp.core;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Bundle-Activator: org.eclipse.angularjs.jsp.internal.core.AngularJSPCorePlugin 9 | Require-Bundle: org.eclipse.core.runtime, 10 | org.eclipse.jface.text, 11 | org.eclipse.angularjs.core;bundle-version="0.2.0", 12 | org.eclipse.angularjs.ui;bundle-version="0.6.0", 13 | org.eclipse.wst.html.core, 14 | org.eclipse.wst.xml.core, 15 | org.eclipse.wst.sse.core, 16 | org.eclipse.core.resources, 17 | com.ibm.icu, 18 | org.eclipse.wst.validation, 19 | tern.eclipse.ide.core, 20 | tern.core, 21 | tern.eclipse, 22 | tern.eclipse.ide.ui, 23 | org.eclipse.wst.jsdt.web.core, 24 | org.eclipse.core.expressions 25 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 26 | Bundle-ActivationPolicy: lazy 27 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties 7 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS JSP - Core 13 | 14 | JSP_Angular_Content_Validator.name=JSP Angular Content Validator -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.jsp.core 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.core/src/org/eclipse/angularjs/jsp/internal/core/AngularJSPCorePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.jsp.internal.core; 12 | 13 | import org.eclipse.core.runtime.Plugin; 14 | import org.osgi.framework.BundleContext; 15 | 16 | /** 17 | * The activator class controls the plug-in life cycle 18 | */ 19 | public class AngularJSPCorePlugin extends Plugin { 20 | 21 | // The plug-in ID 22 | public static final String PLUGIN_ID = "org.eclipse.angularjs.jsp.core"; //$NON-NLS-1$ 23 | 24 | // The shared instance 25 | private static AngularJSPCorePlugin plugin; 26 | 27 | /** 28 | * The constructor 29 | */ 30 | public AngularJSPCorePlugin() { 31 | } 32 | 33 | /* 34 | * (non-Javadoc) 35 | * 36 | * @see 37 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 38 | * ) 39 | */ 40 | public void start(BundleContext context) throws Exception { 41 | super.start(context); 42 | plugin = this; 43 | } 44 | 45 | /* 46 | * (non-Javadoc) 47 | * 48 | * @see 49 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 50 | * ) 51 | */ 52 | public void stop(BundleContext context) throws Exception { 53 | plugin = null; 54 | super.stop(context); 55 | } 56 | 57 | /** 58 | * Returns the shared instance 59 | * 60 | * @return the shared instance 61 | */ 62 | public static AngularJSPCorePlugin getDefault() { 63 | return plugin; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.jsp.ui 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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.jsp.ui;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Bundle-Activator: org.eclipse.angularjs.jsp.internal.ui.AngularJSPUIPlugin 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.wst.sse.ui, 12 | org.eclipse.jface.text, 13 | org.eclipse.angularjs.core, 14 | org.eclipse.angularjs.ui;bundle-version="0.6.0", 15 | org.eclipse.wst.html.core, 16 | org.eclipse.wst.html.ui, 17 | org.eclipse.wst.xml.ui, 18 | org.eclipse.wst.xml.core, 19 | org.eclipse.wst.sse.core, 20 | org.eclipse.core.resources, 21 | com.ibm.icu, 22 | org.eclipse.wst.validation, 23 | tern.eclipse.ide.core, 24 | tern.core, 25 | tern.eclipse, 26 | org.eclipse.ui.ide, 27 | tern.eclipse.ide.ui, 28 | org.eclipse.wst.jsdt.web.core, 29 | org.eclipse.core.expressions, 30 | org.eclipse.jst.jsp.ui, 31 | org.eclipse.jst.jsp.core, 32 | org.eclipse.angularjs.jsp.core 33 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 34 | Bundle-ActivationPolicy: lazy 35 | 36 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties 7 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS JSP - UI -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.jsp.ui 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.jsp.ui/src/org/eclipse/angularjs/jsp/internal/ui/AngularJSPUIPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.jsp.internal.ui; 12 | 13 | import org.eclipse.swt.widgets.Shell; 14 | import org.eclipse.ui.IWorkbenchPage; 15 | import org.eclipse.ui.IWorkbenchWindow; 16 | import org.eclipse.ui.plugin.AbstractUIPlugin; 17 | import org.osgi.framework.BundleContext; 18 | 19 | /** 20 | * The activator class controls the plug-in life cycle 21 | */ 22 | public class AngularJSPUIPlugin extends AbstractUIPlugin { 23 | 24 | // The plug-in ID 25 | public static final String PLUGIN_ID = "org.eclipse.angularjs.jsp.ui"; //$NON-NLS-1$ 26 | 27 | // The shared instance 28 | private static AngularJSPUIPlugin plugin; 29 | 30 | /** 31 | * The constructor 32 | */ 33 | public AngularJSPUIPlugin() { 34 | } 35 | 36 | /* 37 | * (non-Javadoc) 38 | * 39 | * @see 40 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 41 | * ) 42 | */ 43 | public void start(BundleContext context) throws Exception { 44 | super.start(context); 45 | plugin = this; 46 | } 47 | 48 | /* 49 | * (non-Javadoc) 50 | * 51 | * @see 52 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 53 | * ) 54 | */ 55 | public void stop(BundleContext context) throws Exception { 56 | plugin = null; 57 | super.stop(context); 58 | } 59 | 60 | /** 61 | * Returns the shared instance 62 | * 63 | * @return the shared instance 64 | */ 65 | public static AngularJSPUIPlugin getDefault() { 66 | return plugin; 67 | } 68 | 69 | public static IWorkbenchWindow getActiveWorkbenchWindow() { 70 | return getDefault().getWorkbench().getActiveWorkbenchWindow(); 71 | } 72 | 73 | public static Shell getActiveWorkbenchShell() { 74 | IWorkbenchWindow window = getActiveWorkbenchWindow(); 75 | if (window != null) { 76 | return window.getShell(); 77 | } 78 | return null; 79 | } 80 | 81 | /** 82 | * @return Returns the active workbench window's currrent page. 83 | */ 84 | public static IWorkbenchPage getActivePage() { 85 | return getActiveWorkbenchWindow().getActivePage(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.php.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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.php.core;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Bundle-Activator: org.eclipse.angularjs.php.internal.core.AngularPHPCorePlugin 9 | Require-Bundle: org.eclipse.core.runtime, 10 | org.eclipse.jface.text, 11 | org.eclipse.angularjs.core, 12 | org.eclipse.angularjs.ui, 13 | org.eclipse.wst.html.core, 14 | org.eclipse.wst.xml.core, 15 | org.eclipse.wst.sse.core, 16 | org.eclipse.core.resources, 17 | com.ibm.icu, 18 | org.eclipse.wst.validation, 19 | tern.eclipse.ide.core, 20 | tern.core, 21 | tern.eclipse, 22 | tern.eclipse.ide.ui, 23 | org.eclipse.wst.jsdt.web.core, 24 | org.eclipse.core.expressions 25 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 26 | Bundle-ActivationPolicy: lazy 27 | 28 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties 7 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS PHP - Core -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.php.core 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.core/src/org/eclipse/angularjs/php/internal/core/AngularPHPCorePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.php.internal.core; 12 | 13 | import org.eclipse.core.runtime.Plugin; 14 | import org.osgi.framework.BundleContext; 15 | 16 | /** 17 | * The activator class controls the plug-in life cycle 18 | */ 19 | public class AngularPHPCorePlugin extends Plugin { 20 | 21 | // The plug-in ID 22 | public static final String PLUGIN_ID = "org.eclipse.angularjs.php.core"; //$NON-NLS-1$ 23 | 24 | // The shared instance 25 | private static AngularPHPCorePlugin plugin; 26 | 27 | /** 28 | * The constructor 29 | */ 30 | public AngularPHPCorePlugin() { 31 | } 32 | 33 | /* 34 | * (non-Javadoc) 35 | * 36 | * @see 37 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 38 | * ) 39 | */ 40 | public void start(BundleContext context) throws Exception { 41 | super.start(context); 42 | plugin = this; 43 | } 44 | 45 | /* 46 | * (non-Javadoc) 47 | * 48 | * @see 49 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 50 | * ) 51 | */ 52 | public void stop(BundleContext context) throws Exception { 53 | plugin = null; 54 | super.stop(context); 55 | } 56 | 57 | /** 58 | * Returns the shared instance 59 | * 60 | * @return the shared instance 61 | */ 62 | public static AngularPHPCorePlugin getDefault() { 63 | return plugin; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.php.ui 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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.php.ui;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Bundle-Activator: org.eclipse.angularjs.php.internal.ui.AngularPHPUIPlugin 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.wst.sse.ui, 12 | org.eclipse.jface.text, 13 | org.eclipse.angularjs.core, 14 | org.eclipse.angularjs.ui, 15 | org.eclipse.wst.html.core, 16 | org.eclipse.wst.html.ui, 17 | org.eclipse.wst.xml.ui, 18 | org.eclipse.wst.xml.core, 19 | org.eclipse.wst.sse.core, 20 | org.eclipse.core.resources, 21 | com.ibm.icu, 22 | org.eclipse.wst.validation, 23 | tern.eclipse.ide.core, 24 | tern.core, 25 | tern.eclipse, 26 | org.eclipse.ui.ide, 27 | tern.eclipse.ide.ui, 28 | org.eclipse.core.expressions 29 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 30 | Bundle-ActivationPolicy: lazy 31 | 32 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties 7 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS PHP - UI -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.php.ui 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.php.ui/src/org/eclipse/angularjs/php/internal/ui/AngularPHPUIPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.php.internal.ui; 12 | 13 | import org.eclipse.swt.widgets.Shell; 14 | import org.eclipse.ui.IWorkbenchPage; 15 | import org.eclipse.ui.IWorkbenchWindow; 16 | import org.eclipse.ui.plugin.AbstractUIPlugin; 17 | import org.osgi.framework.BundleContext; 18 | 19 | /** 20 | * The activator class controls the plug-in life cycle 21 | */ 22 | public class AngularPHPUIPlugin extends AbstractUIPlugin { 23 | 24 | // The plug-in ID 25 | public static final String PLUGIN_ID = "org.eclipse.angularjs.php.ui"; //$NON-NLS-1$ 26 | 27 | // The shared instance 28 | private static AngularPHPUIPlugin plugin; 29 | 30 | /** 31 | * The constructor 32 | */ 33 | public AngularPHPUIPlugin() { 34 | } 35 | 36 | /* 37 | * (non-Javadoc) 38 | * 39 | * @see 40 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 41 | * ) 42 | */ 43 | public void start(BundleContext context) throws Exception { 44 | super.start(context); 45 | plugin = this; 46 | } 47 | 48 | /* 49 | * (non-Javadoc) 50 | * 51 | * @see 52 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 53 | * ) 54 | */ 55 | public void stop(BundleContext context) throws Exception { 56 | plugin = null; 57 | super.stop(context); 58 | } 59 | 60 | /** 61 | * Returns the shared instance 62 | * 63 | * @return the shared instance 64 | */ 65 | public static AngularPHPUIPlugin getDefault() { 66 | return plugin; 67 | } 68 | 69 | public static IWorkbenchWindow getActiveWorkbenchWindow() { 70 | return getDefault().getWorkbench().getActiveWorkbenchWindow(); 71 | } 72 | 73 | public static Shell getActiveWorkbenchShell() { 74 | IWorkbenchWindow window = getActiveWorkbenchWindow(); 75 | if (window != null) { 76 | return window.getShell(); 77 | } 78 | return null; 79 | } 80 | 81 | /** 82 | * @return Returns the active workbench window's currrent page. 83 | */ 84 | public static IWorkbenchPage getActivePage() { 85 | return getActiveWorkbenchWindow().getActivePage(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.DS_Store 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.repository 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 3 | org.eclipse.jdt.core.compiler.compliance=1.5 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.5 6 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.repository/angularjs-eclipse.p2f: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.angularjs.ui 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 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.m2e.core.prefs 3 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/.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.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-Vendor: %pluginProvider 5 | Bundle-Localization: plugin 6 | Bundle-SymbolicName: org.eclipse.angularjs.ui;singleton:=true 7 | Bundle-Version: 1.3.0.qualifier 8 | Bundle-Activator: org.eclipse.angularjs.internal.ui.AngularUIPlugin 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.wst.sse.ui, 12 | org.eclipse.jface.text, 13 | org.eclipse.angularjs.core, 14 | org.eclipse.wst.html.core, 15 | org.eclipse.wst.html.ui, 16 | org.eclipse.wst.xml.ui, 17 | org.eclipse.wst.xml.core, 18 | org.eclipse.wst.sse.core, 19 | org.eclipse.core.resources, 20 | com.ibm.icu, 21 | org.eclipse.wst.validation, 22 | tern.eclipse.ide.core, 23 | tern.core, 24 | tern.eclipse, 25 | org.eclipse.ui.ide, 26 | tern.eclipse.ide.ui, 27 | org.eclipse.wst.jsdt.web.core, 28 | org.eclipse.core.expressions, 29 | org.eclipse.ui.views, 30 | org.eclipse.ui.navigator, 31 | org.eclipse.debug.ui, 32 | tern.eclipse.ide.server.nodejs.core, 33 | tern.server.nodejs, 34 | tern.eclipse.ide.server.nodejs.ui, 35 | org.eclipse.ui.externaltools, 36 | org.eclipse.core.variables, 37 | org.eclipse.core.externaltools 38 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 39 | Bundle-ActivationPolicy: lazy 40 | Export-Package: org.eclipse.angularjs.ui.contentassist, 41 | org.eclipse.angularjs.ui.style 42 | Import-Package: com.eclipsesource.json;version="[0.9.4,0.9.5)" 43 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | plugin.properties,\ 7 | icons/,\ 8 | css/ 9 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/css/dark/preferencestyle.css: -------------------------------------------------------------------------------- 1 | IEclipsePreferences#org-eclipse-angularjs-ui { 2 | preferences: 3 | 'directiveName=#F7C517 | null | false | null | null | null' 4 | 'directiveParameterName=#F7C517 | null | true | null | null | null' 5 | 'angularExpression=#D4D4D4 | #313100 | false | null | null | null' 6 | 'angularExpressionBorder=#F7C517 | null | false | null | null | null' 7 | } -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/elcl16/goto_def.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/elcl16/goto_def.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/elcl16/link_to_ctrl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/elcl16/link_to_ctrl.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/elcl16/refresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/elcl16/refresh.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/elcl16/unlink_to_ctrl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/elcl16/unlink_to_ctrl.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/eview16/explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/eview16/explorer.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/angularjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/angularjs.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/angularjs_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/angularjs_checked.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/controller.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/controller_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/controller_checked.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/directive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/directive.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/directive_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/directive_param.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/factory.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/filter.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/folder.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/property.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/protractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/protractor.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/provider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/provider.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/routeProvider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/routeProvider.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/routeProvider_when.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/routeProvider_when.gif -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/icons/full/obj16/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/org.eclipse.angularjs.ui/icons/full/obj16/service.png -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/plugin.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 | pluginProvider=Angelo ZERR 12 | pluginName=Eclipse AngularJS UI 13 | 14 | angularjsEditor=AngularJS Editor 15 | convertProjectToAngularCommandName=Convert to AngularJS Project... 16 | 17 | # Content Assist 18 | proposalCategory.htmlTags=HTML Angular Tag Proposals 19 | 20 | # Preferences 21 | AngularPreferencePage.name=AngularJS 22 | HTMLAngularGlobalPreferencesPage.name=HTML 23 | HTMLAngularEditorPreferencePage.name=Editor 24 | HTMLAngularEditorSyntaxColoringPreferencePage.name=Syntax Coloring 25 | HTMLAngularTypingPreferencePage.name=Typing 26 | ProtractorPreferencesPage.name=Protractor 27 | 28 | # Project properties 29 | AngularMainPropertyPage.name=AngularJS 30 | DirectivesPropertyPage.name=Directives 31 | ExpressionPropertyPage.name=Expression 32 | 33 | # Hyperlink 34 | HTMLAngularHyperLinkDetector.name=HTML Angular HyperLink 35 | 36 | # Views 37 | viewCategory.name=AngularJS 38 | AngularExplorerView.name=Angular Explorer 39 | angularNavigatorContent_name=AngularJS 40 | 41 | # Actions 42 | AngularActionSet.label= Angular Navigation 43 | AngularActionSet.description= Angular Navigation Action Set 44 | OpenAngularElementAction.label=Open Angular Element... 45 | OpenAngularElementAction.tooltip=Opens an Angular Element in JavaScript editor 46 | 47 | #--- Navigate menu 48 | ActionDefinition.openAngularElement.name= Open Angular Element 49 | ActionDefinition.openAngularElement.description= Opens an Angular Element in a JavaScript editor 50 | 51 | # Protractor 52 | ProtractorLaunchShortcut.label=Protractor 53 | ProtractorLaunchShortcutWithDialog.description=Launches Protractor tests and allows it to be configured 54 | ProtractorLaunchShortcut.run.label=Protractor 55 | ProtractorLaunchShortcut.debug.label=Protractor -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | org.eclipse.angularjs.ui 4 | eclipse-plugin 5 | 6 | fr.opensagres.angularjs 7 | angularjs-eclipse 8 | 1.3.0-SNAPSHOT 9 | 10 | 11 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/AngularUIPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui; 12 | 13 | import org.eclipse.swt.widgets.Shell; 14 | import org.eclipse.ui.IWorkbenchPage; 15 | import org.eclipse.ui.IWorkbenchWindow; 16 | import org.eclipse.ui.plugin.AbstractUIPlugin; 17 | import org.osgi.framework.BundleContext; 18 | 19 | /** 20 | * The activator class controls the plug-in life cycle 21 | */ 22 | public class AngularUIPlugin extends AbstractUIPlugin { 23 | 24 | // The plug-in ID 25 | public static final String PLUGIN_ID = "org.eclipse.angularjs.ui"; //$NON-NLS-1$ 26 | 27 | // The shared instance 28 | private static AngularUIPlugin plugin; 29 | 30 | /** 31 | * The constructor 32 | */ 33 | public AngularUIPlugin() { 34 | } 35 | 36 | /* 37 | * (non-Javadoc) 38 | * 39 | * @see 40 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 41 | * ) 42 | */ 43 | public void start(BundleContext context) throws Exception { 44 | super.start(context); 45 | plugin = this; 46 | } 47 | 48 | /* 49 | * (non-Javadoc) 50 | * 51 | * @see 52 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 53 | * ) 54 | */ 55 | public void stop(BundleContext context) throws Exception { 56 | plugin = null; 57 | super.stop(context); 58 | } 59 | 60 | /** 61 | * Returns the shared instance 62 | * 63 | * @return the shared instance 64 | */ 65 | public static AngularUIPlugin getDefault() { 66 | return plugin; 67 | } 68 | 69 | public static IWorkbenchWindow getActiveWorkbenchWindow() { 70 | return getDefault().getWorkbench().getActiveWorkbenchWindow(); 71 | } 72 | 73 | public static Shell getActiveWorkbenchShell() { 74 | IWorkbenchWindow window = getActiveWorkbenchWindow(); 75 | if (window != null) { 76 | return window.getShell(); 77 | } 78 | return null; 79 | } 80 | 81 | /** 82 | * @return Returns the active workbench window's currrent page. 83 | */ 84 | public static IWorkbenchPage getActivePage() { 85 | return getActiveWorkbenchWindow().getActivePage(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/AngularUIStartup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui; 12 | 13 | import org.eclipse.ui.IStartup; 14 | 15 | /** 16 | * Need this to make AngularNatureTester work from early start 17 | * 18 | * @author Victor Rubezhny 19 | */ 20 | public class AngularUIStartup implements IStartup { 21 | 22 | @Override 23 | public void earlyStartup() { 24 | // Nothing really to do here, but need this to make AngularNatureTester work from early start 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/contentassist/MarkupAngularCompletionProposal.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.contentassist; 12 | 13 | import org.eclipse.angularjs.internal.ui.utils.HTMLAngularPrinter; 14 | import org.eclipse.swt.widgets.Shell; 15 | 16 | import tern.angular.AngularType; 17 | import tern.angular.protocol.completions.AngularCompletionProposalRec; 18 | import tern.eclipse.ide.ui.TernUIPlugin; 19 | import tern.eclipse.jface.contentassist.TernCompletionProposal; 20 | import tern.server.protocol.IJSONObjectHelper; 21 | 22 | /** 23 | * Extrends Tern completion proposal to display "module" and "controller" 24 | * information from the tern completion. 25 | * 26 | */ 27 | public class MarkupAngularCompletionProposal extends TernCompletionProposal { 28 | 29 | private final IJSONObjectHelper jsonObjectHelper; 30 | private final Object completion; 31 | 32 | public MarkupAngularCompletionProposal( 33 | AngularCompletionProposalRec proposal, Object completion, 34 | IJSONObjectHelper jsonObjectHelper, AngularType angularType) { 35 | super(proposal); 36 | this.jsonObjectHelper = jsonObjectHelper; 37 | this.completion = completion; 38 | } 39 | 40 | @Override 41 | public String getAdditionalProposalInfo() { 42 | String module = jsonObjectHelper.getText(completion, "module"); 43 | String controller = jsonObjectHelper.getText(completion, "controller"); 44 | AngularType angularType = AngularType.get(jsonObjectHelper.getText( 45 | completion, "angularType")); 46 | return HTMLAngularPrinter.getAngularInfo(getType(), getName(), module, 47 | controller, angularType, super.getDoc(), getOrigin()); 48 | } 49 | 50 | @Override 51 | protected Shell getActiveWorkbenchShell() { 52 | return TernUIPlugin.getActiveWorkbenchShell(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/dialogs/OpenAngularElementSelectionDialog.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2015 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 org.eclipse.angularjs.internal.ui.dialogs; 12 | 13 | import org.eclipse.angularjs.internal.ui.AngularUIPlugin; 14 | import org.eclipse.jface.dialogs.IDialogSettings; 15 | import org.eclipse.swt.widgets.Shell; 16 | 17 | /** 18 | * An Angular Element selection dialog used for opening Angular Elements. 19 | */ 20 | public class OpenAngularElementSelectionDialog extends FilteredAngularElementsSelectionDialog { 21 | 22 | private static final String DIALOG_SETTINGS = "org.eclipse.angularjs.internal.ui.dialogs.OpenAngularElementSelectionDialog"; //$NON-NLS-1$ 23 | 24 | public OpenAngularElementSelectionDialog(Shell shell, boolean multi) { 25 | super(shell, multi); 26 | } 27 | 28 | @Override 29 | protected IDialogSettings getDialogSettings() { 30 | IDialogSettings settings = AngularUIPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS); 31 | 32 | if (settings == null) { 33 | settings = AngularUIPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS); 34 | } 35 | 36 | return settings; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/handlers/ConvertProjectToAngularCommandHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.handlers; 12 | 13 | import java.util.ArrayList; 14 | import java.util.Arrays; 15 | import java.util.List; 16 | 17 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 18 | import org.eclipse.core.resources.IProject; 19 | import org.eclipse.core.runtime.preferences.IScopeContext; 20 | import org.eclipse.osgi.util.NLS; 21 | 22 | import tern.eclipse.ide.ui.handlers.AbstractConvertProjectCommandHandler; 23 | import tern.server.ITernModule; 24 | import tern.server.TernDef; 25 | import tern.server.TernPlugin; 26 | 27 | /** 28 | * Convert selected project to Angular project. 29 | * 30 | */ 31 | public class ConvertProjectToAngularCommandHandler extends 32 | AbstractConvertProjectCommandHandler { 33 | 34 | @Override 35 | protected String getConvertingProjectJobTitle(IProject project) { 36 | return NLS 37 | .bind(AngularUIMessages.ConvertProjectToAngular_converting_project_job_title, 38 | project.getName()); 39 | } 40 | 41 | @Override 42 | protected ITernModule[] getModules(IScopeContext[] fLookupOrder) { 43 | List modules = new ArrayList( 44 | Arrays.asList(super.getModules(fLookupOrder))); 45 | if (!modules.contains(TernDef.browser)) { 46 | modules.add(TernDef.browser); 47 | } 48 | if (!modules.contains(TernPlugin.angular1)) { 49 | modules.add(TernPlugin.angular1); 50 | } 51 | return modules.toArray(ITernModule.EMPTY_MODULE); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/launchConfigurations/ProtractorLaunchTabGroup.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.angularjs.internal.ui.launchConfigurations; 2 | 3 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 4 | import org.eclipse.debug.ui.CommonTab; 5 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 6 | import org.eclipse.debug.ui.ILaunchConfigurationTab; 7 | import org.eclipse.debug.ui.RefreshTab; 8 | 9 | public class ProtractorLaunchTabGroup extends AbstractLaunchConfigurationTabGroup { 10 | 11 | @Override 12 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 13 | ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new MainTab(), new ProtractorTab(), 14 | new RefreshTab(), new CommonTab() }; 15 | setTabs(tabs); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/launchConfigurations/ProtractorTab.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 org.eclipse.angularjs.internal.ui.launchConfigurations; 12 | 13 | import org.eclipse.angularjs.core.AngularCorePreferencesSupport; 14 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 15 | import org.eclipse.core.resources.IFile; 16 | 17 | import tern.eclipse.ide.server.nodejs.ui.debugger.launchConfigurations.AbstractNodejsCliFileLaunchConfigurationTab; 18 | 19 | /** 20 | * Protractor lib/cli.js configuration. 21 | * 22 | */ 23 | public class ProtractorTab extends AbstractNodejsCliFileLaunchConfigurationTab { 24 | 25 | @Override 26 | public String getName() { 27 | return AngularUIMessages.Protractor_ProtractorTab_name; 28 | } 29 | 30 | @Override 31 | protected String getCliFileLabel() { 32 | return AngularUIMessages.Protractor_ProtractorTab_cliFile; 33 | } 34 | 35 | @Override 36 | protected IFile getDefaultCliFile() { 37 | try { 38 | return AngularCorePreferencesSupport.getInstance().getDefaultProtractorCliFile(); 39 | } catch (Exception e) { 40 | return null; 41 | } 42 | } 43 | 44 | @Override 45 | protected String getDefaultDebugger() { 46 | return AngularCorePreferencesSupport.getInstance().getDefaultProtractorDebugger(); 47 | } 48 | 49 | @Override 50 | protected String getDefaultNodeInstall() { 51 | return AngularCorePreferencesSupport.getInstance().getDefaultProtractorNodeInstall(); 52 | } 53 | 54 | @Override 55 | protected String getDefaultNodePath() { 56 | return AngularCorePreferencesSupport.getInstance().getDefaultProtractorNodePath(); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/outline/AngularContentOutlineConfiguration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.outline; 12 | 13 | import org.eclipse.jface.viewers.IContentProvider; 14 | import org.eclipse.jface.viewers.TreeViewer; 15 | import org.eclipse.jface.viewers.Viewer; 16 | import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration; 17 | import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider; 18 | 19 | public class AngularContentOutlineConfiguration extends 20 | HTMLContentOutlineConfiguration { 21 | 22 | private IContentProvider fContentProviderHTML; 23 | 24 | public IContentProvider getContentProvider(final TreeViewer viewer) { 25 | if (fContentProviderHTML == null) { 26 | fContentProviderHTML = new JFaceNodeContentProvider() { 27 | public Object[] getElements(Object object) { 28 | return super.getElements(object); 29 | } 30 | 31 | @Override 32 | public void inputChanged(Viewer viewer, Object oldInput, 33 | Object newInput) { 34 | super.inputChanged(viewer, oldInput, newInput); 35 | } 36 | }; 37 | } 38 | viewer.setContentProvider(fContentProviderHTML); 39 | return viewer.getContentProvider(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/preferences/AngularUIPreferenceInitializer.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 org.eclipse.angularjs.internal.ui.preferences; 12 | 13 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 14 | import org.eclipse.jface.preference.IPreferenceStore; 15 | import org.eclipse.ui.editors.text.EditorsUI; 16 | 17 | /** 18 | * Angular UI preference initializer. 19 | * 20 | */ 21 | public class AngularUIPreferenceInitializer extends AbstractPreferenceInitializer { 22 | 23 | @Override 24 | public void initializeDefaultPreferences() { 25 | 26 | IPreferenceStore store = PreferenceConstants.getPreferenceStore(); 27 | EditorsUI.useAnnotationsPreferencePage(store); 28 | EditorsUI.useQuickDiffPreferencePage(store); 29 | PreferenceConstants.initializeDefaultValues(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/preferences/AngularUIPreferenceNames.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.preferences; 12 | 13 | public class AngularUIPreferenceNames { 14 | 15 | /** 16 | * The key to store the option for auto-completing end-expression after 17 | * entering {{ 18 | *

19 | * Value is of type boolean. 20 | *

21 | */ 22 | public static final String TYPING_COMPLETE_END_EL = "completeEndEL"; //$NON-NLS-1$ 23 | 24 | public static final String HIGHLIGHTING_DIRECTIVE_ENABLED = "angularjs.ui.highlighting.directive.enabled"; //$NON-NLS-1$ 25 | public static final String HIGHLIGHTING_EXPRESSION_ENABLED = "angularjs.ui.highlighting.expression.enabled"; //$NON-NLS-1$ 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/preferences/protractor/ProtractorPreferencesPage.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 org.eclipse.angularjs.internal.ui.preferences.protractor; 12 | 13 | import org.eclipse.angularjs.core.AngularCoreConstants; 14 | import org.eclipse.angularjs.core.AngularCorePlugin; 15 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 16 | import org.eclipse.angularjs.internal.ui.ImageResource; 17 | import org.eclipse.core.runtime.preferences.InstanceScope; 18 | import org.eclipse.jface.preference.IPreferenceStore; 19 | import org.eclipse.ui.preferences.ScopedPreferenceStore; 20 | 21 | import tern.eclipse.ide.server.nodejs.ui.debugger.preferences.AbstractNodejsCliFilePreferencesPage; 22 | 23 | /** 24 | * Protractor preferences page. 25 | * 26 | */ 27 | public class ProtractorPreferencesPage extends AbstractNodejsCliFilePreferencesPage { 28 | 29 | public static final String PAGE_ID = "org.eclipse.angularjs.preferences.protractor"; 30 | 31 | public ProtractorPreferencesPage() { 32 | super(GRID); 33 | setDescription(AngularUIMessages.ProtractorPreferencesPage_desc); 34 | setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_PROTRACTOR)); 35 | } 36 | 37 | @Override 38 | protected IPreferenceStore doGetPreferenceStore() { 39 | return new ScopedPreferenceStore(InstanceScope.INSTANCE, AngularCorePlugin.PLUGIN_ID); 40 | } 41 | 42 | @Override 43 | protected String getCliFilePreferenceName() { 44 | return AngularCoreConstants.PROTRACTOR_DEFAULT_CLI_FILE; 45 | } 46 | 47 | @Override 48 | protected String getCliFileLabel() { 49 | return AngularUIMessages.ProtractorPreferencesPage_debugger_label; 50 | } 51 | 52 | @Override 53 | protected String getDebuggerPreferenceName() { 54 | return AngularCoreConstants.PROTRACTOR_NODEJS_DEBUGGER; 55 | } 56 | 57 | @Override 58 | protected String getDebuggerLabel() { 59 | return AngularUIMessages.ProtractorPreferencesPage_debugger_label; 60 | } 61 | 62 | @Override 63 | protected String getNodeJSInstallPreferenceName() { 64 | return AngularCoreConstants.PROTRACTOR_NODEJS_INSTALL; 65 | } 66 | 67 | @Override 68 | protected String getNodeJSPathPreferenceName() { 69 | return AngularCoreConstants.PROTRACTOR_NODEJS_PATH; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/properties/AngularMainPropertyPage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.properties; 12 | 13 | import org.eclipse.angularjs.internal.ui.ImageResource; 14 | import org.eclipse.swt.SWT; 15 | import org.eclipse.swt.layout.GridData; 16 | import org.eclipse.swt.layout.GridLayout; 17 | import org.eclipse.swt.widgets.Composite; 18 | import org.eclipse.swt.widgets.Control; 19 | import org.eclipse.ui.IWorkbenchPropertyPage; 20 | import org.eclipse.ui.dialogs.PropertyPage; 21 | 22 | /** 23 | * Angular Main page for project properties. 24 | * 25 | */ 26 | public class AngularMainPropertyPage extends PropertyPage implements 27 | IWorkbenchPropertyPage { 28 | 29 | public static final String PROP_ID = "org.eclipse.angularjs.internal.ui.properties.AngularMainPropertyPage"; 30 | 31 | public AngularMainPropertyPage() { 32 | setImageDescriptor(ImageResource 33 | .getImageDescriptor(ImageResource.IMG_ANGULARJS)); 34 | } 35 | 36 | protected Control createContents(Composite parent) { 37 | Composite composite = new Composite(parent, SWT.NONE); 38 | composite.setLayoutData(new GridData(4, 4, true, true)); 39 | composite.setLayout(new GridLayout()); 40 | return composite; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/properties/ExpressionPropertyPage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.properties; 12 | 13 | import org.eclipse.angularjs.core.AngularCoreConstants; 14 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 15 | import org.eclipse.jface.preference.StringFieldEditor; 16 | import org.eclipse.swt.widgets.Composite; 17 | 18 | /** 19 | * Expression property page. 20 | * 21 | */ 22 | public class ExpressionPropertyPage extends 23 | AbstractAngularFieldEditorPropertyPage { 24 | 25 | @Override 26 | protected void createFieldEditors() { 27 | Composite parent = super.getFieldEditorParent(); 28 | 29 | // start symbol 30 | StringFieldEditor startSymbolField = new StringFieldEditor( 31 | AngularCoreConstants.EXPRESSION_START_SYMBOL, 32 | AngularUIMessages.ExpressionPropertyPage_startSybol_label, 33 | parent); 34 | addField(startSymbolField); 35 | 36 | // end symbol 37 | StringFieldEditor endSymbolField = new StringFieldEditor( 38 | AngularCoreConstants.EXPRESSION_END_SYMBOL, 39 | AngularUIMessages.ExpressionPropertyPage_endSybol_label, parent); 40 | addField(endSymbolField); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/style/IStyleConstantsForAngular.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.style; 12 | 13 | /** 14 | * Constants for Angular styles. 15 | * 16 | */ 17 | public interface IStyleConstantsForAngular { 18 | 19 | public static final String ANGULAR_EXPRESSION_BORDER = "angularExpressionBorder"; 20 | public static final String ANGULAR_EXPRESSION = "angularExpression"; 21 | public static final String ANGULAR_DIRECTIVE_NAME = "directiveName"; 22 | public static final String ANGULAR_DIRECTIVE_PARAMETER_NAME = "directiveParameterName"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/style/SemanticHighlightingManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.style; 12 | 13 | import java.util.LinkedList; 14 | import java.util.List; 15 | 16 | import org.eclipse.angularjs.internal.ui.Trace; 17 | import org.eclipse.angularjs.ui.style.AbstractAngularSemanticHighlighting; 18 | import org.eclipse.core.runtime.IConfigurationElement; 19 | import org.eclipse.core.runtime.Platform; 20 | 21 | /** 22 | * Angular semantic highlighting manager 23 | * 24 | */ 25 | public class SemanticHighlightingManager { 26 | 27 | private static SemanticHighlightingManager instance; 28 | 29 | private List highlightings = new LinkedList(); 30 | 31 | public synchronized static SemanticHighlightingManager getInstance() { 32 | if (instance == null) { 33 | instance = new SemanticHighlightingManager(); 34 | } 35 | return instance; 36 | } 37 | 38 | private SemanticHighlightingManager() { 39 | super(); 40 | IConfigurationElement[] elements = Platform.getExtensionRegistry() 41 | .getConfigurationElementsFor( 42 | "org.eclipse.wst.sse.ui.semanticHighlighting"); //$NON-NLS-1$ 43 | try { 44 | loadContributor(elements); 45 | } catch (Exception e) { 46 | Trace.trace(Trace.SEVERE, 47 | "Error while loading angular semantic manager", e); 48 | } 49 | } 50 | 51 | private SemanticHighlightingManager loadContributor( 52 | IConfigurationElement[] elements) throws Exception { 53 | for (IConfigurationElement element : elements) { 54 | String target = element.getAttribute("target"); //$NON-NLS-1$ 55 | if ("org.eclipse.wst.html.core.htmlsource".equals(target)) { //$NON-NLS-1$ 56 | final Object o = element.createExecutableExtension("class"); //$NON-NLS-1$ 57 | if (o instanceof AbstractAngularSemanticHighlighting) { 58 | AbstractAngularSemanticHighlighting instance = (AbstractAngularSemanticHighlighting) o; 59 | highlightings.add(instance); 60 | } 61 | } 62 | } 63 | return this; 64 | } 65 | 66 | public List getHighlightings() { 67 | return highlightings; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/taginfo/HTMLAngularTernTypeCollector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.taginfo; 12 | 13 | import org.eclipse.angularjs.internal.ui.utils.HTMLAngularPrinter; 14 | 15 | import tern.angular.AngularType; 16 | import tern.eclipse.ide.core.IIDETernProject; 17 | import tern.eclipse.ide.ui.hover.HTMLTernTypeCollector; 18 | import tern.server.ITernServer; 19 | import tern.server.protocol.IJSONObjectHelper; 20 | import tern.server.protocol.type.ITernTypeCollector; 21 | 22 | /** 23 | * {@link ITernTypeCollector} implementation for HTML Angular type collector. 24 | * 25 | */ 26 | public class HTMLAngularTernTypeCollector extends HTMLTernTypeCollector { 27 | 28 | public HTMLAngularTernTypeCollector(IIDETernProject ternProject) { 29 | super(ternProject); 30 | } 31 | 32 | private String info; 33 | 34 | @Override 35 | public void setType(String type, boolean guess, String name, 36 | String exprName, String doc, String url, String origin, 37 | Object object, IJSONObjectHelper objectHelper) { 38 | if (name != null) { 39 | String module = objectHelper.getText(object, "module"); 40 | String controller = objectHelper.getText(object, "controller"); 41 | AngularType angularType = AngularType.get(objectHelper.getText( 42 | object, "angularType")); 43 | this.info = HTMLAngularPrinter.getAngularInfo(type, name, module, 44 | controller, angularType, doc, origin); 45 | } 46 | } 47 | 48 | /** 49 | * Returns the HTML of the Angular tern type. 50 | * 51 | * @return the HTML of the Angular tern type. 52 | */ 53 | public String getInfo() { 54 | return info; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/utils/DOMUIUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.utils; 12 | 13 | import org.eclipse.jface.text.ITextViewer; 14 | import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; 15 | import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; 16 | 17 | public class DOMUIUtils { 18 | 19 | /** 20 | * Returns the closest IStructuredDocumentRegion for the offest and viewer. 21 | * 22 | * @param viewer 23 | * @param documentOffset 24 | * @return the closest IStructuredDocumentRegion for the offest and viewer. 25 | */ 26 | public static IStructuredDocumentRegion getStructuredDocumentRegion( 27 | ITextViewer viewer, int documentOffset) { 28 | IStructuredDocumentRegion sdRegion = null; 29 | if (viewer == null || viewer.getDocument() == null) 30 | return null; 31 | 32 | int lastOffset = documentOffset; 33 | IStructuredDocument doc = (IStructuredDocument) viewer.getDocument(); 34 | sdRegion = doc.getRegionAtCharacterOffset(documentOffset); 35 | while (sdRegion == null && lastOffset >= 0) { 36 | lastOffset--; 37 | sdRegion = doc.getRegionAtCharacterOffset(lastOffset); 38 | } 39 | return sdRegion; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/viewers/AngularExplorerContentProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.viewers; 12 | 13 | import org.eclipse.angularjs.core.AngularProject; 14 | import org.eclipse.angularjs.core.BaseModel; 15 | import org.eclipse.angularjs.core.Module; 16 | import org.eclipse.angularjs.core.ModulesFolder; 17 | import org.eclipse.angularjs.core.ScriptsFolder; 18 | import org.eclipse.core.resources.IProject; 19 | import org.eclipse.core.runtime.CoreException; 20 | 21 | import tern.eclipse.ide.ui.viewers.TernScriptPathContentProvider; 22 | import tern.scriptpath.ITernScriptPath; 23 | 24 | /** 25 | * Content provider used in the tree of the angular explorer. 26 | * 27 | */ 28 | public class AngularExplorerContentProvider extends 29 | TernScriptPathContentProvider { 30 | 31 | @Override 32 | public Object[] getChildren(Object element) { 33 | if (element instanceof ITernScriptPath) { 34 | ITernScriptPath scriptPath = (ITernScriptPath) element; 35 | try { 36 | AngularProject angularProject = AngularProject 37 | .getAngularProject((IProject) scriptPath.getOwnerProject(). 38 | getAdapter(IProject.class)); 39 | return angularProject.getFolders(scriptPath).toArray(); 40 | } catch (CoreException e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | if (element instanceof BaseModel) { 45 | switch (((BaseModel) element).getType()) { 46 | case ScriptsFolder: 47 | return ((ScriptsFolder) element).getScriptPath() 48 | .getScriptResources().toArray(); 49 | case ModulesFolder: 50 | return ((ModulesFolder) element).getModules(); 51 | case Module: 52 | return ((Module) element).getAngularElements(); 53 | } 54 | } 55 | return null; 56 | } 57 | 58 | @Override 59 | public boolean hasChildren(Object element) { 60 | if (super.hasChildren(element)) { 61 | return true; 62 | } 63 | if (element instanceof BaseModel) { 64 | return !((BaseModel) element).getType().equals( 65 | BaseModel.Type.AngularElement); 66 | } 67 | return false; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/viewers/AngularOutlineLabelProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2015 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 org.eclipse.angularjs.internal.ui.viewers; 12 | 13 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 14 | import org.eclipse.angularjs.internal.ui.ImageResource; 15 | import org.eclipse.jface.viewers.StyledString; 16 | import org.eclipse.swt.graphics.Image; 17 | 18 | import tern.eclipse.ide.ui.views.AbstractTernOutlineLabelProvider; 19 | import tern.server.protocol.outline.IJSNode; 20 | import tern.utils.StringUtils; 21 | 22 | /** 23 | * Label provider for angular outline. 24 | * 25 | */ 26 | public class AngularOutlineLabelProvider extends AbstractTernOutlineLabelProvider { 27 | 28 | @Override 29 | protected String getUnavailableText() { 30 | return null; 31 | } 32 | 33 | @Override 34 | protected Image getUnavailableImage() { 35 | return null; 36 | } 37 | 38 | @Override 39 | protected String getComputingText() { 40 | return AngularUIMessages.AngularOutline_computing; 41 | } 42 | 43 | @Override 44 | protected Image getComputingImage() { 45 | return ImageResource.getImage(ImageResource.IMG_ANGULARJS); 46 | } 47 | 48 | @Override 49 | protected String getText(IJSNode element) { 50 | return element.getName(); 51 | } 52 | 53 | @Override 54 | protected Image getImage(IJSNode element) { 55 | return AngularElementLabelProvider.INSTANCE.getImage(element); 56 | } 57 | 58 | @Override 59 | protected StyledString getStyledText(IJSNode element) { 60 | StyledString buff = new StyledString(StringUtils.isEmpty(element.getName()) ? "" : element.getName()); 61 | String value = element.getValue(); 62 | if (StringUtils.isEmpty(value)) { 63 | value = element.getFile(); 64 | } 65 | if (!StringUtils.isEmpty(value)) { 66 | buff.append(" : ", StyledString.DECORATIONS_STYLER); 67 | buff.append(value, StyledString.DECORATIONS_STYLER); 68 | } 69 | return buff; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/viewers/AngularOutlineLabelProviderOLD.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.angularjs.internal.ui.viewers; 2 | 3 | public class AngularOutlineLabelProviderOLD extends AngularElementLabelProvider { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/AngularExplorerView.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.angularjs.internal.ui.views; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.eclipse.angularjs.core.AngularProject; 7 | import org.eclipse.core.resources.IFile; 8 | import org.eclipse.core.resources.IProject; 9 | import org.eclipse.jface.text.IDocument; 10 | import org.eclipse.ui.views.contentoutline.IContentOutlinePage; 11 | 12 | import tern.eclipse.ide.core.IIDETernProject; 13 | import tern.eclipse.ide.core.TernCorePlugin; 14 | import tern.eclipse.ide.core.resources.TernDocumentFile; 15 | import tern.eclipse.ide.ui.views.AbstractTernOutlineView; 16 | import tern.server.TernPlugin; 17 | import tern.server.protocol.outline.TernOutlineCollector; 18 | 19 | public class AngularExplorerView extends AbstractTernOutlineView { 20 | 21 | private final Map pageProjects; 22 | 23 | public AngularExplorerView() { 24 | this.pageProjects = new HashMap(); 25 | } 26 | 27 | @Override 28 | protected boolean isAdaptFor(IFile file) { 29 | return AngularProject.hasAngularNature(file.getProject()); 30 | } 31 | 32 | @Override 33 | protected IContentOutlinePage createOutlinePage(IProject project) { 34 | AngularContentOutlinePage page = new AngularContentOutlinePage(project, this); 35 | pageProjects.put(project, page); 36 | return page; 37 | } 38 | 39 | @Override 40 | protected IContentOutlinePage getOutlinePage(IProject project) { 41 | IContentOutlinePage page = pageProjects.get(project); 42 | if (page != null && page.getControl() != null && !page.getControl().isDisposed()) { 43 | return page; 44 | } 45 | return null; 46 | } 47 | 48 | @Override 49 | public void dispose() { 50 | super.dispose(); 51 | pageProjects.clear(); 52 | } 53 | 54 | @Override 55 | public TernOutlineCollector loadOutline(IFile file, IDocument document) throws Exception { 56 | IProject project = file.getProject(); 57 | IIDETernProject ternProject = TernCorePlugin.getTernProject(project); 58 | if (ternProject == null || !ternProject.hasPlugin(TernPlugin.angular1)) { 59 | return null; 60 | } 61 | TernDocumentFile ternFile = new TernDocumentFile(file, document); 62 | return AngularProject.getAngularProject(project).getOutlineProvider(ternFile); 63 | } 64 | 65 | @Override 66 | public boolean isOutlineAvailable(IFile file) { 67 | return true; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actions/LexicalSortingAction.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.angularjs.internal.ui.views.actions; 2 | 3 | import org.eclipse.angularjs.core.BaseModel; 4 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 5 | import org.eclipse.angularjs.internal.ui.AngularUIPlugin; 6 | import org.eclipse.angularjs.internal.ui.views.AngularContentOutlinePage; 7 | import org.eclipse.jface.preference.IPreferenceStore; 8 | import org.eclipse.jface.viewers.ViewerSorter; 9 | 10 | import tern.angular.modules.IAngularElement; 11 | import tern.eclipse.ide.ui.views.actions.AbstractLexicalSortingAction; 12 | 13 | public class LexicalSortingAction extends AbstractLexicalSortingAction { 14 | 15 | public LexicalSortingAction(AngularContentOutlinePage page) { 16 | super(page, AngularUIMessages.LexicalSortingAction_text, AngularUIMessages.LexicalSortingAction_tooltip, 17 | AngularUIMessages.LexicalSortingAction_description, new LexicalSorter()); 18 | } 19 | 20 | @Override 21 | protected IPreferenceStore getPreferenceStore() { 22 | return AngularUIPlugin.getDefault().getPreferenceStore(); 23 | } 24 | 25 | static class LexicalSorter extends ViewerSorter { 26 | @Override 27 | public int category(Object element) { 28 | if (element instanceof IAngularElement) { 29 | IAngularElement angularElement = (IAngularElement) element; 30 | switch (angularElement.getAngularType()) { 31 | case controller: 32 | return 5; 33 | case directive: 34 | return 6; 35 | case filter: 36 | return 7; 37 | case factory: 38 | return 8; 39 | case provider: 40 | return 9; 41 | case service: 42 | return 10; 43 | default: 44 | return 11; 45 | } 46 | } else if (element instanceof BaseModel) { 47 | switch (((BaseModel) element).getType()) { 48 | case Module: 49 | case ScriptsFolder: 50 | return 0; 51 | default: 52 | return 1; 53 | } 54 | } 55 | return 12; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actions/LinkToControllerAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.views.actions; 12 | 13 | import org.eclipse.angularjs.core.link.AngularLinkHelper; 14 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 15 | import org.eclipse.angularjs.internal.ui.ImageResource; 16 | import org.eclipse.angularjs.internal.ui.views.AngularContentOutlinePage; 17 | import org.eclipse.core.resources.IResource; 18 | import org.eclipse.jface.action.Action; 19 | import org.eclipse.jface.viewers.IStructuredSelection; 20 | 21 | import tern.TernResourcesManager; 22 | import tern.angular.AngularType; 23 | import tern.angular.modules.IAngularElement; 24 | import tern.angular.modules.IModule; 25 | 26 | /** 27 | * This action link the selected controller to the current HTML/JSP file opened 28 | * in a editor. 29 | * 30 | */ 31 | public class LinkToControllerAction extends Action { 32 | 33 | private final AngularContentOutlinePage page; 34 | 35 | public LinkToControllerAction(AngularContentOutlinePage page) { 36 | this.page = page; 37 | super.setText(AngularUIMessages.LinkToControllerAction_text); 38 | super.setToolTipText(AngularUIMessages.LinkToControllerAction_tooltip); 39 | super.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_LINK_TO_CTRL)); 40 | } 41 | 42 | @Override 43 | public void run() { 44 | IResource resource = page.getCurrentFile(); 45 | IStructuredSelection selection = (IStructuredSelection) page.getViewer().getSelection(); 46 | if (!selection.isEmpty()) { 47 | Object firstSelection = selection.getFirstElement(); 48 | if (firstSelection instanceof IAngularElement) { 49 | IAngularElement element = (IAngularElement) firstSelection; 50 | IModule module = element.getModule(); 51 | if (module != null) { 52 | try { 53 | AngularLinkHelper.setController(module.getName(), 54 | !element.isType(AngularType.module) ? element.getName() : null, resource, null); 55 | page.updateEnabledLinkActions(true); 56 | } catch (Exception e) { 57 | e.printStackTrace(); 58 | } 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actions/RefreshExplorerAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.views.actions; 12 | 13 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 14 | import org.eclipse.angularjs.internal.ui.ImageResource; 15 | import org.eclipse.angularjs.internal.ui.views.AngularContentOutlinePage; 16 | import org.eclipse.jface.action.Action; 17 | 18 | /** 19 | * This action refresh the explorer tree. 20 | * 21 | */ 22 | public class RefreshExplorerAction extends Action { 23 | 24 | private final AngularContentOutlinePage page; 25 | 26 | public RefreshExplorerAction(AngularContentOutlinePage page) { 27 | this.page = page; 28 | super.setText(AngularUIMessages.RefreshExplorerAction_text); 29 | super.setToolTipText(AngularUIMessages.RefreshExplorerAction_tooltip); 30 | super.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_REFRESH)); 31 | } 32 | 33 | @Override 34 | public void run() { 35 | page.refreshOutline(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actions/UnLinkToControllerAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.views.actions; 12 | 13 | import org.eclipse.angularjs.core.link.AngularLinkHelper; 14 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 15 | import org.eclipse.angularjs.internal.ui.ImageResource; 16 | import org.eclipse.angularjs.internal.ui.views.AngularContentOutlinePage; 17 | import org.eclipse.core.resources.IResource; 18 | import org.eclipse.jface.action.Action; 19 | import org.eclipse.jface.viewers.IStructuredSelection; 20 | 21 | import tern.TernResourcesManager; 22 | import tern.angular.modules.IAngularElement; 23 | import tern.angular.modules.IModule; 24 | 25 | /** 26 | * This action unlink the selected controller to the current HTML/JSP file 27 | * opened in a editor. 28 | * 29 | */ 30 | public class UnLinkToControllerAction extends Action { 31 | 32 | private final AngularContentOutlinePage page; 33 | 34 | public UnLinkToControllerAction(AngularContentOutlinePage page) { 35 | this.page = page; 36 | super.setText(AngularUIMessages.UnLinkToControllerAction_text); 37 | super.setToolTipText(AngularUIMessages.UnLinkToControllerAction_tooltip); 38 | super.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_UNLINK_TO_CTRL)); 39 | } 40 | 41 | @Override 42 | public void run() { 43 | IResource resource = page.getCurrentFile(); 44 | IStructuredSelection selection = (IStructuredSelection) page.getViewer().getSelection(); 45 | if (!selection.isEmpty()) { 46 | Object firstSelection = selection.getFirstElement(); 47 | if (firstSelection instanceof IAngularElement) { 48 | IAngularElement element = (IAngularElement) firstSelection; 49 | IModule module = element.getModule(); 50 | if (module != null) { 51 | try { 52 | AngularLinkHelper.removeController(resource, null, module.getName(), element.getName(), null); 53 | page.updateEnabledLinkActions(true); 54 | } catch (Exception e) { 55 | e.printStackTrace(); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actionsOLD/GoToDefinitionAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.views.actionsOLD; 12 | 13 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 14 | import org.eclipse.angularjs.internal.ui.ImageResource; 15 | import org.eclipse.angularjs.internal.ui.views.AngularExplorerViewOLD; 16 | import org.eclipse.jface.action.Action; 17 | import org.eclipse.jface.viewers.IStructuredSelection; 18 | 19 | /** 20 | * This action opens in an editor the selected element of the tree of the 21 | * angular explorer if the element can be opened. 22 | * 23 | */ 24 | public class GoToDefinitionAction extends Action { 25 | 26 | private final AngularExplorerViewOLD explorer; 27 | 28 | public GoToDefinitionAction(AngularExplorerViewOLD explorer) { 29 | this.explorer = explorer; 30 | super.setText(AngularUIMessages.GoToDefinitionAction_text); 31 | super.setToolTipText(AngularUIMessages.GoToDefinitionAction_tooltip); 32 | super.setImageDescriptor(ImageResource 33 | .getImageDescriptor(ImageResource.IMG_ELCL_GOTO_DEF)); 34 | } 35 | 36 | @Override 37 | public void run() { 38 | IStructuredSelection selection = (IStructuredSelection) explorer 39 | .getViewer().getSelection(); 40 | if (!selection.isEmpty()) { 41 | Object firstSelection = selection.getFirstElement(); 42 | explorer.tryOpenInEditor(firstSelection); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/views/actionsOLD/RefreshExplorerAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.internal.ui.views.actionsOLD; 12 | 13 | import org.eclipse.angularjs.internal.ui.AngularUIMessages; 14 | import org.eclipse.angularjs.internal.ui.ImageResource; 15 | import org.eclipse.angularjs.internal.ui.views.AngularExplorerViewOLD; 16 | import org.eclipse.jface.action.Action; 17 | 18 | /** 19 | * This action refresh the explorer tree. 20 | * 21 | */ 22 | public class RefreshExplorerAction extends Action { 23 | 24 | private final AngularExplorerViewOLD explorer; 25 | 26 | public RefreshExplorerAction(AngularExplorerViewOLD explorer) { 27 | this.explorer = explorer; 28 | super.setText(AngularUIMessages.RefreshExplorerAction_text); 29 | super.setToolTipText(AngularUIMessages.RefreshExplorerAction_tooltip); 30 | super.setImageDescriptor(ImageResource 31 | .getImageDescriptor(ImageResource.IMG_ELCL_REFRESH)); 32 | } 33 | 34 | @Override 35 | public void run() { 36 | explorer.refreshTree(false); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/ui/style/AngularExpressionBorderSemanticHighlighting.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.ui.style; 12 | 13 | import java.util.List; 14 | 15 | import org.eclipse.angularjs.internal.ui.style.IStyleConstantsForAngular; 16 | import org.eclipse.jface.text.Position; 17 | 18 | /** 19 | * Angular expression semantic highlighting used to highlight border of 20 | * expression. Example : 21 | * 22 | *

23 | * {{remaining()}} 24 | *

25 | * 26 | * this class highlight "{{" and "}}". 27 | * 28 | */ 29 | public class AngularExpressionBorderSemanticHighlighting extends 30 | AbstractAngularExpressionSemanticHighlighting { 31 | 32 | @Override 33 | public String getStyleStringKey() { 34 | return IStyleConstantsForAngular.ANGULAR_EXPRESSION_BORDER; 35 | } 36 | 37 | @Override 38 | protected int fillPosition(List positions, 39 | String startExpression, String endExpression, String regionText, 40 | int startIndex, int startOffset) { 41 | int endIndex = regionText.indexOf(endExpression, startIndex 42 | + startExpression.length()); 43 | // add position of {{ 44 | positions.add(new Position(startOffset + startIndex, startExpression 45 | .length())); 46 | if (endIndex != -1) { 47 | // add position of }} 48 | positions.add(new Position(startOffset + endIndex, endExpression 49 | .length())); 50 | } 51 | return endIndex; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /org.eclipse.angularjs.ui/src/org/eclipse/angularjs/ui/style/AngularExpressionSemanticHighlighting.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014 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 org.eclipse.angularjs.ui.style; 12 | 13 | import java.util.List; 14 | 15 | import org.eclipse.angularjs.internal.ui.style.IStyleConstantsForAngular; 16 | import org.eclipse.jface.text.Position; 17 | 18 | /** 19 | * Angular expression semantic highlighting used to highlight content of 20 | * expression. Example : 21 | * 22 | *

23 | * {{remaining()}} 24 | *

25 | * 26 | * this class highlight "remaining()" 27 | * 28 | */ 29 | public class AngularExpressionSemanticHighlighting extends 30 | AbstractAngularExpressionSemanticHighlighting { 31 | 32 | @Override 33 | public String getStyleStringKey() { 34 | return IStyleConstantsForAngular.ANGULAR_EXPRESSION; 35 | } 36 | 37 | @Override 38 | protected int fillPosition(List positions, 39 | String startExpression, String endExpression, String regionText, 40 | int startIndex, int startOffset) { 41 | int endIndex = regionText.indexOf(endExpression, startIndex 42 | + startExpression.length()); 43 | int length = (endIndex != -1 ? endIndex : regionText.length()) 44 | - startIndex - endExpression.length(); 45 | positions.add(new Position(startOffset + startIndex 46 | + startExpression.length(), length)); 47 | return endIndex; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /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 "$@" -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AngularJS-Directive-Controllers 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{"scriptPaths":[{"type":"FOLDER","path":"app"}]},"plugins":{"angular":{}},"libs":["browser","ecma5"]} -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/app/controllers/master-controller.js: -------------------------------------------------------------------------------- 1 | (function( ng, app ) { 2 | 3 | "use strict"; 4 | 5 | app.controller( 6 | "MasterController", 7 | function( $scope ) { 8 | 9 | 10 | // -- Define Controller Methods. ---------------- // 11 | 12 | 13 | // I get the next available ID for a new slave. 14 | function getNextID() { 15 | 16 | if ( ! $scope.slaves.length ) { 17 | 18 | return( 1 ); 19 | 20 | } 21 | 22 | var lastSlave = $scope.slaves[ $scope.slaves.length - 1 ]; 23 | 24 | return( lastSlave.id + 1 ); 25 | 26 | } 27 | 28 | 29 | // I get a random coordinate based on the given constraints. 30 | function getRandomCoordinate( minCoordinate, maxCoordinate ) { 31 | 32 | var delta = ( maxCoordinate - minCoordinate ); 33 | 34 | return( 35 | minCoordinate + Math.floor( Math.random() * delta ) 36 | ); 37 | 38 | } 39 | 40 | 41 | // -- Define Scope Methods. --------------------- // 42 | 43 | 44 | // I add a new slave at the given position. 45 | $scope.addSlave = function( x, y ) { 46 | 47 | $scope.slaves.push({ 48 | id: getNextID(), 49 | x: x, 50 | y: y 51 | }); 52 | 53 | }; 54 | 55 | 56 | // I remove the given slave from the collection. 57 | $scope.removeSlave = function( slave ) { 58 | 59 | // Find the slave in the collection. 60 | var index = $scope.slaves.indexOf( slave ); 61 | 62 | // Splice out slave. 63 | $scope.slaves.splice( index, 1 ); 64 | 65 | }; 66 | 67 | 68 | // -- Set Scope Variables. ---------------------- // 69 | 70 | 71 | // This is our list of slaves and their coordinates. Starting with an initial 72 | // collection of one (at a random position). 73 | $scope.slaves = [ 74 | { 75 | id: 1, 76 | x: getRandomCoordinate( 50, 400 ), 77 | y: getRandomCoordinate( 50, 200 ) 78 | } 79 | ]; 80 | 81 | 82 | } 83 | ); 84 | 85 | })( angular, demo ); -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/app/controllers/slave-controller.js: -------------------------------------------------------------------------------- 1 | (function( ng, app ) { 2 | 3 | "use strict"; 4 | 5 | app.controller( 6 | "SlaveController", 7 | function( $scope ) { 8 | 9 | 10 | // -- Define Scope Methods. --------------------- // 11 | 12 | 13 | // I remove the current slave from the collection. 14 | $scope.remove = function() { 15 | 16 | // Pass this responsibility up the scope chain to the master controller (and its 17 | // collection of slave instances). 18 | $scope.removeSlave( $scope.slave ); 19 | 20 | }; 21 | 22 | 23 | // I reposition the current slave. 24 | $scope.reposition = function( x, y ) { 25 | 26 | $scope.slave.x = x; 27 | $scope.slave.y = y; 28 | 29 | }; 30 | 31 | 32 | } 33 | ); 34 | 35 | })( angular, demo ); -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/app/main.js: -------------------------------------------------------------------------------- 1 | (function( ng ) { 2 | 3 | "use strict"; 4 | 5 | // Define our AngularJS application module. 6 | window.demo = ng.module( "Demo", [] ); 7 | 8 | })( angular ); -------------------------------------------------------------------------------- /samples/AngularJS-Directive-Controllers/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Using Controllers In Directives In AngularJS 7 | 8 | 9 | 10 | 11 | 12 |

13 | Using Controllers In Directives In AngularJS 14 |

15 | 16 | 17 | 18 | 59 | 60 | 61 | 62 | 63 | 67 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /samples/ToDoMVC/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ToDoMVC 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | tern.eclipse.ide.core.ternBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.wst.common.project.facet.core.nature 31 | org.eclipse.wst.common.modulecore.ModuleCoreNature 32 | org.eclipse.wst.jsdt.core.jsNature 33 | org.eclipse.angularjs.core.angularnature 34 | tern.eclipse.ide.core.ternnature 35 | 36 | 37 | -------------------------------------------------------------------------------- /samples/ToDoMVC/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/ToDoMVC/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/ToDoMVC/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/ToDoMVC/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /samples/ToDoMVC/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /samples/ToDoMVC/.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{"scriptPaths":[{"path":"WebContent\/todo","type":"FOLDER"},{"path":"WebContent\/todo-require","type":"FOLDER"}]},"plugins":{"angular":"..\/","requirejs":"..\/"},"libs":["browser","ecma5"]} -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todomvc-angular-requirejs", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "angular": "1.2.8", 6 | "todomvc-common": "~0.1.9", 7 | "requirejs": "~2.1.9" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/bower_components/todomvc-common/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/samples/ToDoMVC/WebContent/todo-require/bower_components/todomvc-common/bg.png -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/js/app.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | define(['angular'], function (angular) { 5 | return angular.module('todomvc', []); 6 | }); 7 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/js/controllers/todo.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | /** 5 | * The main controller for the app. The controller: 6 | * - retrieves and persist the model via the todoStorage service 7 | * - exposes the model to the template and provides event handlers 8 | */ 9 | 10 | define(['app', 'services/todoStorage'], function (app) { 11 | return app.controller('TodoController', ['$scope', '$location', 'todoStorage', 'filterFilter', 12 | function TodoController($scope, $location, todoStorage, filterFilter) { 13 | var todos = $scope.todos = todoStorage.get(); 14 | 15 | $scope.newTodo = ''; 16 | $scope.editedTodo = null; 17 | 18 | $scope.$watch('todos', function () { 19 | $scope.remainingCount = filterFilter(todos, { completed: false }).length; 20 | $scope.doneCount = todos.length - $scope.remainingCount; 21 | $scope.allChecked = !$scope.remainingCount; 22 | todoStorage.put(todos); 23 | }, true); 24 | 25 | if ($location.path() === '') { 26 | $location.path('/'); 27 | } 28 | 29 | $scope.location = $location; 30 | 31 | $scope.$watch('location.path()', function (path) { 32 | $scope.statusFilter = (path === '/active') ? 33 | { completed: false } : (path === '/completed') ? 34 | { completed: true } : null; 35 | }); 36 | 37 | 38 | $scope.addTodo = function () { 39 | var newTodo = $scope.newTodo.trim(); 40 | if (!newTodo.length) { 41 | return; 42 | } 43 | 44 | todos.push({ 45 | title: newTodo, 46 | completed: false 47 | }); 48 | 49 | $scope.newTodo = ''; 50 | }; 51 | 52 | 53 | $scope.editTodo = function (todo) { 54 | $scope.editedTodo = todo; 55 | }; 56 | 57 | 58 | $scope.doneEditing = function (todo) { 59 | $scope.editedTodo = null; 60 | todo.title = todo.title.trim(); 61 | 62 | if (!todo.title) { 63 | $scope.removeTodo(todo); 64 | } 65 | }; 66 | 67 | 68 | $scope.removeTodo = function (todo) { 69 | todos.splice(todos.indexOf(todo), 1); 70 | }; 71 | 72 | 73 | $scope.clearDoneTodos = function () { 74 | $scope.todos = todos = todos.filter(function (val) { 75 | return !val.completed; 76 | }); 77 | }; 78 | 79 | 80 | $scope.markAll = function (done) { 81 | todos.forEach(function (todo) { 82 | todo.completed = done; 83 | }); 84 | }; 85 | } 86 | ]); 87 | }); 88 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/js/directives/todoFocus.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | /** 4 | * Directive that places focus on the element it is applied to when the expression it binds to evaluates to true. 5 | */ 6 | define(['app'], function (app) { 7 | app.directive('todoFocus', ['$timeout', function ($timeout) { 8 | return function (scope, elem, attrs) { 9 | scope.$watch(attrs.todoFocus, function (newval) { 10 | if (newval) { 11 | $timeout(function () { 12 | elem[0].focus(); 13 | }, 0, false); 14 | } 15 | }); 16 | }; 17 | }]); 18 | }); 19 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/js/main.js: -------------------------------------------------------------------------------- 1 | /*global require*/ 2 | 'use strict'; 3 | 4 | /** 5 | * This is the configuration needed so require js knows where stuff is and how 6 | * 7 | */ 8 | require.config({ 9 | paths : { 10 | angular : '../bower_components/angular/angular' 11 | }, 12 | shim : { 13 | angular : { 14 | exports : 'angular' 15 | } 16 | } 17 | }); 18 | 19 | require([ 20 | 'angular', 'app', 'controllers/todo', 'directives/todoFocus' 21 | ], function (angular) { 22 | angular.bootstrap(document, [ 23 | 'todomvc' 24 | ]); 25 | }); 26 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo-require/js/services/todoStorage.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | /** 5 | * Services that persists and retrieves TODOs from localStorage. 6 | */ 7 | define(['app'], function (app) { 8 | app.factory('todoStorage', function () { 9 | var STORAGE_ID = 'todos-angularjs-requirejs'; 10 | 11 | return { 12 | get: function () { 13 | return JSON.parse(localStorage.getItem(STORAGE_ID) || '[]'); 14 | }, 15 | 16 | put: function (todos) { 17 | localStorage.setItem(STORAGE_ID, JSON.stringify(todos)); 18 | } 19 | }; 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todomvc-angular", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "angular": "1.2.14", 6 | "todomvc-common": "~0.1.4" 7 | }, 8 | "devDependencies": { 9 | "angular-mocks": "1.2.14", 10 | "angular-route": "1.2.14" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/bower_components/todomvc-common/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/samples/ToDoMVC/WebContent/todo/bower_components/todomvc-common/bg.png -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/js/app.js: -------------------------------------------------------------------------------- 1 | /*global angular */ 2 | 3 | /** 4 | * The main TodoMVC app module 5 | * 6 | * @type {angular.Module} 7 | */ 8 | angular.module('todomvc', ['ngRoute']) 9 | .config(function ($routeProvider) { 10 | 'use strict'; 11 | 12 | $routeProvider.when('/', { 13 | controller: 'TodoCtrl', 14 | templateUrl: 'todomvc-index.html' 15 | }).when('/:status', { 16 | controller: 'TodoCtrl', 17 | templateUrl: 'todomvc-index.html' 18 | }).otherwise({ 19 | redirectTo: '/' 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/js/controllers/todoCtrl.js: -------------------------------------------------------------------------------- 1 | /*global angular */ 2 | 3 | /** 4 | * The main controller for the app. The controller: 5 | * - retrieves and persists the model via the todoStorage service 6 | * - exposes the model to the template and provides event handlers 7 | */ 8 | angular.module('todomvc') 9 | .controller('TodoCtrl', function TodoCtrl($scope, $routeParams, $filter, todoStorage) { 10 | 'use strict'; 11 | 12 | var todos = $scope.todos = todoStorage.get(); 13 | 14 | $scope.newTodo = ''; 15 | $scope.editedTodo = null; 16 | 17 | $scope.$watch('todos', function (newValue, oldValue) { 18 | $scope.remainingCount = $filter('filter')(todos, { completed: false }).length; 19 | $scope.completedCount = todos.length - $scope.remainingCount; 20 | $scope.allChecked = !$scope.remainingCount; 21 | if (newValue !== oldValue) { // This prevents unneeded calls to the local storage 22 | todoStorage.put(todos); 23 | } 24 | }, true); 25 | 26 | // Monitor the current route for changes and adjust the filter accordingly. 27 | $scope.$on('$routeChangeSuccess', function () { 28 | var status = $scope.status = $routeParams.status || ''; 29 | 30 | $scope.statusFilter = (status === 'active') ? 31 | { completed: false } : (status === 'completed') ? 32 | { completed: true } : null; 33 | }); 34 | 35 | $scope.addTodo = function () { 36 | var newTodo = $scope.newTodo.trim(); 37 | if (!newTodo.length) { 38 | return; 39 | } 40 | 41 | todos.push({ 42 | title: newTodo, 43 | completed: false 44 | }); 45 | 46 | $scope.newTodo = ''; 47 | }; 48 | 49 | $scope.editTodo = function (todo) { 50 | $scope.editedTodo = todo; 51 | // Clone the original todo to restore it on demand. 52 | $scope.originalTodo = angular.extend({}, todo); 53 | }; 54 | 55 | $scope.doneEditing = function (todo) { 56 | $scope.editedTodo = null; 57 | todo.title = todo.title.trim(); 58 | 59 | if (!todo.title) { 60 | $scope.removeTodo(todo); 61 | } 62 | }; 63 | 64 | $scope.revertEditing = function (todo) { 65 | todos[todos.indexOf(todo)] = $scope.originalTodo; 66 | $scope.doneEditing($scope.originalTodo); 67 | }; 68 | 69 | $scope.removeTodo = function (todo) { 70 | todos.splice(todos.indexOf(todo), 1); 71 | }; 72 | 73 | $scope.clearCompletedTodos = function () { 74 | $scope.todos = todos = todos.filter(function (val) { 75 | return !val.completed; 76 | }); 77 | }; 78 | 79 | $scope.markAll = function (completed) { 80 | todos.forEach(function (todo) { 81 | todo.completed = !completed; 82 | }); 83 | }; 84 | }); 85 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/js/directives/todoEscape.js: -------------------------------------------------------------------------------- 1 | /*global angular */ 2 | 3 | /** 4 | * Directive that executes an expression when the element it is applied to gets 5 | * an `escape` keydown event. 6 | */ 7 | angular.module('todomvc') 8 | .directive('todoEscape', function () { 9 | 'use strict'; 10 | 11 | var ESCAPE_KEY = 27; 12 | 13 | return function (scope, elem, attrs) { 14 | elem.bind('keydown', function (event) { 15 | if (event.keyCode === ESCAPE_KEY) { 16 | scope.$apply(attrs.todoEscape); 17 | } 18 | }); 19 | }; 20 | }); 21 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/js/directives/todoFocus.js: -------------------------------------------------------------------------------- 1 | /*global angular */ 2 | 3 | /** 4 | * Directive that places focus on the element it is applied to when the 5 | * expression it binds to evaluates to true 6 | */ 7 | angular.module('todomvc') 8 | .directive('todoFocus', function todoFocus($timeout) { 9 | 'use strict'; 10 | 11 | return function (scope, elem, attrs) { 12 | scope.$watch(attrs.todoFocus, function (newVal) { 13 | if (newVal) { 14 | $timeout(function () { 15 | elem[0].focus(); 16 | }, 0, false); 17 | } 18 | }); 19 | }; 20 | }); 21 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/js/services/todoStorage.js: -------------------------------------------------------------------------------- 1 | /*global angular */ 2 | 3 | /** 4 | * Services that persists and retrieves TODOs from localStorage 5 | */ 6 | angular.module('todomvc') 7 | .factory('todoStorage', function () { 8 | 'use strict'; 9 | 10 | var STORAGE_ID = 'todos-angularjs'; 11 | 12 | return { 13 | get: function () { 14 | return JSON.parse(localStorage.getItem(STORAGE_ID) || '[]'); 15 | }, 16 | 17 | put: function (todos) { 18 | localStorage.setItem(STORAGE_ID, JSON.stringify(todos)); 19 | } 20 | }; 21 | }); 22 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/test/config/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | 'use strict'; 3 | 4 | config.set({ 5 | basePath: '../../', 6 | frameworks: ['jasmine'], 7 | files: [ 8 | 'bower_components/angular/angular.js', 9 | 'bower_components/angular-route/angular-route.js', 10 | 'bower_components/angular-mocks/angular-mocks.js', 11 | 'js/**/*.js', 12 | 'test/unit/**/*.js' 13 | ], 14 | autoWatch: true, 15 | singleRun: false, 16 | browsers: ['Chrome', 'Firefox'] 17 | }); 18 | }; 19 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todomvc-angular-tests", 3 | "description": "Unit tests for the AngularJS example of TodoMVC", 4 | "author": "Pascal Hartig ", 5 | "version": "1.0.0", 6 | "devDependencies": { 7 | "karma": "~1.0.0" 8 | }, 9 | "scripts": { 10 | "test": "karma start config/karma.conf.js" 11 | }, 12 | "dependencies": {} 13 | } 14 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/test/readme.md: -------------------------------------------------------------------------------- 1 | Angular Unit Tests 2 | ================== 3 | 4 | To run the test suite, run these commands: 5 | 6 | npm install 7 | npm test 8 | -------------------------------------------------------------------------------- /samples/ToDoMVC/WebContent/todo/test/unit/directivesSpec.js: -------------------------------------------------------------------------------- 1 | /*global describe, it, beforeEach, inject, expect, angular*/ 2 | (function () { 3 | 'use strict'; 4 | 5 | beforeEach(module('todomvc')); 6 | 7 | describe('todoFocus directive', function () { 8 | var scope, compile, browser; 9 | 10 | beforeEach(inject(function ($rootScope, $compile, $browser) { 11 | scope = $rootScope.$new(); 12 | compile = $compile; 13 | browser = $browser; 14 | })); 15 | 16 | it('should focus on truthy expression', function () { 17 | var el = angular.element(''); 18 | scope.focus = false; 19 | 20 | compile(el)(scope); 21 | expect(browser.deferredFns.length).toBe(0); 22 | 23 | scope.$apply(function () { 24 | scope.focus = true; 25 | }); 26 | 27 | expect(browser.deferredFns.length).toBe(1); 28 | }); 29 | }); 30 | }()); 31 | -------------------------------------------------------------------------------- /samples/angular-bootstrap/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | angular-bootstrap 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/angular-bootstrap/.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "angular": { 4 | 5 | } 6 | }, 7 | "libs": [ 8 | "browser", 9 | "ecma5" 10 | ] 11 | } -------------------------------------------------------------------------------- /samples/angular-bootstrap/app.js: -------------------------------------------------------------------------------- 1 | var app = angular.module("app", []); 2 | 3 | app.run(function($rootScope) { 4 | $rootScope.random = Math.random() 5 | }) 6 | 7 | angular.bootstrap(document.getElementById("container"), ["app"]) 8 | angular.bootstrap(document.getElementById("container2"), ["app"]) -------------------------------------------------------------------------------- /samples/angular-bootstrap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Egghead Videos 6 | 7 | 8 | 9 |
10 | {{random}} 11 |
12 | 13 |
14 | {{random}} 15 |
16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/angularjs-controller-tutorial/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | angularjs-controller-tutorial 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/angularjs-controller-tutorial/.tern-project: -------------------------------------------------------------------------------- 1 | {"plugins":{"angular":{}},"libs":["browser","ecma5"],"ide":{}} -------------------------------------------------------------------------------- /samples/angularjs-controller-tutorial/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World, AngularJS - ViralPatel.net 5 | 7 | 8 | 9 |
10 | Email: 11 | 12 |

Contacts

13 | 14 |
    15 |
  • {{ contact }}
  • 16 |
17 | 18 |
19 | 29 | -------------------------------------------------------------------------------- /samples/basic/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | basic 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/basic/.tern-project: -------------------------------------------------------------------------------- 1 | {"plugins":{"angular":{}},"libs":["browser","ecma5"],"ide":{}} -------------------------------------------------------------------------------- /samples/basic/boolean.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Hello {{ name }}!

9 | 10 | -------------------------------------------------------------------------------- /samples/basic/string.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Hello {{ name }}!

9 | 10 | -------------------------------------------------------------------------------- /samples/custom-directive/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | custom-directive 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/custom-directive/.tern-project: -------------------------------------------------------------------------------- 1 | {"plugins":{"angular":{}},"libs":["browser","ecma5"],"ide":{}} -------------------------------------------------------------------------------- /samples/custom-directive/directive-with-parameters.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /samples/custom-directive/directive-with-parameters.html.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /samples/custom-directive/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /samples/custom-directive/script.js: -------------------------------------------------------------------------------- 1 | angular.module('docsSimpleDirective', []) 2 | .controller('Ctrl', function($scope) { 3 | $scope.customer = { 4 | name: 'Naomi', 5 | address: '1600 Amphitheatre' 6 | }; 7 | }) 8 | .directive('myCustomer', function() { 9 | return { 10 | template: 'Name: {{customer.name}} Address: {{customer.address}}' 11 | }; 12 | }); -------------------------------------------------------------------------------- /samples/store/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | store 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/store/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | DELEGATES_PREFERENCE=delegateValidatorList 2 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 3 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 4 | USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.501.qualifier 5 | eclipse.preferences.version=1 6 | override=true 7 | suspend=false 8 | vals/org.eclipse.wst.html.core.HTMLValidator/global=FF01 9 | vf.version=3 10 | -------------------------------------------------------------------------------- /samples/store/.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{"scriptPaths":[{"type":"FILE","path":"app/app.js"}]},"plugins":{"angular":{}},"libs":["browser","ecma5"]} -------------------------------------------------------------------------------- /samples/store/app/app.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var app = angular.module('store',[ ]); 3 | 4 | app.controller('StoreController', function(){ 5 | this.product = gem; 6 | this.products = gems; 7 | }); 8 | 9 | var gem = { 10 | name: 'Dodecahedron', 11 | price: 2.95, 12 | description: '. . .', 13 | } 14 | 15 | var gems = [gem]; 16 | })(); -------------------------------------------------------------------------------- /samples/store/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |

{{store.product.name}}

9 | 10 |
11 | {{p.price}} 12 |
13 |
14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/todos-controllerAs/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | todos-controllerAs 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/todos-controllerAs/.settings/tern.eclipse.ide.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | traceOnConsole=true 3 | -------------------------------------------------------------------------------- /samples/todos-controllerAs/.tern-project: -------------------------------------------------------------------------------- 1 | {"plugins":{"angular":{}},"libs":["browser","ecma5"],"ide":{}} -------------------------------------------------------------------------------- /samples/todos-controllerAs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Todo

10 |
11 | {{remaining()}} of {{todos.length}} remaining 12 | [ archive ] 13 |
    14 |
  • 15 | 16 | {{todo.text}} 17 |
  • 18 |
19 |
20 | 22 | 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /samples/todos-controllerAs/todo.css: -------------------------------------------------------------------------------- 1 | .done-true { 2 | text-decoration: line-through; 3 | color: grey; 4 | } -------------------------------------------------------------------------------- /samples/todos-controllerAs/todo.js: -------------------------------------------------------------------------------- 1 | function TodoCtrl($scope) { 2 | $scope.todos = [ 3 | {text:'learn angular', done:true}, 4 | {text:'build an angular app', done:false}]; 5 | 6 | $scope.addTodo = function() { 7 | $scope.todos.push({text:$scope.todoText, done:false}); 8 | $scope.todoText = ''; 9 | }; 10 | 11 | $scope.remaining = function() { 12 | var count = 0; 13 | angular.forEach($scope.todos, function(todo) { 14 | count += todo.done ? 0 : 1; 15 | }); 16 | return count; 17 | }; 18 | 19 | $scope.archive = function() { 20 | var oldTodos = $scope.todos; 21 | $scope.todos = []; 22 | angular.forEach(oldTodos, function(todo) { 23 | if (!todo.done) $scope.todos.push(todo); 24 | }); 25 | }; 26 | } -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | todos-interpolateProvider 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.settings/org.eclipse.angularjs.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | endSymbol=$} 3 | startSymbol={$ 4 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | DELEGATES_PREFERENCE=delegateValidatorList 2 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 3 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 4 | USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.501.v201311151800 5 | eclipse.preferences.version=1 6 | override=true 7 | suspend=false 8 | vals/org.eclipse.wst.html.core.HTMLValidator/global=FF01 9 | vf.version=3 10 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.settings/tern.eclipse.ide.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | traceOnConsole=true 3 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.tern-port: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{},"plugins":{"angular":{}},"libs":["browser","ecma5"]} -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Todo

10 |
11 | {$remaining()$} of {$todos.length$} remaining 12 | [ archive ] 13 |
    14 |
  • 15 | 16 | {$todo.text$} 17 |
  • 18 |
19 |
20 | 22 | 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/index.html.jsp: -------------------------------------------------------------------------------- 1 | "samples/todos-interpolateProvider/index.html.jsp" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Todo

10 |
11 | {$remaining()$} of {$todos.length$} remaining 12 | [ archive ] 13 |
    14 |
  • 15 | 16 | {$todo.text$} 17 |
  • 18 |
19 |
20 | 22 | 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/todo.css: -------------------------------------------------------------------------------- 1 | .done-true { 2 | text-decoration: line-through; 3 | color: grey; 4 | } -------------------------------------------------------------------------------- /samples/todos-interpolateProvider/todo.js: -------------------------------------------------------------------------------- 1 | function TodoCtrl($scope) { 2 | $scope.todos = [ 3 | {text:'learn angular', done:true}, 4 | {text:'build an angular app', done:false}]; 5 | 6 | $scope.addTodo = function() { 7 | $scope.todos.push({text:$scope.todoText, done:false}); 8 | $scope.todoText = ''; 9 | }; 10 | 11 | $scope.remaining = function() { 12 | var count = 0; 13 | angular.forEach($scope.todos, function(todo) { 14 | count += todo.done ? 0 : 1; 15 | }); 16 | return count; 17 | }; 18 | 19 | $scope.archive = function() { 20 | var oldTodos = $scope.todos; 21 | $scope.todos = []; 22 | angular.forEach(oldTodos, function(todo) { 23 | if (!todo.done) $scope.todos.push(todo); 24 | }); 25 | }; 26 | } -------------------------------------------------------------------------------- /samples/todos-requirejs/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | todos-requirejs 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/todos-requirejs/.settings/tern.eclipse.ide.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | traceOnConsole=true 3 | -------------------------------------------------------------------------------- /samples/todos-requirejs/.tern-project: -------------------------------------------------------------------------------- 1 | {"ide":{"scriptPaths":[{"type":"FOLDER","path":"WebContent/js"},{"type":"FILE","path":"angular-mock.js"}]},"plugins":{"angular":{},"requirejs":{"paths":{"angular":"../../angular-mock"},"baseURL":"WebContent/js"}},"libs":["browser","ecma5"]} -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todomvc-angular-requirejs", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "angular": "1.2.8", 6 | "todomvc-common": "~0.1.9", 7 | "requirejs": "~2.1.9" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/bower_components/todomvc-common/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angelozerr/angularjs-eclipse/3becdcef04c5182f1ff7d7e7a0e96a2c9d0b0424/samples/todos-requirejs/WebContent/bower_components/todomvc-common/bg.png -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/js/app.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | define(['angular'], function (angular) { 5 | return angular.module('todomvc', []); 6 | }); 7 | -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/js/controllers/todo.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | /** 5 | * The main controller for the app. The controller: 6 | * - retrieves and persist the model via the todoStorage service 7 | * - exposes the model to the template and provides event handlers 8 | */ 9 | 10 | define(['app', 'services/todoStorage'], function (app) { 11 | return app.controller('TodoController', ['$scope', '$location', 'todoStorage', 'filterFilter', 12 | function TodoController($scope, $location, todoStorage, filterFilter) { 13 | var todos = $scope.todos = todoStorage.get(); 14 | 15 | $scope.newTodo = ''; 16 | $scope.editedTodo = null; 17 | 18 | $scope.$watch('todos', function () { 19 | $scope.remainingCount = filterFilter(todos, { completed: false }).length; 20 | $scope.doneCount = todos.length - $scope.remainingCount; 21 | $scope.allChecked = !$scope.remainingCount; 22 | todoStorage.put(todos); 23 | }, true); 24 | 25 | if ($location.path() === '') { 26 | $location.path('/'); 27 | } 28 | 29 | $scope.location = $location; 30 | 31 | $scope.$watch('location.path()', function (path) { 32 | $scope.statusFilter = (path === '/active') ? 33 | { completed: false } : (path === '/completed') ? 34 | { completed: true } : null; 35 | }); 36 | 37 | 38 | $scope.addTodo = function () { 39 | var newTodo = $scope.newTodo.trim(); 40 | if (!newTodo.length) { 41 | return; 42 | } 43 | 44 | todos.push({ 45 | title: newTodo, 46 | completed: false 47 | }); 48 | 49 | $scope.newTodo = ''; 50 | }; 51 | 52 | 53 | $scope.editTodo = function (todo) { 54 | $scope.editedTodo = todo; 55 | }; 56 | 57 | 58 | $scope.doneEditing = function (todo) { 59 | $scope.editedTodo = null; 60 | todo.title = todo.title.trim(); 61 | 62 | if (!todo.title) { 63 | $scope.removeTodo(todo); 64 | } 65 | }; 66 | 67 | 68 | $scope.removeTodo = function (todo) { 69 | todos.splice(todos.indexOf(todo), 1); 70 | }; 71 | 72 | 73 | $scope.clearDoneTodos = function () { 74 | $scope.todos = todos = todos.filter(function (val) { 75 | return !val.completed; 76 | }); 77 | }; 78 | 79 | 80 | $scope.markAll = function (done) { 81 | todos.forEach(function (todo) { 82 | todo.completed = done; 83 | }); 84 | }; 85 | } 86 | ]); 87 | }); 88 | -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/js/directives/todoFocus.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | /** 4 | * Directive that places focus on the element it is applied to when the expression it binds to evaluates to true. 5 | */ 6 | define(['app'], function (app) { 7 | app.directive('todoFocus', ['$timeout', function ($timeout) { 8 | return function (scope, elem, attrs) { 9 | scope.$watch(attrs.todoFocus, function (newval) { 10 | if (newval) { 11 | $timeout(function () { 12 | elem[0].focus(); 13 | }, 0, false); 14 | } 15 | }); 16 | }; 17 | }]); 18 | }); 19 | -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/js/main.js: -------------------------------------------------------------------------------- 1 | /*global require*/ 2 | 'use strict'; 3 | 4 | /** 5 | * This is the configuration needed so require js knows where stuff is and how 6 | * 7 | */ 8 | require.config({ 9 | paths : { 10 | angular : '../bower_components/angular/angular' 11 | }, 12 | shim : { 13 | angular : { 14 | exports : 'angular' 15 | } 16 | } 17 | }); 18 | 19 | require([ 20 | 'angular', 'app', 'controllers/todo', 'directives/todoFocus' 21 | ], function (angular) { 22 | angular.bootstrap(document, [ 23 | 'todomvc' 24 | ]); 25 | }); 26 | -------------------------------------------------------------------------------- /samples/todos-requirejs/WebContent/js/services/todoStorage.js: -------------------------------------------------------------------------------- 1 | /*global define*/ 2 | 'use strict'; 3 | 4 | /** 5 | * Services that persists and retrieves TODOs from localStorage. 6 | */ 7 | define(['app'], function (app) { 8 | app.factory('todoStorage', function () { 9 | var STORAGE_ID = 'todos-angularjs-requirejs'; 10 | 11 | return { 12 | get: function () { 13 | return JSON.parse(localStorage.getItem(STORAGE_ID) || '[]'); 14 | }, 15 | 16 | put: function (todos) { 17 | localStorage.setItem(STORAGE_ID, JSON.stringify(todos)); 18 | } 19 | }; 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /samples/todos-requirejs/angular-mock.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return angular; 3 | }); -------------------------------------------------------------------------------- /samples/todos/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | todos 4 | 5 | 6 | 7 | 8 | 9 | tern.eclipse.ide.core.ternBuilder 10 | 11 | 12 | 13 | 14 | 15 | tern.eclipse.ide.core.ternnature 16 | org.eclipse.angularjs.core.angularnature 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/todos/.settings/tern.eclipse.ide.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | traceOnConsole=true 3 | -------------------------------------------------------------------------------- /samples/todos/.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "angular": { 4 | 5 | } 6 | }, 7 | "libs": [ 8 | "browser", 9 | "ecma5" 10 | ] 11 | } -------------------------------------------------------------------------------- /samples/todos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Todo

10 |
11 | {{remaining()}} of {{todos.length}} remaining 12 | [ archive ] 13 |
    14 |
  • 15 | 16 | {{todo.text}} 17 |
  • 18 |
19 |
20 | 22 | 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /samples/todos/todo.css: -------------------------------------------------------------------------------- 1 | .done-true { 2 | text-decoration: line-through; 3 | color: grey; 4 | } -------------------------------------------------------------------------------- /samples/todos/todo.js: -------------------------------------------------------------------------------- 1 | function TodoCtrl($scope) { 2 | $scope.todos = [ 3 | {text:'learn angular', done:true}, 4 | {text:'build an angular app', done:false}]; 5 | 6 | $scope.addTodo = function() { 7 | $scope.todos.push({text:$scope.todoText, done:false}); 8 | $scope.todoText = ''; 9 | }; 10 | 11 | $scope.remaining = function() { 12 | var count = 0; 13 | angular.forEach($scope.todos, function(todo) { 14 | count += todo.done ? 0 : 1; 15 | }); 16 | return count; 17 | }; 18 | 19 | $scope.archive = function() { 20 | var oldTodos = $scope.todos; 21 | $scope.todos = []; 22 | angular.forEach(oldTodos, function(todo) { 23 | if (!todo.done) $scope.todos.push(todo); 24 | }); 25 | }; 26 | } --------------------------------------------------------------------------------