Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE-4619; Move factory functionality into core #4655

Merged
merged 6 commits into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions assembly/assembly-ide-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-ext-dashboard-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-factory-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-factory-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-gdb-ide</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions ide/che-core-ide-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-factory-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-git-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-machine-shared</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,4 +943,109 @@ public interface CoreLocalizationConstant extends Messages {
@Key("authentication.dialog.rejected.by.user")
String authenticationDialogRejectedByUser();


/* Factories */
@Key("projects.import.configuring.cloning")
String cloningSource();

@Key("create.factory.action.title")
String createFactoryActionTitle();

@Key("create.factory.already.exist")
String createFactoryAlreadyExist();

@Key("create.factory.unable.create.from.current.workspace")
String createFactoryFromCurrentWorkspaceFailed();

@Key("create.factory.form.title")
String createFactoryTitle();

@Key("create.factory.label.name")
String createFactoryName();

@Key("create.factory.label.link")
String createFactoryLink();

@Key("create.factory.button.create")
String createFactoryButton();

@Key("create.factory.button.close")
String createFactoryButtonClose();

@Key("create.factory.configure.button.tooltip")
String createFactoryConfigureTooltip();

@Key("create.factory.launch.button.tooltip")
String createFactoryLaunchTooltip();


@Key("import.config.view.name")
String importFromConfigurationName();

@Key("import.config.view.description")
String importFromConfigurationDescription();

@Key("project.import.configured.cloned")
String clonedSource(String projectName);

@Key("import.config.form.button.import")
String importButton();

@Key("import.config.view.title")
String importFromConfigurationTitle();

@Key("import.config.form.prompt")
String configFileTitle();

@Key("project.already.imported")
String projectAlreadyImported(String projectName);

@Key("project.import.cloned.with.checkout")
String clonedSourceWithCheckout(String projectName, String repoName, String ref, String branch);

@Key("project.import.cloned.with.checkout.start.point")
String clonedWithCheckoutOnStartPoint(String projectName, String repoName, String startPoint, String branch);

@Key("project.import.configuring.cloning")
String cloningSource(String projectName);

@Key("project.import.ssh.key.upload.failed.title")
String cloningSourceSshKeyUploadFailedTitle();

@Key("project.import.ssh.key.upload.failed.text")
String cloningSourcesSshKeyUploadFailedText();

@Key("message.ssh.key.not.found.text")
String acceptSshNotFoundText();

@Key("project.import.cloning.failed.without.start.point")
String cloningSourceWithCheckoutFailed(String branch, String repoName);

@Key("project.import.cloning.failed.with.start.point")
String cloningSourceCheckoutFailed(String project, String branch);

@Key("project.import.cloning.failed.title")
String cloningSourceFailedTitle(String projectName);

@Key("project.import.configuring.failed")
String configuringSourceFailed(String projectName);

@Key("welcome.preferences.title")
String welcomePreferencesTitle();

@Key("export.config.view.name")
String exportConfigName();

@Key("export.config.view.description")
String exportConfigDescription();

@Key("export.config.error.message")
String exportConfigErrorMessage();

@Key("export.config.dialog.not.under.vcs.title")
String exportConfigDialogNotUnderVcsTitle();

@Key("export.config.dialog.not.under.vcs.text")
String exportConfigDialogNotUnderVcsText();

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.eclipse.che.ide.debug.DebugApiModule;
import org.eclipse.che.ide.editor.EditorApiModule;
import org.eclipse.che.ide.editor.preferences.EditorPreferencesModule;
import org.eclipse.che.ide.factory.FactoryApiModule;
import org.eclipse.che.ide.factory.inject.FactoryGinModule;
import org.eclipse.che.ide.filetypes.FileTypeApiModule;
import org.eclipse.che.ide.keybinding.KeyBindingManager;
import org.eclipse.che.ide.machine.MachineApiModule;
Expand Down Expand Up @@ -110,7 +110,7 @@ protected void configure() {
install(new ProjectApiModule());
install(new ProjectImportModule());
install(new OAuthApiModule());
install(new FactoryApiModule());
install(new FactoryGinModule());

// configure miscellaneous core components
bind(StandardComponentInitializer.class).in(Singleton.class);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.factory.ide;
package org.eclipse.che.ide.factory;

import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.ScriptInjector;
Expand All @@ -18,10 +18,10 @@
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;
import org.eclipse.che.ide.api.extension.Extension;
import org.eclipse.che.plugin.factory.ide.accept.AcceptFactoryHandler;
import org.eclipse.che.plugin.factory.ide.action.CreateFactoryAction;
import org.eclipse.che.plugin.factory.ide.json.ImportFromConfigAction;
import org.eclipse.che.plugin.factory.ide.welcome.OpenWelcomePageAction;
import org.eclipse.che.ide.factory.accept.AcceptFactoryHandler;
import org.eclipse.che.ide.factory.action.CreateFactoryAction;
import org.eclipse.che.ide.factory.json.ImportFromConfigAction;
import org.eclipse.che.ide.factory.welcome.OpenWelcomePageAction;

import static com.google.gwt.core.client.ScriptInjector.TOP_WINDOW;
import static org.eclipse.che.ide.api.action.IdeActions.GROUP_PROJECT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.factory.ide;
package org.eclipse.che.ide.factory;

import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
Expand Down Expand Up @@ -40,15 +40,15 @@ interface Style extends CssResource {
@Source({"Factory.css", "org/eclipse/che/ide/api/ui/style.css", "org/eclipse/che/ide/ui/Styles.css"})
FactoryCSS factoryCSS();

@Source("svg/export-config.svg")
@Source("export-config.svg")
SVGResource exportConfig();

@Source("svg/import-config.svg")
@Source("import-config.svg")
SVGResource importConfig();

@Source("svg/execute.svg")
@Source("execute.svg")
SVGResource execute();

@Source("svg/cog-icon.svg")
@Source("cog-icon.svg")
SVGResource configure();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.factory.ide.accept;
package org.eclipse.che.ide.factory.accept;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Singleton;
Expand All @@ -17,15 +17,15 @@
import org.eclipse.che.api.factory.shared.dto.FactoryDto;
import org.eclipse.che.api.factory.shared.dto.IdeActionDto;
import org.eclipse.che.api.factory.shared.dto.IdeDto;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.factory.FactoryAcceptedEvent;
import org.eclipse.che.ide.api.machine.events.WsAgentStateEvent;
import org.eclipse.che.ide.api.machine.events.WsAgentStateHandler;
import org.eclipse.che.ide.api.notification.NotificationManager;
import org.eclipse.che.ide.api.notification.StatusNotification;
import org.eclipse.che.plugin.factory.ide.FactoryLocalizationConstant;
import org.eclipse.che.plugin.factory.ide.utils.FactoryProjectImporter;
import org.eclipse.che.ide.factory.utils.FactoryProjectImporter;

import javax.inject.Inject;

Expand All @@ -37,25 +37,25 @@
*/
@Singleton
public class AcceptFactoryHandler {
private final FactoryLocalizationConstant factoryLocalization;
private final FactoryProjectImporter factoryProjectImporter;
private final EventBus eventBus;
private final AppContext appContext;
private final ActionManager actionManager;
private final NotificationManager notificationManager;
private final CoreLocalizationConstant localizationConstant;
private final FactoryProjectImporter factoryProjectImporter;
private final EventBus eventBus;
private final AppContext appContext;
private final ActionManager actionManager;
private final NotificationManager notificationManager;

private StatusNotification notification;
private boolean isImportingStarted;

@Inject
public AcceptFactoryHandler(FactoryLocalizationConstant factoryLocalization,
public AcceptFactoryHandler(CoreLocalizationConstant localizationConstant,
FactoryProjectImporter factoryProjectImporter,
EventBus eventBus,
AppContext appContext,
ActionManager actionManager,
NotificationManager notificationManager) {
this.factoryProjectImporter = factoryProjectImporter;
this.factoryLocalization = factoryLocalization;
this.localizationConstant = localizationConstant;
this.eventBus = eventBus;
this.appContext = appContext;
this.actionManager = actionManager;
Expand All @@ -80,7 +80,7 @@ public void onWsAgentStarted(final WsAgentStateEvent event) {
isImportingStarted = true;

notification = notificationManager
.notify(factoryLocalization.cloningSource(), StatusNotification.Status.PROGRESS, NOT_EMERGE_MODE);
.notify(localizationConstant.cloningSource(), StatusNotification.Status.PROGRESS, NOT_EMERGE_MODE);
performOnAppLoadedActions(factory);
startImporting(factory);
}
Expand All @@ -98,7 +98,7 @@ private void startImporting(final FactoryDto factory) {
@Override
public void onSuccess(Void result) {
notification.setStatus(StatusNotification.Status.SUCCESS);
notification.setContent(factoryLocalization.cloningSource());
notification.setContent(localizationConstant.cloningSource());
performOnProjectsLoadedActions(factory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.factory.ide.action;
package org.eclipse.che.ide.factory.action;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.action.AbstractPerspectiveAction;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.plugin.factory.ide.FactoryLocalizationConstant;
import org.eclipse.che.plugin.factory.ide.configure.CreateFactoryPresenter;
import org.eclipse.che.ide.factory.configure.CreateFactoryPresenter;

import javax.validation.constraints.NotNull;
import java.util.Collections;
Expand All @@ -31,8 +31,8 @@ public class CreateFactoryAction extends AbstractPerspectiveAction {

@Inject
public CreateFactoryAction(CreateFactoryPresenter presenter,
FactoryLocalizationConstant locale) {
super(Collections.singletonList("Project Perspective"), locale.createFactoryActionTitle(), null, null, null);
CoreLocalizationConstant localizationConstant) {
super(Collections.singletonList("Project Perspective"), localizationConstant.createFactoryActionTitle(), null, null, null);
this.presenter = presenter;
}

Expand Down
Loading