rules = new ArrayList<>();
44 |
45 | // rule for reference
46 | rules.add(new EndOfLineRule("///", new Token(TS_REFERENCE)));
47 |
48 | // Add rule for single line comments.
49 | rules.add(new EndOfLineRule("//", comment));
50 |
51 | // Add rule for strings and character constants.
52 | rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\'));
53 | rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\'));
54 | rules.add(new SingleLineRule("`", "`", Token.UNDEFINED, '\\'));
55 |
56 | // Add rules for multi-line comments and javadoc.
57 | rules.add(new MultiLineRule("/**", "*/", javaDoc, (char) 0, true));
58 | rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true));
59 |
60 | IPredicateRule[] result = new IPredicateRule[rules.size()];
61 | rules.toArray(result);
62 | setPredicateRules(result);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptTokenConstants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript.editor.parser;
9 |
10 | /**
11 | * @author Konstantin Zaitcev
12 | */
13 | public final class TypeScriptTokenConstants {
14 | /** Token constant. */
15 | public static final String TS_DEFAULT = "ts_default";
16 | /** Token constant. */
17 | public static final String TS_REFERENCE = "ts_reference";
18 | /** Token constant. */
19 | public static final String TS_KEYWORD = "ts_keyword";
20 | /** Token constant. */
21 | public static final String TS_STRING = "ts_string";
22 | /** Token constant. */
23 | public static final String TS_COMMENT = "ts_comment";
24 | /** Token constant. */
25 | public static final String TS_NUMBER = "ts_number";
26 | /** Token constant. */
27 | public static final String TS_JAVA_DOC = "ts_java_doc";
28 | /** Token constant. */
29 | public static final String TS_BRACKETS = "ts_brackets";
30 | /** Token constant. */
31 | public static final String TS_BOLD_SUFFIX = "_bold";
32 | /** Token constant. */
33 | public static final String TS_ITALIC_SUFFIX = "_italic";
34 |
35 | /**
36 | * Protect from initialization.
37 | */
38 | private TypeScriptTokenConstants() {
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptWhitespaceDetector.java:
--------------------------------------------------------------------------------
1 | package com.axmor.eclipse.typescript.editor.parser;
2 |
3 | import org.eclipse.jface.text.rules.IWhitespaceDetector;
4 |
5 | /**
6 | * Class that helps to detect whitespaces
7 | *
8 | * @author Konstantin Zaitcev
9 | */
10 | public class TypeScriptWhitespaceDetector implements IWhitespaceDetector {
11 | @Override
12 | public boolean isWhitespace(char c) {
13 | return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/SyntaxPreviewCode.txt:
--------------------------------------------------------------------------------
1 | ///
2 | module module1 {
3 | /**
4 | * This is about Greeter.
5 | */
6 | class Greeter implements IGreeter {
7 | /* This comment may span multiple lines. */
8 | constructor(public greeting: string) { }
9 | // This comment may span only this line
10 | greet() {
11 | return "" + this.greeting + "
";
12 | }
13 | };
14 | interface IGreeter {
15 | greet(): string;
16 | }
17 | var greeter: IGreeter = new Greeter("Hello, world!");
18 | var str = greeter.greet();
19 | var num1: number = 123;
20 | document.body.innerHTML = str;
21 | }
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/TypescriptPreviewerUpdater.java:
--------------------------------------------------------------------------------
1 | package com.axmor.eclipse.typescript.editor.preferences;
2 |
3 | import org.eclipse.jface.preference.IPreferenceStore;
4 | import org.eclipse.jface.text.source.SourceViewer;
5 | import org.eclipse.jface.util.IPropertyChangeListener;
6 | import org.eclipse.jface.util.PropertyChangeEvent;
7 | import org.eclipse.swt.events.DisposeEvent;
8 | import org.eclipse.swt.events.DisposeListener;
9 |
10 | import com.axmor.eclipse.typescript.editor.TypeScriptEditorConfiguration;
11 |
12 | public class TypescriptPreviewerUpdater {
13 |
14 | public TypescriptPreviewerUpdater(final SourceViewer viewer, final TypeScriptEditorConfiguration configuration, final IPreferenceStore preferenceStore) {
15 | final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() {
16 | /*
17 | * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
18 | */
19 | public void propertyChange(PropertyChangeEvent event) {
20 | if (configuration.affectsTextPresentation(event)) {
21 | configuration.adaptToPreferenceChange(event);
22 | viewer.invalidateTextPresentation();
23 | }
24 | }
25 | };
26 | viewer.getTextWidget().addDisposeListener(new DisposeListener() {
27 | /*
28 | * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
29 | */
30 | public void widgetDisposed(DisposeEvent e) {
31 | preferenceStore.removePropertyChangeListener(propertyChangeListener);
32 | }
33 | });
34 | preferenceStore.addPropertyChangeListener(propertyChangeListener);
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/TypescriptTemplateContextType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript.editor.preferences;
9 |
10 | import org.eclipse.jface.text.templates.GlobalTemplateVariables;
11 | import org.eclipse.jface.text.templates.TemplateContextType;
12 |
13 | /**
14 | * @author kudrin
15 | *
16 | */
17 | public class TypescriptTemplateContextType extends TemplateContextType {
18 |
19 | /** This context's id */
20 | public static final String TYPESCRIPT_CONTEXT_TYPE = "typeScript"; //$NON-NLS-1$
21 |
22 | /**
23 | * Creates a new XML context type.
24 | */
25 | public TypescriptTemplateContextType() {
26 | addGlobalResolvers();
27 | }
28 |
29 | private void addGlobalResolvers() {
30 | addResolver(new GlobalTemplateVariables.Cursor());
31 | addResolver(new GlobalTemplateVariables.WordSelection());
32 | addResolver(new GlobalTemplateVariables.LineSelection());
33 | addResolver(new GlobalTemplateVariables.Dollar());
34 | addResolver(new GlobalTemplateVariables.Date());
35 | addResolver(new GlobalTemplateVariables.Year());
36 | addResolver(new GlobalTemplateVariables.Time());
37 | addResolver(new GlobalTemplateVariables.User());
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/rename/RenameInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript.editor.rename;
9 |
10 | /**
11 | * Rename refactor information Java bean.
12 | *
13 | * @author Konstantin Zaitcev
14 | */
15 | public class RenameInfo {
16 |
17 | /** An old name. */
18 | private String oldName;
19 | /** A new name. */
20 | private String newName;
21 | /** File path. */
22 | private String path;
23 | /** Position of old name. */
24 | private int position;
25 |
26 | /**
27 | * @return the oldName
28 | */
29 | public String getOldName() {
30 | return oldName;
31 | }
32 |
33 | /**
34 | * @param oldName
35 | * the oldName to set
36 | */
37 | public void setOldName(String oldName) {
38 | this.oldName = oldName;
39 | }
40 |
41 | /**
42 | * @return the newName
43 | */
44 | public String getNewName() {
45 | return newName;
46 | }
47 |
48 | /**
49 | * @param newName
50 | * the newName to set
51 | */
52 | public void setNewName(String newName) {
53 | this.newName = newName;
54 | }
55 |
56 | /**
57 | * @return the path
58 | */
59 | public String getPath() {
60 | return path;
61 | }
62 |
63 | /**
64 | * @param path
65 | * the path to set
66 | */
67 | public void setPath(String path) {
68 | this.path = path;
69 | }
70 |
71 | /**
72 | * @return the position
73 | */
74 | public int getPosition() {
75 | return position;
76 | }
77 |
78 | /**
79 | * @param position
80 | * the position to set
81 | */
82 | public void setPosition(int position) {
83 | this.position = position;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/rename/RenameWizard.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript.editor.rename;
9 |
10 | import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
11 | import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
12 |
13 | /**
14 | * @author Konstantin Zaitcev
15 | */
16 | public class RenameWizard extends RefactoringWizard {
17 |
18 | /** Rename info bean. */
19 | private final RenameInfo info;
20 |
21 | /**
22 | * Constructor.
23 | *
24 | * @param processor
25 | * refactoring processor
26 | * @param info
27 | * rename info bean
28 | */
29 | public RenameWizard(final RenameProcessor processor, final RenameInfo info) {
30 | super(new ProcessorBasedRefactoring(processor), RefactoringWizard.WIZARD_BASED_USER_INTERFACE);
31 | this.info = info;
32 | setDefaultPageTitle("Rename Element");
33 | }
34 |
35 | @Override
36 | protected void addUserInputPages() {
37 | addPage(new RenameInputPage(info));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/semantichighlight/TypeScriptPresentationReconciler.java:
--------------------------------------------------------------------------------
1 | package com.axmor.eclipse.typescript.editor.semantichighlight;
2 |
3 | import org.eclipse.jface.text.IDocument;
4 | import org.eclipse.jface.text.IRegion;
5 | import org.eclipse.jface.text.TextPresentation;
6 | import org.eclipse.jface.text.presentation.PresentationReconciler;
7 |
8 | public class TypeScriptPresentationReconciler extends PresentationReconciler {
9 |
10 | /** Last used document */
11 | private IDocument fLastDocument;
12 |
13 | /**
14 | * Constructs a "repair description" for the given damage and returns this description as a text
15 | * presentation.
16 | *
17 | * NOTE: Should not be used if this reconciler is installed on a viewer.
18 | *
19 | */
20 | public TextPresentation createRepairDescription(IRegion damage, IDocument document) {
21 | if (document != fLastDocument) {
22 | setDocumentToDamagers(document);
23 | setDocumentToRepairers(document);
24 | fLastDocument = document;
25 | }
26 | return createPresentation(damage, document);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/semantichighlight/TypeScriptSemanticHighlighting.java:
--------------------------------------------------------------------------------
1 | package com.axmor.eclipse.typescript.editor.semantichighlight;
2 |
3 | import org.eclipse.swt.graphics.RGB;
4 |
5 | import us.monoid.json.JSONObject;
6 |
7 | public abstract class TypeScriptSemanticHighlighting {
8 |
9 | /**
10 | * @return the preference key, will be augmented by a prefix and a suffix for each preference
11 | */
12 | public abstract String getPreferenceKey();
13 |
14 | /**
15 | * @return the default default text color
16 | */
17 | public abstract RGB getDefaultTextColor();
18 |
19 | /**
20 | * @return true
if the text attribute bold is set by default
21 | */
22 | public abstract boolean isBoldByDefault();
23 |
24 | /**
25 | * @return true
if the text attribute italic is set by default
26 | */
27 | public abstract boolean isItalicByDefault();
28 |
29 | /**
30 | * @return true
if the text attribute italic is enabled by default
31 | */
32 | public abstract boolean isEnabledByDefault();
33 |
34 | /**
35 | * @return the display name
36 | */
37 | public abstract String getDisplayName();
38 |
39 | public abstract boolean consumes(JSONObject obj);
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/wizards/NewClassCode.txt:
--------------------------------------------------------------------------------
1 | /**
2 | * New typescript file
3 | */
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.editor/templates/typescript-default.properties:
--------------------------------------------------------------------------------
1 | Templates.for_array=iterate over array
2 | Templates.for_temp=iterate over array with temporary variable
3 | Templates.for_iterable=iterate using for .. in
4 | Templates.do=do while statement
5 | Templates.switch=switch case statement
6 | Templates.if=if statement
7 | Templates.ifelse=if else statement
8 | Templates.elseif=else if block
9 | Templates.else=else block
10 | Templates.try=try catch block
11 | Templates.catch=catch block
12 | Templates.public_method=function
13 | Templates.anonymous_public_method=anonymous function
14 | Templates.new=create new object
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.axmor.eclipse.typescript.feature
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.pde.FeatureBuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.pde.FeatureNature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/build.properties:
--------------------------------------------------------------------------------
1 | bin.includes = feature.xml,\
2 | epl-v10.html,\
3 | feature.properties
4 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/feature.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.feature/feature.properties
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/feature.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 | %description
11 |
12 |
13 |
14 | %copyright
15 |
16 |
17 |
18 | %license
19 |
20 |
21 |
24 |
25 |
28 |
29 |
32 |
33 |
38 |
39 |
44 |
45 |
51 |
52 |
58 |
59 |
65 |
66 |
72 |
73 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.feature/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 |
6 | com.axmor.eclipse.typescript
7 | product
8 | 4.0.0-SNAPSHOT
9 |
10 |
11 | com.axmor.eclipse.typescript
12 | com.axmor.eclipse.typescript.feature
13 | eclipse-feature
14 |
15 | TypEcs Feature
16 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.repository/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.axmor.eclipse.typescript.repository
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.repository/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.repository/category.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.repository/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 |
6 | com.axmor.eclipse.typescript
7 | product
8 | 4.0.0-SNAPSHOT
9 |
10 |
11 | com.axmor.eclipse.typescript
12 | com.axmor.eclipse.typescript.repository
13 | eclipse-repository
14 |
15 | TypEcs Update Site Repository
16 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.axmor.eclipse.typescript.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 | net.sf.eclipsecs.core.CheckstyleBuilder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.pde.PluginNature
31 | org.eclipse.jdt.core.javanature
32 | net.sf.eclipsecs.core.CheckstyleNature
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.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.7
4 | org.eclipse.jdt.core.compiler.compliance=1.7
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.7
8 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: TypEcs UI Plugin
4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.ui; singleton:=true
5 | Bundle-Version: 4.0.0.qualifier
6 | Bundle-Activator: com.axmor.eclipse.typescript.ui.Activator
7 | Bundle-Vendor: Axmor Software Inc.
8 | Require-Bundle: org.eclipse.ui,
9 | org.eclipse.ui.views,
10 | com.axmor.eclipse.typescript.core,
11 | org.eclipse.core.runtime,
12 | org.eclipse.ui.console
13 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7
14 | Bundle-ActivationPolicy: lazy
15 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/
2 | output.. = target/classes
3 | bin.includes = plugin.xml,\
4 | META-INF/,\
5 | .,\
6 | icons/
7 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/icons/typecs16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.ui/icons/typecs16.png
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 |
6 | com.axmor.eclipse.typescript
7 | product
8 | 4.0.0-SNAPSHOT
9 |
10 |
11 | com.axmor.eclipse.typescript
12 | com.axmor.eclipse.typescript.ui
13 | eclipse-plugin
14 |
15 | TypEcs UI Plugin
16 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/PerspectiveFactory.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript;
9 |
10 | import org.eclipse.ui.IFolderLayout;
11 | import org.eclipse.ui.IPageLayout;
12 | import org.eclipse.ui.IPerspectiveFactory;
13 | import org.eclipse.ui.console.IConsoleConstants;
14 |
15 | /**
16 | * @author Konstantin Zaitcev
17 | */
18 | public class PerspectiveFactory implements IPerspectiveFactory {
19 |
20 | @Override
21 | public void createInitialLayout(IPageLayout layout) {
22 | String editorArea = layout.getEditorArea();
23 | layout.setEditorAreaVisible(true);
24 |
25 | IFolderLayout leftFolder = layout.createFolder("left", IPageLayout.LEFT, 0.22f, editorArea);
26 | IFolderLayout bottomFolder = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.65f, editorArea);
27 | IFolderLayout rightFolder = layout.createFolder("right", IPageLayout.RIGHT, 0.80f, editorArea);
28 |
29 | leftFolder.addView("org.eclipse.ui.navigator.ProjectExplorer");
30 | leftFolder.addView("org.eclipse.jdt.ui.PackageExplorer");
31 |
32 |
33 | bottomFolder.addView("org.eclipse.ui.views.ProblemView");
34 | bottomFolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
35 |
36 | rightFolder.addView("org.eclipse.ui.views.ContentOutline");
37 |
38 | layout.addActionSet("org.eclipse.debug.ui.launchActionSet");
39 |
40 | layout.addNewWizardShortcut("com.axmor.eclipse.typescript.editor.wizards.NewClassWizard");
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/ui/Activator.java:
--------------------------------------------------------------------------------
1 | package com.axmor.eclipse.typescript.ui;
2 |
3 | import org.eclipse.core.runtime.Status;
4 | import org.eclipse.jface.resource.ImageDescriptor;
5 | import org.eclipse.ui.plugin.AbstractUIPlugin;
6 | import org.osgi.framework.BundleContext;
7 |
8 | /**
9 | * The activator class controls the plug-in life cycle
10 | */
11 | public class Activator extends AbstractUIPlugin {
12 |
13 | /**
14 | * The plug-in ID
15 | */
16 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.ui"; //$NON-NLS-1$
17 |
18 | /**
19 | * The shared instance
20 | */
21 | private static Activator plugin;
22 |
23 | /**
24 | * The constructor
25 | */
26 | public Activator() {
27 | }
28 |
29 | @Override
30 | public void start(BundleContext context) throws Exception {
31 | super.start(context);
32 | plugin = this;
33 | }
34 |
35 | @Override
36 | public void stop(BundleContext context) throws Exception {
37 | try {
38 | plugin = null;
39 | } finally {
40 | super.stop(context);
41 | }
42 | }
43 |
44 | /**
45 | * Returns the shared instance
46 | *
47 | * @return the shared instance
48 | */
49 | public static Activator getDefault() {
50 | return plugin;
51 | }
52 |
53 | /**
54 | * Returns an image descriptor for the image file at the given plug-in relative path
55 | *
56 | * @param path
57 | * the path
58 | * @return the image descriptor
59 | */
60 | public static ImageDescriptor getImageDescriptor(String path) {
61 | return imageDescriptorFromPlugin(PLUGIN_ID, path);
62 | }
63 |
64 | /**
65 | * Print error message to Error log.
66 | *
67 | * @param e
68 | * exception
69 | */
70 | public static void error(final Exception e) {
71 | plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/ui/Startup.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2014 Axmor Inc.
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 | package com.axmor.eclipse.typescript.ui;
9 |
10 | import org.eclipse.core.runtime.preferences.ConfigurationScope;
11 | import org.eclipse.core.runtime.preferences.IEclipsePreferences;
12 | import org.eclipse.ui.IPerspectiveDescriptor;
13 | import org.eclipse.ui.IStartup;
14 | import org.eclipse.ui.IWorkbench;
15 | import org.eclipse.ui.IWorkbenchWindow;
16 | import org.eclipse.ui.PlatformUI;
17 | import org.osgi.service.prefs.BackingStoreException;
18 |
19 | /**
20 | * @author Konstantin Zaitcev
21 | */
22 | public class Startup implements IStartup {
23 |
24 | /** First start indicator to show TypeScript perspective. */
25 | private static final String CFG_SHOW_PERSPECTIVE_KEY = "show_perspective";
26 |
27 | /** TypeScript perspective identifier. */
28 | private static final String TYPESCRIPT_PERSPECTIVE_ID = "com.axmor.eclipse.typescript.perspective";
29 |
30 | @Override
31 | public void earlyStartup() {
32 | IEclipsePreferences pref = ConfigurationScope.INSTANCE.getNode(this.getClass().getName());
33 | if (pref.getBoolean(CFG_SHOW_PERSPECTIVE_KEY, true)) {
34 | pref.putBoolean(CFG_SHOW_PERSPECTIVE_KEY, false);
35 | try {
36 | pref.flush();
37 | } catch (BackingStoreException e) {
38 | Activator.error(e);
39 | }
40 | final IWorkbench workbench = PlatformUI.getWorkbench();
41 | workbench.getDisplay().asyncExec(new Runnable() {
42 | public void run() {
43 | IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
44 | if (window != null && window.getActivePage() != null) {
45 | IPerspectiveDescriptor desc = PlatformUI.getWorkbench().getPerspectiveRegistry()
46 | .findPerspectiveWithId(TYPESCRIPT_PERSPECTIVE_ID);
47 | window.getActivePage().setPerspective(desc);
48 | }
49 | }
50 | });
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.axmor.eclipse.typescript
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 | net.sf.eclipsecs.core.CheckstyleBuilder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.pde.PluginNature
31 | org.eclipse.jdt.core.javanature
32 | net.sf.eclipsecs.core.CheckstyleNature
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/.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.7
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=1.7
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11 | org.eclipse.jdt.core.compiler.source=1.7
12 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: TypEcs - TypeScript IDE for Eclipse
4 | Bundle-SymbolicName: com.axmor.eclipse.typescript;singleton:=true
5 | Bundle-Version: 4.0.0.qualifier
6 | Bundle-Vendor: Axmor Software Inc.
7 | Bundle-ActivationPolicy: lazy
8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7
9 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/about.ini:
--------------------------------------------------------------------------------
1 | # about.ini
2 |
3 | # Property "aboutText" contains blurb for "About" dialog (translated)
4 | aboutText=TypEcs - TypeScript IDE for Eclipse.\n\
5 | \n\Copyright (c) 2014 Axmor Software Inc. All rights reserved.\n\
6 | Visit https://bitbucket.org/axmor/eclipse-typescript
7 |
8 | # Property "windowImage" contains path to window icon (16x16)
9 | # needed for primary features only
10 | windowImage=typecs16.png
11 |
12 | # Property "featureImage" contains path to feature image (32x32)
13 | featureImage=typecs.png
14 |
15 | # Property "aboutImage" contains path to product image (500x330 or 115x164)
16 | # needed for primary features only
17 |
18 | # Property "appName" contains name of the application (not translated)
19 | # needed for primary features only
20 |
21 | # Property "welcomePerspective" contains the id of the perspective in which the
22 | # welcome page is to be opened.
23 | # optional
24 |
25 | # Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
26 | # optional
27 | # tipsAndTricksHref=/org.eclipse.jdt.doc.user/tips/jdt_tips.html
28 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/
2 | output.. = target/classes
3 | bin.includes = typecs16.png,\
4 | typecs.png,\
5 | about.ini,\
6 | META-INF/
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 |
6 | com.axmor.eclipse.typescript
7 | product
8 | 4.0.0-SNAPSHOT
9 |
10 |
11 | com.axmor.eclipse.typescript
12 | com.axmor.eclipse.typescript
13 | eclipse-plugin
14 |
15 | TypEcs Plugin
16 |
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/typecs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript/typecs.png
--------------------------------------------------------------------------------
/src/com.axmor.eclipse.typescript/typecs16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript/typecs16.png
--------------------------------------------------------------------------------