Add C/C++ project type
C/C++ Editor (with syntax highlighter only) Signed-off-by: Vitaly Parfonov <vparfonov@codenvy.com>6.19.x
parent
a0b3c18bb3
commit
770eb38d38
|
|
@ -160,6 +160,14 @@
|
|||
<groupId>org.eclipse.che.lib</groupId>
|
||||
<artifactId>che-swagger-module</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-ide</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-docker-client</artifactId>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
<inherits name='org.eclipse.che.env.local.LocalEnvironment'/>
|
||||
<inherits name='org.eclipse.che.ide.ext.plugins.PluginsDevelopment'/>
|
||||
|
||||
<inherits name='org.eclipse.che.plugin.cpp.Cpp'/>
|
||||
<inherits name='org.eclipse.che.plugin.python.Python'/>
|
||||
<inherits name='org.eclipse.che.plugin.docker.client.dto.Dto'/>
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,14 @@
|
|||
<artifactId>che-jdt-ext-machine</artifactId>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-git-provider-che</artifactId>
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ public interface MimeType {
|
|||
String TEXT_CSS = "text/css";
|
||||
|
||||
/** "text/x-c" */
|
||||
String TEXT_C = "text/x-c";
|
||||
String TEXT_C = "text/x-csrc";
|
||||
|
||||
/** "text/x-c" */
|
||||
String TEXT_CPP = "text/x-c++src";
|
||||
|
||||
/** "text/x-h" */
|
||||
String TEXT_H = "text/x-h";
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.google.inject.Inject;
|
|||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.che.api.project.shared.dto.AttributeDto;
|
||||
import org.eclipse.che.api.project.shared.dto.ItemReference;
|
||||
import org.eclipse.che.api.project.shared.dto.ProjectTemplateDescriptor;
|
||||
import org.eclipse.che.api.project.shared.dto.ProjectTypeDto;
|
||||
|
|
@ -32,6 +33,7 @@ import org.eclipse.che.ide.projecttype.wizard.categoriespage.CategoriesPagePrese
|
|||
import org.eclipse.che.ide.ui.dialogs.DialogFactory;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -191,19 +193,25 @@ public class ProjectWizardPresenter implements Wizard.UpdateDelegate,
|
|||
wizard = getWizardForProjectType(projectType, prevData);
|
||||
wizard.navigateToFirst();
|
||||
final ProjectConfigDto newProject = wizard.getDataObject();
|
||||
|
||||
// some values should be shared between wizards for different project types
|
||||
newProject.setPath(prevData.getPath());
|
||||
newProject.setType(projectType.getId());
|
||||
newProject.setName(prevData.getName());
|
||||
newProject.setDescription(prevData.getDescription());
|
||||
newProject.setMixins(prevData.getMixins());
|
||||
if (wizardMode == UPDATE) {
|
||||
if (wizardMode == CREATE) {
|
||||
newProject.setMixins(Collections.<String>emptyList());
|
||||
List<AttributeDto> attributes = projectType.getAttributes();
|
||||
Map<String, List<String>> prevDataAttributes = prevData.getAttributes();
|
||||
Map<String, List<String>> newAttributes = new HashMap<>();
|
||||
for (AttributeDto attribute : attributes) {
|
||||
if(prevDataAttributes.containsKey(attribute.getId())) {
|
||||
newAttributes.put(attribute.getId(), prevDataAttributes.get(attribute.getId()));
|
||||
}
|
||||
}
|
||||
newProject.setAttributes(newAttributes);
|
||||
} else {
|
||||
// some values should be shared between wizards for different project types
|
||||
newProject.setMixins(prevData.getMixins());
|
||||
newProject.setAttributes(prevData.getAttributes());
|
||||
}
|
||||
|
||||
// set dataObject's values from projectType
|
||||
newProject.setType(projectType.getId());
|
||||
// newProject.setRecipe(projectType.getDefaultRecipe());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class ExtensionFileTypeIdentifier implements FileTypeIdentifier {
|
|||
|
||||
/** Prepares the know extension registry. */
|
||||
public void init() {
|
||||
this.mappings.put("c", makeList("text/x-c"));
|
||||
this.mappings.put("c", makeList("text/x-csrc"));
|
||||
this.mappings.put("C", makeList("text/x-c++src"));
|
||||
this.mappings.put("cc", makeList("text/x-c++src"));
|
||||
this.mappings.put("cpp", makeList("text/x-c++src"));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>che-plugin-cpp-parent</artifactId>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<version>4.1.0-RC1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-plugin-cpp-lang-ide</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Che Plugin :: C/C++ :: IDE</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt.inject</groupId>
|
||||
<artifactId>gin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.inject</groupId>
|
||||
<artifactId>javax.inject</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-api-workspace</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-commons-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-app</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-jseditor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.vectomatic</groupId>
|
||||
<artifactId>lib-gwt-svg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
import org.eclipse.che.ide.api.action.ActionManager;
|
||||
import org.eclipse.che.ide.api.action.DefaultActionGroup;
|
||||
import org.eclipse.che.ide.api.constraints.Constraints;
|
||||
import org.eclipse.che.ide.api.extension.Extension;
|
||||
import org.eclipse.che.ide.api.filetypes.FileType;
|
||||
import org.eclipse.che.ide.api.filetypes.FileTypeRegistry;
|
||||
import org.eclipse.che.ide.api.icon.Icon;
|
||||
import org.eclipse.che.ide.api.icon.IconRegistry;
|
||||
import org.eclipse.che.plugin.cpp.ide.action.CreateCSourceFileAction;
|
||||
import org.eclipse.che.plugin.cpp.ide.action.CreateCppSourceFileAction;
|
||||
import org.eclipse.che.plugin.cpp.ide.action.CreateHeaderSourceFileAction;
|
||||
|
||||
import static org.eclipse.che.ide.api.action.IdeActions.GROUP_FILE_NEW;
|
||||
|
||||
/**
|
||||
* @author Vitalii Parfonov
|
||||
*
|
||||
* */
|
||||
@Extension(title = "Cpp")
|
||||
public class CppExtension {
|
||||
|
||||
public static String C_CATEGORY = "C/C++";
|
||||
|
||||
@Inject
|
||||
public CppExtension(FileTypeRegistry fileTypeRegistry,
|
||||
@Named("CFileType") FileType cFile,
|
||||
@Named("CppFileType") FileType cppFile,
|
||||
@Named("HFileType") FileType hFile) {
|
||||
fileTypeRegistry.registerFileType(cFile);
|
||||
fileTypeRegistry.registerFileType(cppFile);
|
||||
fileTypeRegistry.registerFileType(hFile);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private void prepareActions(CreateCSourceFileAction newCSourceFileAction,
|
||||
CreateCppSourceFileAction newCppSourceFileAction,
|
||||
CreateHeaderSourceFileAction newHeadSourceFileAction,
|
||||
ActionManager actionManager,
|
||||
CppResources resources,
|
||||
IconRegistry iconRegistry) {
|
||||
|
||||
DefaultActionGroup newGroup = (DefaultActionGroup)actionManager.getAction(GROUP_FILE_NEW);
|
||||
|
||||
actionManager.registerAction("newCFile", newCSourceFileAction);
|
||||
actionManager.registerAction("newCppFile", newCppSourceFileAction);
|
||||
actionManager.registerAction("newHFile", newHeadSourceFileAction);
|
||||
newGroup.add(newCSourceFileAction, Constraints.FIRST);
|
||||
newGroup.add(newHeadSourceFileAction, Constraints.FIRST);
|
||||
newGroup.add(newCppSourceFileAction, Constraints.FIRST);
|
||||
iconRegistry.registerIcon(new Icon(C_CATEGORY + ".samples.category.icon", resources.category()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide;
|
||||
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
import org.eclipse.che.ide.api.editor.EditorRegistry;
|
||||
import org.eclipse.che.ide.api.extension.Extension;
|
||||
import org.eclipse.che.ide.api.filetypes.FileType;
|
||||
import org.eclipse.che.plugin.cpp.ide.editor.CEditorProvider;
|
||||
import org.eclipse.che.plugin.cpp.ide.editor.CppEditorProvider;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@Extension(title = "C/C++ JS Editor")
|
||||
public class CppJsEditorExtension {
|
||||
|
||||
@Inject
|
||||
public CppJsEditorExtension(final EditorRegistry editorRegistry,
|
||||
final @Named("CFileType") FileType cFile,
|
||||
final @Named("HFileType") FileType hFile,
|
||||
final @Named("CppFileType") FileType classFile,
|
||||
final CEditorProvider cEditorProvider,
|
||||
final CppEditorProvider cppEditorProvider) {
|
||||
// register editor provider
|
||||
editorRegistry.registerDefaultEditor(cFile, cEditorProvider);
|
||||
editorRegistry.registerDefaultEditor(hFile, cEditorProvider);
|
||||
editorRegistry.registerDefaultEditor(classFile, cppEditorProvider);
|
||||
editorRegistry.registerDefaultEditor(classFile, cppEditorProvider);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide;
|
||||
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
|
||||
/**
|
||||
* Localization constants. Interface to represent the constants defined in resource bundle:
|
||||
* 'CppLocalizationConstant.properties'.
|
||||
*
|
||||
* @author Vitalii PArfonov
|
||||
*/
|
||||
public interface CppLocalizationConstant extends Messages {
|
||||
|
||||
|
||||
@Key("cpp.action.create.c.file.title")
|
||||
@DefaultMessage("New C File")
|
||||
String createCFileActionTitle();
|
||||
|
||||
@Key("cpp.action.create.c.file.description")
|
||||
@DefaultMessage("Create C File")
|
||||
String createCFileActionDescription();
|
||||
|
||||
@Key("cpp.action.create.h.file.title")
|
||||
@DefaultMessage("New H File")
|
||||
String createCHeaderFileActionTitle();
|
||||
|
||||
@Key("cpp.action.create.c.file.description")
|
||||
@DefaultMessage("Create C Header File")
|
||||
String createCHeaderFileActionDescription();
|
||||
|
||||
@Key("cpp.action.create.cpp.file.title")
|
||||
@DefaultMessage("New C++ File")
|
||||
String createCppFileActionTitle();
|
||||
|
||||
@Key("cpp.action.create.cpp.file.description")
|
||||
@DefaultMessage("Create C++ File")
|
||||
String createCppFileActionDescription();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
|
||||
import org.vectomatic.dom.svg.ui.SVGResource;
|
||||
|
||||
/**
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public interface CppResources extends ClientBundle {
|
||||
CppResources INSTANCE = GWT.create(CppResources.class);
|
||||
|
||||
@Source("svg/c_file.svg")
|
||||
SVGResource cFile();
|
||||
|
||||
@Source("svg/cpp_file.svg")
|
||||
SVGResource cppFile();
|
||||
|
||||
@Source("svg/c_header_file.svg")
|
||||
SVGResource cHeaderFile();
|
||||
|
||||
@Source("svg/category.svg")
|
||||
SVGResource category();
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.action;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.che.ide.api.app.AppContext;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppLocalizationConstant;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppResources;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_EXT;
|
||||
|
||||
/**
|
||||
* Action to create new C source file.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
@Singleton
|
||||
public class CreateCSourceFileAction extends NewClikeResourceAction {
|
||||
|
||||
private static final String DEFAULT_CONTENT = "#include <stdio.h>\n" +
|
||||
"\n" +
|
||||
"int main(void)\n" +
|
||||
"{\n" +
|
||||
" printf(\"hello, world\\n\");\n" +
|
||||
"}";
|
||||
|
||||
@Inject
|
||||
public CreateCSourceFileAction(CppLocalizationConstant localizationConstant,
|
||||
CppResources cppResources,
|
||||
AppContext appContext) {
|
||||
super(localizationConstant.createCFileActionTitle(),
|
||||
localizationConstant.createCFileActionDescription(),
|
||||
cppResources.cFile(), appContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getExtension() {
|
||||
return C_EXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultContent() {
|
||||
return DEFAULT_CONTENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.action;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.che.ide.api.app.AppContext;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppLocalizationConstant;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppResources;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_EXT;
|
||||
|
||||
/**
|
||||
* Action to create new C++ source file.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
@Singleton
|
||||
public class CreateCppSourceFileAction extends NewClikeResourceAction {
|
||||
|
||||
|
||||
private static final String DEFAULT_CONTENT = "#include <iostream>\n" +
|
||||
"\n" +
|
||||
"int main()\n" +
|
||||
"{\n" +
|
||||
" std::cout << \"Hello, world!\\n\";\n" +
|
||||
" return 0;\n" +
|
||||
"}";
|
||||
|
||||
@Inject
|
||||
public CreateCppSourceFileAction(CppLocalizationConstant localizationConstant,
|
||||
AppContext appContext,
|
||||
CppResources cppResources) {
|
||||
super(localizationConstant.createCppFileActionTitle(),
|
||||
localizationConstant.createCppFileActionDescription(),
|
||||
cppResources.cppFile(), appContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getExtension() {
|
||||
return CPP_EXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultContent() {
|
||||
return DEFAULT_CONTENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.action;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.che.ide.api.app.AppContext;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppLocalizationConstant;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppResources;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.H_EXT;
|
||||
|
||||
/**
|
||||
* Action to create new C Header file.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
@Singleton
|
||||
public class CreateHeaderSourceFileAction extends NewClikeResourceAction {
|
||||
|
||||
private static final String DEFAULT_CONTENT = "#ifndef VARIABLE\n" +
|
||||
"#define VARIABLE\n" +
|
||||
"// Write your header file here.\n" +
|
||||
"#endif";
|
||||
|
||||
@Inject
|
||||
public CreateHeaderSourceFileAction(CppLocalizationConstant localizationConstant,
|
||||
CppResources cppResources,
|
||||
AppContext appContext) {
|
||||
super(localizationConstant.createCHeaderFileActionTitle(),
|
||||
localizationConstant.createCHeaderFileActionDescription(),
|
||||
cppResources.cHeaderFile(),
|
||||
appContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getExtension() {
|
||||
return H_EXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultContent() {
|
||||
return DEFAULT_CONTENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.action;
|
||||
|
||||
import org.eclipse.che.commons.annotation.Nullable;
|
||||
import org.eclipse.che.ide.api.action.ActionEvent;
|
||||
import org.eclipse.che.ide.api.app.AppContext;
|
||||
import org.eclipse.che.ide.api.app.CurrentProject;
|
||||
import org.eclipse.che.ide.api.selection.Selection;
|
||||
import org.eclipse.che.ide.newresource.AbstractNewResourceAction;
|
||||
import org.vectomatic.dom.svg.ui.SVGResource;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_PROJECT_TYPE_ID;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_PROJECT_TYPE_ID;
|
||||
|
||||
/**
|
||||
* Base class for ne C/C++ resource
|
||||
*
|
||||
* Show/hide action depend on project type
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public abstract class NewClikeResourceAction extends AbstractNewResourceAction {
|
||||
|
||||
protected final AppContext appContext;
|
||||
|
||||
/**
|
||||
* Creates new action.
|
||||
*
|
||||
* @param title
|
||||
* action's title
|
||||
* @param description
|
||||
* action's description
|
||||
* @param svgIcon
|
||||
*/
|
||||
public NewClikeResourceAction(String title, String description, @Nullable SVGResource svgIcon, AppContext appContext) {
|
||||
super(title, description, svgIcon);
|
||||
this.appContext = appContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInPerspective(@NotNull ActionEvent e) {
|
||||
CurrentProject project = appContext.getCurrentProject();
|
||||
if (project == null || !(CPP_PROJECT_TYPE_ID.equals(project.getRootProject().getType()) ||
|
||||
C_PROJECT_TYPE_ID.equals(project.getRootProject().getType()))) {
|
||||
e.getPresentation().setEnabledAndVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Selection<?> selection = projectExplorer.getSelection();
|
||||
if (selection == null) {
|
||||
e.getPresentation().setEnabledAndVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
e.getPresentation().setEnabledAndVisible(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.editor;
|
||||
|
||||
import org.eclipse.che.ide.api.editor.EditorPartPresenter;
|
||||
import org.eclipse.che.ide.api.editor.EditorProvider;
|
||||
import org.eclipse.che.ide.api.notification.NotificationManager;
|
||||
import org.eclipse.che.ide.jseditor.client.defaulteditor.DefaultEditorProvider;
|
||||
import org.eclipse.che.ide.jseditor.client.editorconfig.AutoSaveTextEditorConfiguration;
|
||||
import org.eclipse.che.ide.jseditor.client.texteditor.EmbeddedTextEditorPresenter;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
||||
/**
|
||||
* EditorProvider that provides a text editor configured for C source files.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CEditorProvider implements EditorProvider {
|
||||
|
||||
private final DefaultEditorProvider editorProvider;
|
||||
private final NotificationManager notificationManager;
|
||||
|
||||
|
||||
@Inject
|
||||
public CEditorProvider(final DefaultEditorProvider editorProvider,
|
||||
final NotificationManager notificationManager) {
|
||||
this.editorProvider = editorProvider;
|
||||
this.notificationManager = notificationManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "CEditor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "C Editor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EditorPartPresenter getEditor() {
|
||||
final EditorPartPresenter textEditor = editorProvider.getEditor();
|
||||
if (textEditor instanceof EmbeddedTextEditorPresenter) {
|
||||
final EmbeddedTextEditorPresenter<?> editor = (EmbeddedTextEditorPresenter<?>)textEditor;
|
||||
editor.initialize(new AutoSaveTextEditorConfiguration(), notificationManager);
|
||||
}
|
||||
return textEditor;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.editor;
|
||||
|
||||
import org.eclipse.che.ide.api.notification.NotificationManager;
|
||||
import org.eclipse.che.ide.jseditor.client.defaulteditor.DefaultEditorProvider;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
||||
/**
|
||||
* EditorProvider that provides a text editor configured for C++ source files.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CppEditorProvider extends CEditorProvider {
|
||||
|
||||
@Inject
|
||||
public CppEditorProvider(final DefaultEditorProvider editorProvider,
|
||||
final NotificationManager notificationManager) {
|
||||
super(editorProvider, notificationManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "CppEditor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "C++ Editor";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.inject;
|
||||
|
||||
import com.google.gwt.inject.client.AbstractGinModule;
|
||||
import com.google.gwt.inject.client.multibindings.GinMultibinder;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
import org.eclipse.che.ide.MimeType;
|
||||
import org.eclipse.che.ide.api.extension.ExtensionGinModule;
|
||||
import org.eclipse.che.ide.api.filetypes.FileType;
|
||||
import org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppResources;
|
||||
import org.eclipse.che.plugin.cpp.ide.project.CProjectWizardRegistrar;
|
||||
import org.eclipse.che.plugin.cpp.ide.project.CppProjectWizardRegistrar;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_EXT;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_EXT;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.H_EXT;
|
||||
|
||||
|
||||
/**
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
@ExtensionGinModule
|
||||
public class CppGinModule extends AbstractGinModule {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected void configure() {
|
||||
GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class).addBinding().to(CppProjectWizardRegistrar.class);
|
||||
GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class).addBinding().to(CProjectWizardRegistrar.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Named("CFileType")
|
||||
protected FileType provideCFile() {
|
||||
return new FileType("C", CppResources.INSTANCE.cFile(), MimeType.TEXT_C, C_EXT);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Named("CppFileType")
|
||||
protected FileType provideCppFile() {
|
||||
return new FileType("C++", CppResources.INSTANCE.cppFile(), MimeType.TEXT_CPP, CPP_EXT);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Named("HFileType")
|
||||
protected FileType provideHeaderFile() {
|
||||
return new FileType("C Header", CppResources.INSTANCE.cHeaderFile(), MimeType.TEXT_H, H_EXT);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.project;
|
||||
|
||||
import com.google.inject.Provider;
|
||||
import org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto;
|
||||
import org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar;
|
||||
import org.eclipse.che.ide.api.wizard.WizardPage;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppExtension;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_PROJECT_TYPE_ID;
|
||||
|
||||
|
||||
/**
|
||||
* Provides information for registering C_PROJECT_TYPE_ID project type into project wizard.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CProjectWizardRegistrar implements ProjectWizardRegistrar {
|
||||
|
||||
|
||||
private final List<Provider<? extends WizardPage<ProjectConfigDto>>> wizardPages;
|
||||
|
||||
public CProjectWizardRegistrar() {
|
||||
wizardPages = new ArrayList<>();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getProjectTypeId() {
|
||||
return C_PROJECT_TYPE_ID;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getCategory() {
|
||||
return CppExtension.C_CATEGORY;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<Provider<? extends WizardPage<ProjectConfigDto>>> getWizardPages() {
|
||||
return wizardPages;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.ide.project;
|
||||
|
||||
import com.google.inject.Provider;
|
||||
|
||||
import org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto;
|
||||
import org.eclipse.che.ide.api.project.type.wizard.ProjectWizardRegistrar;
|
||||
import org.eclipse.che.ide.api.wizard.WizardPage;
|
||||
import org.eclipse.che.plugin.cpp.ide.CppExtension;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_PROJECT_TYPE_ID;
|
||||
|
||||
|
||||
/**
|
||||
* Provides information for registering C_PROJECT_TYPE_ID++ project type into project wizard.
|
||||
*
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CppProjectWizardRegistrar implements ProjectWizardRegistrar {
|
||||
|
||||
private final List<Provider<? extends WizardPage<ProjectConfigDto>>> wizardPages;
|
||||
|
||||
public CppProjectWizardRegistrar() {
|
||||
wizardPages = new ArrayList<>();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getProjectTypeId() {
|
||||
return CPP_PROJECT_TYPE_ID;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getCategory() {
|
||||
return CppExtension.C_CATEGORY;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<Provider<? extends WizardPage<ProjectConfigDto>>> getWizardPages() {
|
||||
return wizardPages;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
|
||||
<module>
|
||||
<inherits name="com.google.gwt.user.User"/>
|
||||
<inherits name="com.google.gwt.http.HTTP"/>
|
||||
<inherits name="com.google.gwt.i18n.I18N"/>
|
||||
<inherits name="com.google.gwt.json.JSON"/>
|
||||
<inherits name='org.eclipse.che.ide.Api'/>
|
||||
<inherits name='org.eclipse.che.ide.ui.CodenvyUI'/>
|
||||
<inherits name="com.google.gwt.inject.Inject"/>
|
||||
<inherits name="org.eclipse.che.api.Project"/>
|
||||
<inherits name="org.eclipse.che.ide.Core"/>
|
||||
<inherits name="org.eclipse.che.ide.jseditor.JsEditor"/>
|
||||
|
||||
<source path="ide"/>
|
||||
<source path="shared"/>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v1.0
|
||||
# which accompanies this distribution, and is available at
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Contributors:
|
||||
# Codenvy, S.A. - initial API and implementation
|
||||
#
|
||||
|
||||
#
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px"
|
||||
height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
|
||||
<g id="C_x2B__x2B__file">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" fill="#9A5CFF" d="M11.053,10.436c1.535-0.996,3.494-1.295,5.26-0.823
|
||||
c1.685,0.44,3.187,1.569,4.047,3.087c-0.95,0.557-1.904,1.106-2.859,1.652c-0.486-0.769-1.252-1.368-2.148-1.563
|
||||
c-1.236-0.3-2.609,0.214-3.362,1.234c-0.8,1.024-0.884,2.529-0.213,3.641c0.5,0.849,1.391,1.456,2.368,1.594
|
||||
c1.307,0.211,2.687-0.47,3.342-1.615c0.963,0.546,1.92,1.1,2.875,1.659c-0.857,1.501-2.336,2.628-4.005,3.074
|
||||
c-1.676,0.459-3.531,0.226-5.035-0.647c-1-0.575-1.847-1.415-2.426-2.413c-0.854-1.443-1.106-3.219-0.716-4.848
|
||||
C8.567,12.819,9.624,11.343,11.053,10.436L11.053,10.436z M22.516,14.894c0.252,0,0.504,0,0.755,0c0.001,0.243,0.001,0.486,0,0.729
|
||||
c0.243,0,0.487,0,0.73,0c-0.001,0.252-0.001,0.504,0,0.756c-0.243,0-0.487,0-0.73,0c0.001,0.243,0.001,0.486,0,0.728
|
||||
c-0.251,0.001-0.503,0.001-0.755,0c0-0.242,0-0.485,0-0.728c-0.243,0-0.486,0-0.729,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c0.242,0,0.485,0,0.729,0C22.516,15.38,22.516,15.137,22.516,14.894L22.516,14.894z M19.762,14.894c0,0.243,0,0.486,0,0.729
|
||||
c-0.243,0-0.486,0-0.729,0c-0.001,0.252-0.001,0.504,0,0.756c0.242,0,0.485,0,0.729,0c0,0.243,0,0.486,0,0.728
|
||||
c0.247,0.001,0.494,0.001,0.742,0c0-0.242,0-0.485,0-0.728c0.248,0,0.495,0,0.743,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c-0.248,0-0.495,0-0.743,0c0-0.243,0-0.486,0-0.729C20.256,14.894,20.009,14.893,19.762,14.894z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="32.001px" height="32px" viewBox="0 0 32.001 32" enable-background="new 0 0 32.001 32" xml:space="preserve">
|
||||
<g id="C_header_file">
|
||||
<g>
|
||||
<g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" fill="#E0B91D" d="M23.751,16H8.25c-0.137,0-0.249,0.113-0.249,0.25v7.501
|
||||
C8.001,23.888,8.113,24,8.25,24h15.501c0.138,0,0.25-0.112,0.25-0.249V16.25C24.001,16.112,23.887,16,23.751,16z"/>
|
||||
<text transform="matrix(1 0 0 1 15.2168 22.25)" fill="#4D4D4D" font-family="'Roboto-Black'" font-size="4.5927">h</text>
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" fill="#4D4D4D" d="M9.251,8h9.667c0.068,0,0.128,0.025,0.177,0.074l3.834,3.853
|
||||
c0.048,0.048,0.072,0.108,0.072,0.176V15h-2v-2.172h-2.578c-0.138,0-0.25-0.112-0.25-0.25V10l-7.172,0v5h-2V8.25
|
||||
C9.001,8.112,9.113,8,9.251,8z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px"
|
||||
height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
|
||||
<g id="C_x2B__x2B__file">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" fill="#9A5CFF" d="M11.053,10.436c1.535-0.996,3.494-1.295,5.26-0.823
|
||||
c1.685,0.44,3.187,1.569,4.047,3.087c-0.95,0.557-1.904,1.106-2.859,1.652c-0.486-0.769-1.252-1.368-2.148-1.563
|
||||
c-1.236-0.3-2.609,0.214-3.362,1.234c-0.8,1.024-0.884,2.529-0.213,3.641c0.5,0.849,1.391,1.456,2.368,1.594
|
||||
c1.307,0.211,2.687-0.47,3.342-1.615c0.963,0.546,1.92,1.1,2.875,1.659c-0.857,1.501-2.336,2.628-4.005,3.074
|
||||
c-1.676,0.459-3.531,0.226-5.035-0.647c-1-0.575-1.847-1.415-2.426-2.413c-0.854-1.443-1.106-3.219-0.716-4.848
|
||||
C8.567,12.819,9.624,11.343,11.053,10.436L11.053,10.436z M22.516,14.894c0.252,0,0.504,0,0.755,0c0.001,0.243,0.001,0.486,0,0.729
|
||||
c0.243,0,0.487,0,0.73,0c-0.001,0.252-0.001,0.504,0,0.756c-0.243,0-0.487,0-0.73,0c0.001,0.243,0.001,0.486,0,0.728
|
||||
c-0.251,0.001-0.503,0.001-0.755,0c0-0.242,0-0.485,0-0.728c-0.243,0-0.486,0-0.729,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c0.242,0,0.485,0,0.729,0C22.516,15.38,22.516,15.137,22.516,14.894L22.516,14.894z M19.762,14.894c0,0.243,0,0.486,0,0.729
|
||||
c-0.243,0-0.486,0-0.729,0c-0.001,0.252-0.001,0.504,0,0.756c0.242,0,0.485,0,0.729,0c0,0.243,0,0.486,0,0.728
|
||||
c0.247,0.001,0.494,0.001,0.742,0c0-0.242,0-0.485,0-0.728c0.248,0,0.495,0,0.743,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c-0.248,0-0.495,0-0.743,0c0-0.243,0-0.486,0-0.729C20.256,14.894,20.009,14.893,19.762,14.894z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px"
|
||||
height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
|
||||
<g id="C_x2B__x2B__file">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" fill="#9A5CFF" d="M11.053,10.436c1.535-0.996,3.494-1.295,5.26-0.823
|
||||
c1.685,0.44,3.187,1.569,4.047,3.087c-0.95,0.557-1.904,1.106-2.859,1.652c-0.486-0.769-1.252-1.368-2.148-1.563
|
||||
c-1.236-0.3-2.609,0.214-3.362,1.234c-0.8,1.024-0.884,2.529-0.213,3.641c0.5,0.849,1.391,1.456,2.368,1.594
|
||||
c1.307,0.211,2.687-0.47,3.342-1.615c0.963,0.546,1.92,1.1,2.875,1.659c-0.857,1.501-2.336,2.628-4.005,3.074
|
||||
c-1.676,0.459-3.531,0.226-5.035-0.647c-1-0.575-1.847-1.415-2.426-2.413c-0.854-1.443-1.106-3.219-0.716-4.848
|
||||
C8.567,12.819,9.624,11.343,11.053,10.436L11.053,10.436z M22.516,14.894c0.252,0,0.504,0,0.755,0c0.001,0.243,0.001,0.486,0,0.729
|
||||
c0.243,0,0.487,0,0.73,0c-0.001,0.252-0.001,0.504,0,0.756c-0.243,0-0.487,0-0.73,0c0.001,0.243,0.001,0.486,0,0.728
|
||||
c-0.251,0.001-0.503,0.001-0.755,0c0-0.242,0-0.485,0-0.728c-0.243,0-0.486,0-0.729,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c0.242,0,0.485,0,0.729,0C22.516,15.38,22.516,15.137,22.516,14.894L22.516,14.894z M19.762,14.894c0,0.243,0,0.486,0,0.729
|
||||
c-0.243,0-0.486,0-0.729,0c-0.001,0.252-0.001,0.504,0,0.756c0.242,0,0.485,0,0.729,0c0,0.243,0,0.486,0,0.728
|
||||
c0.247,0.001,0.494,0.001,0.742,0c0-0.242,0-0.485,0-0.728c0.248,0,0.495,0,0.743,0c-0.001-0.252-0.001-0.504,0-0.756
|
||||
c-0.248,0-0.495,0-0.743,0c0-0.243,0-0.486,0-0.729C20.256,14.894,20.009,14.893,19.762,14.894z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>che-plugin-cpp-parent</artifactId>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<version>4.1.0-RC1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-plugin-cpp-lang-server</artifactId>
|
||||
<name>Che Plugin :: C/C++ :: Extension Server</name>
|
||||
<properties>
|
||||
<findbugs.failonerror>false</findbugs.failonerror>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject.extensions</groupId>
|
||||
<artifactId>guice-multibindings</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-api-project</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-commons-inject</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.inject;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.multibindings.Multibinder;
|
||||
import org.eclipse.che.api.project.server.type.ProjectTypeDef;
|
||||
import org.eclipse.che.inject.DynaModule;
|
||||
import org.eclipse.che.plugin.cpp.projecttype.CProjectType;
|
||||
import org.eclipse.che.plugin.cpp.projecttype.CppProjectType;
|
||||
|
||||
/**
|
||||
* @author Vitaly Parfonov
|
||||
*/
|
||||
@DynaModule
|
||||
public class CppModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
Multibinder<ProjectTypeDef> projectTypeMultibinder = Multibinder.newSetBinder(binder(), ProjectTypeDef.class);
|
||||
projectTypeMultibinder.addBinding().to(CProjectType.class);
|
||||
projectTypeMultibinder.addBinding().to(CppProjectType.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.projecttype;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.che.api.project.server.type.ProjectTypeDef;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_LANG;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.C_PROJECT_TYPE_ID;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.LANGUAGE;
|
||||
|
||||
|
||||
/**
|
||||
* C project type
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CProjectType extends ProjectTypeDef {
|
||||
@Inject
|
||||
public CProjectType() {
|
||||
super(C_PROJECT_TYPE_ID, "C", true, false, true);
|
||||
addConstantDefinition(LANGUAGE, "language", C_LANG);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.projecttype;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.che.api.project.server.type.ProjectTypeDef;
|
||||
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_LANG;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.CPP_PROJECT_TYPE_ID;
|
||||
import static org.eclipse.che.plugin.cpp.shared.Constants.LANGUAGE;
|
||||
|
||||
/**
|
||||
* C++ project type
|
||||
* @author Vitalii Parfonov
|
||||
*/
|
||||
public class CppProjectType extends ProjectTypeDef {
|
||||
@Inject
|
||||
public CppProjectType() {
|
||||
super(CPP_PROJECT_TYPE_ID, "C++", true, false, true);
|
||||
addConstantDefinition(LANGUAGE, "language", CPP_LANG);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>che-plugin-cpp-parent</artifactId>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<version>4.1.0-RC1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
<name>Che Plugin :: C/C++ :: Shared</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.plugin.cpp.shared;
|
||||
|
||||
/** @author Vitalii Parfonov */
|
||||
public final class Constants {
|
||||
/**
|
||||
* Language attribute name
|
||||
*/
|
||||
public static String LANGUAGE = "language";
|
||||
/**
|
||||
* C Project Type ID
|
||||
*/
|
||||
public static String C_PROJECT_TYPE_ID = "c";
|
||||
/**
|
||||
* C++ Project Type ID
|
||||
*/
|
||||
public static String CPP_PROJECT_TYPE_ID = "cpp";
|
||||
|
||||
/**
|
||||
* C Language
|
||||
*/
|
||||
public static String C_LANG = "c_lang";
|
||||
|
||||
/**
|
||||
* C++ Language
|
||||
*/
|
||||
public static String CPP_LANG = "cpp_lang";
|
||||
|
||||
/**
|
||||
* Default extension for C files
|
||||
*/
|
||||
public static String C_EXT = "c";
|
||||
|
||||
/**
|
||||
* Default extension for C Headers files
|
||||
*/
|
||||
public static String H_EXT = "h";
|
||||
/**
|
||||
* Default extension for C++ files
|
||||
*/
|
||||
public static String CPP_EXT = "cpp";
|
||||
|
||||
private Constants() {}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Contributors:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>che-plugin-parent</artifactId>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<version>4.1.0-RC1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-plugin-cpp-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che Plugin :: C/C++ :: Parent</name>
|
||||
<modules>
|
||||
<module>che-plugin-cpp-lang-shared</module>
|
||||
<module>che-plugin-cpp-lang-server</module>
|
||||
<module>che-plugin-cpp-lang-ide</module>
|
||||
</modules>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-api-dto-maven-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -271,6 +271,9 @@
|
|||
.orionCodenvy .meta.tag {
|
||||
color: #e8bf55;
|
||||
}
|
||||
.orionCodenvy .meta.preprocessor {
|
||||
color: #A4A4A4;
|
||||
}
|
||||
.annotationHTML {
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,6 +401,10 @@
|
|||
.meta.tag {
|
||||
color: #3f7f7f;
|
||||
}
|
||||
.meta .preprocessor {
|
||||
color: #A4A4A4;
|
||||
}
|
||||
|
||||
.punctuation-definition-comment {
|
||||
color: #3f5fbf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,5 +38,6 @@
|
|||
<module>plugin-gwt</module>
|
||||
<module>plugin-python</module>
|
||||
<module>plugin-svn</module>
|
||||
<module>plugin-cpp</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
|||
15
pom.xml
15
pom.xml
|
|
@ -309,6 +309,21 @@
|
|||
<artifactId>che-jdt-ext-machine</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-ide</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-cpp-lang-shared</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-docker-client</artifactId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue