Skip to content

Commit

Permalink
Merge pull request #495 from codenvy/IDEX-3759
Browse files Browse the repository at this point in the history
IDEX-3759: add ability to launch GWT Super DevMode for Che projects
  • Loading branch information
azatsarynnyy committed Dec 22, 2015
2 parents 722cb25 + 706c84e commit d2247d9
Show file tree
Hide file tree
Showing 50 changed files with 1,103 additions and 1,770 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.eclipse.che.ide.extension.machine.client.command.edit.EditCommandsPresenter;
import org.eclipse.che.ide.ui.dropdown.DropDownHeaderWidget;
import org.eclipse.che.ide.ui.dropdown.DropDownListFactory;
import org.eclipse.che.ide.util.loging.Log;
import org.vectomatic.dom.svg.ui.SVGImage;

import javax.validation.constraints.NotNull;
Expand Down Expand Up @@ -229,7 +230,11 @@ public List<CommandConfiguration> apply(List<CommandDto> arg) throws FunctionExc
final CommandType type = commandTypeRegistry.getCommandTypeById(command.getType());
// skip command if it's type isn't registered
if (type != null) {
configurationList.add(type.getConfigurationFactory().createFromDto(command));
try {
configurationList.add(type.getConfigurationFactory().createFromDto(command));
} catch (IllegalArgumentException e) {
Log.warn(EditCommandsPresenter.class, e.getMessage());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.eclipse.che.ide.ui.dialogs.DialogFactory;
import org.eclipse.che.ide.ui.dialogs.choice.ChoiceDialog;
import org.eclipse.che.ide.ui.dialogs.confirm.ConfirmDialog;
import org.eclipse.che.ide.util.loging.Log;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -457,7 +458,11 @@ public List<CommandConfiguration> apply(List<CommandDto> arg) throws FunctionExc
final CommandType type = commandTypeRegistry.getCommandTypeById(descriptor.getType());
// skip command if it's type isn't registered
if (type != null) {
configurationList.add(type.getConfigurationFactory().createFromDto(descriptor));
try {
configurationList.add(type.getConfigurationFactory().createFromDto(descriptor));
} catch (IllegalArgumentException e) {
Log.warn(EditCommandsPresenter.class, e.getMessage());
}
}
}

Expand Down
70 changes: 12 additions & 58 deletions plugin-sdk/che-plugin-sdk-ext-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,92 +16,68 @@
<parent>
<artifactId>che-plugin-sdk-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0-M6-SNAPSHOT</version>
</parent>
<artifactId>che-plugin-sdk-ext-plugins</artifactId>
<packaging>jar</packaging>
<name>Che Plugin :: SDK :: Plugins Parent</name>
<name>Che Plugin :: SDK :: Plugins Development</name>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation.version}</version>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs.version}</version>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-project</artifactId>
<version>${che.core.version}</version>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-vfs</artifactId>
<version>${che.core.version}</version>
<artifactId>che-core-api-machine</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-commons-gwt</artifactId>
<version>${che.core.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-api</artifactId>
<version>${che.core.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-ext-java</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-ext-maven</artifactId>
<version>${project.version}</version>
<artifactId>che-plugin-machine-ext-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-runner-ext-runner</artifactId>
<version>${project.version}</version>
<groupId>org.vectomatic</groupId>
<artifactId>lib-gwt-svg</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${com.google.gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.gwt-test-utils</groupId>
<artifactId>gwt-test-utils</artifactId>
<version>${com.googlecode.gwt-test-utils.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation.version}</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>${org.easytesting.fest-assert.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${org.mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -125,27 +101,5 @@
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.14</version>
</dependency>
</dependencies>
<configuration>
<!-- <forkMode>never</forkMode> -->
<excludes>
<exclude>**/*Gwt*</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*******************************************************************************
* Copyright (c) 2012-2015 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.ide.ext.plugins.client;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.inject.client.multibindings.GinMultibinder;

import org.eclipse.che.ide.api.extension.ExtensionGinModule;
import org.eclipse.che.ide.ext.plugins.client.command.GwtCheCommandType;
import org.eclipse.che.ide.extension.machine.client.command.CommandType;

/**
* GIN module for 'Che Plugins Development' extension.
*
* @author Artem Zatsarynnyi
*/
@ExtensionGinModule
public class PluginsGinModule extends AbstractGinModule {
@Override
protected void configure() {
GinMultibinder.newSetBinder(binder(), CommandType.class).addBinding().to(GwtCheCommandType.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2012-2015 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.ide.ext.plugins.client;

import com.google.gwt.i18n.client.Messages;

/**
* Localization constants. Interface represents the constants contained in resource bundle:
* 'PluginsLocalizationConstant.properties'.
*
* @author Artem Zatsarynnyi
*/
public interface PluginsLocalizationConstant extends Messages {

/* CommandPageView */
@Key("view.gwtCheCommandPage.gwtModule.text")
String gwtCheCommandPageViewGwtModuleText();

@Key("view.gwtCheCommandPage.codeServerAddress.text")
String gwtCommandPageViewCodeServerAddressText();

@Key("view.gwtCheCommandPage.classPath.text")
String gwtCommandPageViewClassPathText();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.ide.ext.tutorials.client;
package org.eclipse.che.ide.ext.plugins.client;

import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.TextResource;

import org.vectomatic.dom.svg.ui.SVGResource;

Expand All @@ -21,23 +20,11 @@
*
* @author Artem Zatsarynnyi
*/
public interface TutorialsResources extends ClientBundle {
interface TutorialsCss extends CssResource {
String scrollPanel();
}
public interface PluginsResources extends ClientBundle {

@Source("Tutorials.css")
TutorialsCss tutorialsCss();
@Source("images/gwt-che-command-type.svg")
SVGResource gwtCheCommandType();

@Source("update.png")
ImageResource updateApp();

@Source("guide.png")
ImageResource guide();

@Source("codenvy-svg.svg")
SVGResource samplesCategoryCodenvy();

@Source("samples.svg")
SVGResource samplesCategorySamples();
@Source("cheClassPath.txt")
TextResource cheClassPath();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*******************************************************************************
* Copyright (c) 2012-2015 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.ide.ext.plugins.client.command;

import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Singleton;

import org.eclipse.che.ide.extension.machine.client.command.CommandConfigurationPage;

import javax.validation.constraints.NotNull;

/**
* Page allows to configure {@link GwtCheCommandConfiguration} command parameters.
*
* @author Artem Zatsarynnyi
*/
@Singleton
public class CommandPagePresenter implements CommandPageView.ActionDelegate, CommandConfigurationPage<GwtCheCommandConfiguration> {

private final CommandPageView view;

private GwtCheCommandConfiguration editedConfiguration;
/** GWT module value before any editing. */
private String originGwtModule;
/** Code server address value before any editing. */
private String originCodeServerAddress;
private String originClassPath;
private DirtyStateListener listener;

@Inject
public CommandPagePresenter(CommandPageView view) {
this.view = view;
view.setDelegate(this);
}

@Override
public void resetFrom(@NotNull GwtCheCommandConfiguration configuration) {
editedConfiguration = configuration;
originGwtModule = configuration.getGwtModule();
originCodeServerAddress = configuration.getCodeServerAddress();
originClassPath = configuration.getClassPath();
}

@Override
public void go(AcceptsOneWidget container) {
container.setWidget(view);

view.setGwtModule(editedConfiguration.getGwtModule());
view.setCodeServerAddress(editedConfiguration.getCodeServerAddress());
view.setClassPath(editedConfiguration.getClassPath());
}

@Override
public boolean isDirty() {
return !(originGwtModule.equals(editedConfiguration.getGwtModule()) &&
originCodeServerAddress.equals(editedConfiguration.getCodeServerAddress()) &&
originClassPath.equals(editedConfiguration.getClassPath()));
}

@Override
public void setDirtyStateListener(@NotNull DirtyStateListener listener) {
this.listener = listener;
}

@Override
public void onGwtModuleChanged() {
editedConfiguration.setGwtModule(view.getGwtModule());
listener.onDirtyStateChanged();
}

@Override
public void onCodeServerAddressChanged() {
editedConfiguration.setCodeServerAddress(view.getCodeServerAddress());
listener.onDirtyStateChanged();
}

@Override
public void onClassPathChanged() {
editedConfiguration.setClassPath(view.getClassPath());
listener.onDirtyStateChanged();
}
}
Loading

0 comments on commit d2247d9

Please sign in to comment.