- 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 |
22 |
23 |
24 |
25 |
26 | -
32 |
33 | {{ slave.id }}
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | -
43 |
44 |
45 | {{ slave.id }}
46 |
47 |
48 |
49 | {{ slave.x }}px
50 | {{ slave.y }}px
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
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 |
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 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/custom-directive/directive-with-parameters.html.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/custom-directive/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
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 |
19 |
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 |
19 |
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 |
19 |
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 |
19 |
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 | }
--------------------------------------------------------------------------------