Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 0f961a0

Browse files
author
Valeriy Svydenko
authored
Merge pull request #9 from eclipse/file-structure
File structure navigation
2 parents 4cf066c + 0639e14 commit 0f961a0

23 files changed

+1598
-556
lines changed

browser-app/package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
"name": "browser-app",
44
"version": "0.0.1",
55
"dependencies": {
6-
"@theia/core": "latest",
7-
"@theia/filesystem": "latest",
8-
"@theia/workspace": "latest",
9-
"@theia/preferences": "latest",
10-
"@theia/navigator": "latest",
11-
"@theia/process": "latest",
12-
"@theia/terminal": "latest",
13-
"@theia/editor": "latest",
14-
"@theia/languages": "latest",
15-
"@theia/markers": "latest",
16-
"@theia/monaco": "latest",
17-
"@theia/typescript": "latest",
18-
"@theia/messages": "latest",
19-
"@theia/java": "latest",
6+
"@theia/core": "0.3.13",
7+
"@theia/filesystem": "0.3.13",
8+
"@theia/workspace": "0.3.13",
9+
"@theia/preferences": "0.3.13",
10+
"@theia/navigator": "0.3.13",
11+
"@theia/process": "0.3.13",
12+
"@theia/terminal": "0.3.13",
13+
"@theia/editor": "0.3.13",
14+
"@theia/languages": "0.3.13",
15+
"@theia/markers": "0.3.13",
16+
"@theia/monaco": "0.3.13",
17+
"@theia/file-search": "0.3.13",
18+
"@theia/typescript": "0.3.13",
19+
"@theia/messages": "0.3.13",
20+
"@theia/java": "0.3.13",
2021
"@eclipse-che/theia-java-extension": "0.0.1"
2122
},
2223
"devDependencies": {
23-
"@theia/cli": "latest"
24+
"@theia/cli": "0.3.13"
2425
},
2526
"scripts": {
2627
"prepare": "theia build",

che-theia-java-extension/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"src"
1010
],
1111
"dependencies": {
12-
"@theia/core": "0.3.12",
13-
"@theia/java": "0.3.12",
14-
"@theia/editor": "0.3.12",
15-
"@theia/languages": "0.3.12"
12+
"@theia/core": "0.3.13",
13+
"@theia/java": "0.3.13",
14+
"@theia/editor": "0.3.13",
15+
"@theia/languages": "0.3.13"
1616
},
1717
"devDependencies": {
18-
"rimraf": "latest",
19-
"typescript": "latest"
18+
"rimraf": "2.6.2",
19+
"typescript": "^2.7.2"
2020
},
2121
"scripts": {
2222
"prepare": "yarn run clean && yarn run build",
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright (c) 2012-2018 Red Hat, Inc.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which is available at http://www.eclipse.org/legal/epl-2.0.html
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Red Hat, Inc. - initial API and implementation
11+
*/
12+
13+
export const HELLO_WORLD_COMMAND = "org.eclipse.che.jdt.ls.extension.samplecommand";
14+
export const FILE_STRUCTURE_COMMAND =
15+
"org.eclipse.che.jdt.ls.extension.filestructure";
16+
export const TEST_DETECT_COMMAND = "che.jdt.ls.extension.detectTest";
17+
export const FIND_TEST_BY_CURSOR_COMMAND = "che.jdt.ls.extension.findTestByCursor";
18+
export const FIND_TESTS_FROM_PROJECT_COMMAND =
19+
"che.jdt.ls.extension.findTestFromProject";
20+
export const FIND_TESTS_FROM_FOLDER_COMMAND =
21+
"che.jdt.ls.extension.findTestFromFolder";
22+
export const FIND_TESTS_FROM_ENTRY_COMMAND =
23+
"che.jdt.ls.extension.findTestFromEntry";
24+
export const FIND_TESTS_IN_FILE_COMMAND = "che.jdt.ls.extension.findTestInFile";
25+
export const RESOLVE_CLASSPATH_COMMAND = "che.jdt.ls.extension.resolveClasspath";
26+
export const GET_OUTPUT_DIR_COMMAND = "che.jdt.ls.extension.outputDir";
27+
export const GET_EFFECTIVE_POM_COMMAND = "che.jdt.ls.extension.effectivePom";
28+
export const GET_MAVEN_PROJECTS_COMMAND = "che.jdt.ls.extension.mavenProjects";
29+
export const RECOMPUTE_POM_DIAGNOSTICS = "che.jdt.ls.extension.pom.diagnostics";
30+
export const REIMPORT_MAVEN_PROJECTS_COMMAND =
31+
"che.jdt.ls.extension.reImportMavenProject";
32+
export const GET_CLASS_PATH_TREE_COMMAND = "che.jdt.ls.extension.classpathTree";
33+
34+
/**
35+
* External Libraries
36+
*/
37+
38+
export const GET_EXTERNAL_LIBRARIES_COMMAND =
39+
"che.jdt.ls.extension.externalLibraries";
40+
export const GET_EXTERNAL_LIBRARIES_CHILDREN_COMMAND =
41+
"che.jdt.ls.extension.externalLibrariesChildren";
42+
export const GET_LIBRARY_CHILDREN_COMMAND = "che.jdt.ls.extension.libraryChildren";
43+
export const GET_LIBRARY_ENTRY_COMMAND = "che.jdt.ls.extension.libraryEntry";
44+
45+
/**
46+
* Debug
47+
*/
48+
49+
export const FIND_RESOURCES_BY_FQN =
50+
"che.jdt.ls.extension.debug.findResourcesByFqn";
51+
export const IDENTIFY_FQN_IN_RESOURCE =
52+
"che.jdt.ls.extension.debug.identifyFqnInResource";
53+
export const USAGES_COMMAND = "che.jdt.ls.extension.usages";
54+
55+
export const UPDATE_WORKSPACE = "che.jdt.ls.extension.updateWorkspace";
56+
57+
/**
58+
* Simple java project
59+
*/
60+
61+
export const CREATE_SIMPLE_PROJECT = "che.jdt.ls.extension.plain.createProject";
62+
export const UPDATE_PROJECT_CLASSPATH =
63+
"che.jdt.ls.extension.plain.updateClasspath";
64+
export const GET_SOURCE_FOLDERS = "che.jdt.ls.extension.plain.sourceFolders";
65+
66+
/**
67+
* Navigation
68+
*/
69+
70+
export const FIND_IMPLEMENTERS_COMMAND = "che.jdt.ls.extension.findImplementers";
71+
72+
/**
73+
* Configuration
74+
*/
75+
76+
export const GET_JAVA_CORE_OPTIONS_СOMMAND =
77+
"che.jdt.ls.extension.configuration.getJavaCoreOptions";
78+
export const UPDATE_JAVA_CORE_OPTIONS_СOMMAND =
79+
"che.jdt.ls.extension.configuration.updateJavaCoreOptions";
80+
export const GET_PREFERENCES_СOMMAND =
81+
"che.jdt.ls.extension.configuration.getPreferences";
82+
export const UPDATE_PREFERENCES_СOMMAND =
83+
"che.jdt.ls.extension.configuration.updatePreferences";
84+
85+
/**
86+
* Imports
87+
*/
88+
89+
export const ORGANIZE_IMPORTS = "che.jdt.ls.extension.import.organizeImports";
90+
91+
/**
92+
* Refactoring
93+
*/
94+
95+
export const RENAME_COMMAND = "che.jdt.ls.extension.refactoring.rename";
96+
export const GET_RENAME_TYPE_COMMAND =
97+
"che.jdt.ls.extension.refactoring.rename.get.type";
98+
export const VALIDATE_RENAMED_NAME_COMMAND =
99+
"che.jdt.ls.extension.refactoring.rename.validate.new.name";
100+
export const GET_LINKED_ELEMENTS_COMMAND =
101+
"che.jdt.ls.extension.refactoring.rename.get.linked.elements";
102+
export const VALIDATE_MOVE_COMMAND =
103+
"che.jdt.ls.extension.refactoring.move.validate";
104+
export const GET_DESTINATIONS_COMMAND =
105+
"che.jdt.ls.extension.refactoring.move.get.destinations.command";
106+
export const MOVE_COMMAND = "che.jdt.ls.extension.refactoring.move.command";
107+
export const VERIFY_MOVE_DESTINATION_COMMAND =
108+
"che.jdt.ls.extension.refactoring.move.verify.destination";
109+
110+
/**
111+
* Classpath updater
112+
*/
113+
114+
export const CLIENT_UPDATE_PROJECTS_CLASSPATH =
115+
"che.jdt.ls.extension.workspace.clientUpdateProjectsClasspath";
116+
117+
/**
118+
* Project updater
119+
*/
120+
121+
export const CLIENT_UPDATE_PROJECT =
122+
"che.jdt.ls.extension.workspace.clientUpdateProject";

che-theia-java-extension/src/browser/che-theia-java-contribution.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/*
2-
* Copyright (C) 2018 Red Hat, Inc. and others.
2+
* Copyright (c) 2012-2018 Red Hat, Inc.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which is available at http://www.eclipse.org/legal/epl-2.0.html
36
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Red Hat, Inc. - initial API and implementation
611
*/
712

813
import { injectable } from "inversify";
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/*
2-
* Copyright (C) 2018 Red Hat, Inc. and others.
2+
* Copyright (c) 2012-2018 Red Hat, Inc.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which is available at http://www.eclipse.org/legal/epl-2.0.html
36
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Red Hat, Inc. - initial API and implementation
611
*/
712

813
import { JavaExtensionContribution } from './che-theia-java-contribution';
@@ -12,10 +17,22 @@ import {
1217
} from "@theia/core/lib/common";
1318

1419
import { ContainerModule } from "inversify";
15-
import { KeybindingContribution } from '@theia/core/lib/browser';
20+
import { KeybindingContribution, KeybindingContext } from '@theia/core/lib/browser';
21+
22+
import "../../src/browser/styles/icons.css";
23+
import { FileStructure } from './navigation/file-structure';
24+
import { JavaEditorTextFocusContext } from './java-keybinding-contexts';
25+
26+
export default new ContainerModule((bind) => {
1627

17-
export default new ContainerModule(bind => {
1828
bind(CommandContribution).to(JavaExtensionContribution);
1929
bind(MenuContribution).to(JavaExtensionContribution);
2030
bind(KeybindingContribution).to(JavaExtensionContribution);
31+
32+
bind(FileStructure).toSelf().inSingletonScope();
33+
bind(CommandContribution).toDynamicValue(ctx => ctx.container.get(FileStructure));
34+
bind(KeybindingContribution).toDynamicValue(ctx => ctx.container.get(FileStructure));
35+
bind(MenuContribution).toDynamicValue(ctx => ctx.container.get(FileStructure));
36+
37+
bind(KeybindingContext).to(JavaEditorTextFocusContext).inSingletonScope();
2138
});

che-theia-java-extension/src/browser/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/*
2-
* Copyright (C) 2018 Red Hat, Inc. and others.
2+
* Copyright (c) 2012-2018 Red Hat, Inc.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which is available at http://www.eclipse.org/legal/epl-2.0.html
36
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Red Hat, Inc. - initial API and implementation
611
*/
712

813
export * from './che-theia-java-contribution';
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/********************************************************************************
2+
* Copyright (C) 2018 TypeFox and others.
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0.
7+
*
8+
* This Source Code may also be made available under the following Secondary
9+
* Licenses when the conditions for such availability set forth in the Eclipse
10+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
11+
* with the GNU Classpath Exception which is available at
12+
* https://www.gnu.org/software/classpath/license.html.
13+
*
14+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
********************************************************************************/
16+
17+
import { injectable } from "inversify";
18+
import { EditorTextFocusContext, EditorWidget } from "@theia/editor/lib/browser";
19+
import { JAVA_LANGUAGE_ID } from "@theia/java/lib/browser";
20+
21+
export namespace JavaKeybindingContexts {
22+
export const javaEditorTextFocus = 'javaEditorTextFocus';
23+
}
24+
25+
@injectable()
26+
export class JavaEditorTextFocusContext extends EditorTextFocusContext {
27+
28+
readonly id: string = JavaKeybindingContexts.javaEditorTextFocus;
29+
30+
protected canHandle(widget: EditorWidget): boolean {
31+
return super.canHandle(widget) && widget.editor.document.languageId === JAVA_LANGUAGE_ID;
32+
}
33+
34+
}

0 commit comments

Comments
 (0)