-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add CheEditor object to the Workspace Next model #10457
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Copyright (c) 2012-2018 Red Hat, Inc. | ||
| * 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: | ||
| * Red Hat, Inc. - initial API and implementation | ||
| */ | ||
| package org.eclipse.che.api.workspace.server.wsnext.model; | ||
|
|
||
| /** | ||
| * Represents an editor inside of Che workspace. | ||
| * | ||
| * <p>It may be classic GWT IDE, Eclipse Theia or something else. | ||
| */ | ||
| public class CheEditor extends PluginBase { | ||
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong. |
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (!(o instanceof CheEditor)) { | ||
| return false; | ||
| } | ||
| CheEditor cheEditor = (CheEditor) o; | ||
| return super.equals(cheEditor); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return super.hashCode(); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "CheEditor{" | ||
| + "name='" | ||
| + getName() | ||
| + '\'' | ||
| + ", id='" | ||
| + getId() | ||
| + '\'' | ||
| + ", version='" | ||
| + getVersion() | ||
| + '\'' | ||
| + ", containers=" | ||
| + getContainers() | ||
| + ", endpoints=" | ||
| + getEndpoints() | ||
| + '}'; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,78 +14,21 @@ | |
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| public class ChePlugin { | ||
| /** Represents Che plugin in sidecar-powered workspace. */ | ||
| public class ChePlugin extends PluginBase { | ||
| private List<EditorCompatibility> editors = new ArrayList<>(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that I fully understand all last changes in WsNext Skeleton, and it's just a note to consider: in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. editor field contains a list of editors supported by a plugin with identifiers in a field
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, thanks for the explanation. Does it mean that different CheEditors can be used at the same time? It's OK just to clarify. As far as I understand
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ChePlugin shows that different plugins might be used with it, but Che should ensure that just one is in use. |
||
|
|
||
| private String name = null; | ||
| private String id = null; | ||
| private String version = null; | ||
| private List<CheContainer> containers = new ArrayList<>(); | ||
| private List<ChePluginEndpoint> endpoints = new ArrayList<>(); | ||
|
|
||
| /** Object name. Name must be unique. */ | ||
| public ChePlugin name(String name) { | ||
| this.name = name; | ||
| return this; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public ChePlugin id(String id) { | ||
| this.id = id; | ||
| return this; | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(String id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public ChePlugin version(String version) { | ||
| this.version = version; | ||
| return this; | ||
| } | ||
|
|
||
| public String getVersion() { | ||
| return version; | ||
| } | ||
|
|
||
| public void setVersion(String version) { | ||
| this.version = version; | ||
| } | ||
|
|
||
| public ChePlugin containers(List<CheContainer> containers) { | ||
| this.containers = containers; | ||
| return this; | ||
| } | ||
|
|
||
| public List<CheContainer> getContainers() { | ||
| return containers; | ||
| } | ||
|
|
||
| public void setContainers(List<CheContainer> containers) { | ||
| this.containers = containers; | ||
| } | ||
|
|
||
| public ChePlugin endpoints(List<ChePluginEndpoint> endpoints) { | ||
| this.endpoints = endpoints; | ||
| public ChePlugin editors(List<EditorCompatibility> editors) { | ||
| this.editors = editors; | ||
| return this; | ||
| } | ||
|
|
||
| public List<ChePluginEndpoint> getEndpoints() { | ||
| return endpoints; | ||
| public List<EditorCompatibility> getEditors() { | ||
| return editors; | ||
| } | ||
|
|
||
| public void setEndpoints(List<ChePluginEndpoint> endpoints) { | ||
| this.endpoints = endpoints; | ||
| public void setEditors(List<EditorCompatibility> editors) { | ||
| this.editors = editors; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -96,37 +39,36 @@ public boolean equals(Object o) { | |
| if (!(o instanceof ChePlugin)) { | ||
| return false; | ||
| } | ||
| ChePlugin chePlugin = (ChePlugin) o; | ||
| return Objects.equals(getName(), chePlugin.getName()) | ||
| && Objects.equals(getId(), chePlugin.getId()) | ||
| && Objects.equals(getVersion(), chePlugin.getVersion()) | ||
| && Objects.equals(getContainers(), chePlugin.getContainers()) | ||
| && Objects.equals(getEndpoints(), chePlugin.getEndpoints()); | ||
| if (!super.equals(o)) { | ||
| return false; | ||
| } | ||
| ChePlugin plugin = (ChePlugin) o; | ||
| return Objects.equals(getEditors(), plugin.getEditors()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
|
|
||
| return Objects.hash( | ||
| super.hashCode(), getName(), getId(), getVersion(), getContainers(), getEndpoints()); | ||
| return Objects.hash(super.hashCode(), getEditors()); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ChePlugin{" | ||
| + "name='" | ||
| + name | ||
| + getName() | ||
| + '\'' | ||
| + ", id='" | ||
| + id | ||
| + getId() | ||
| + '\'' | ||
| + ", version='" | ||
| + version | ||
| + getVersion() | ||
| + '\'' | ||
| + ", containers=" | ||
| + containers | ||
| + getContainers() | ||
| + ", endpoints=" | ||
| + endpoints | ||
| + getEndpoints() | ||
| + ", editors=" | ||
| + getEditors() | ||
| + '}'; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * Copyright (c) 2012-2018 Red Hat, Inc. | ||
| * 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: | ||
| * Red Hat, Inc. - initial API and implementation | ||
| */ | ||
| package org.eclipse.che.api.workspace.server.wsnext.model; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| /** Specifies compatibility with a specific Che editor and plugins needed for the compatibility. */ | ||
| public class EditorCompatibility { | ||
| private String name; | ||
| private List<String> plugins; | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public EditorCompatibility name(String name) { | ||
| this.name = name; | ||
| return this; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public EditorCompatibility plugins(List<String> plugins) { | ||
| this.plugins = plugins; | ||
| return this; | ||
| } | ||
|
|
||
| public List<String> getPlugins() { | ||
| return plugins; | ||
| } | ||
|
|
||
| public void setPlugins(List<String> plugins) { | ||
| this.plugins = plugins; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (!(o instanceof EditorCompatibility)) { | ||
| return false; | ||
| } | ||
| EditorCompatibility that = (EditorCompatibility) o; | ||
| return Objects.equals(getName(), that.getName()) | ||
| && Objects.equals(getPlugins(), that.getPlugins()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(getName(), getPlugins()); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "EditorCompatibility{" + "name='" + name + '\'' + ", plugins=" + plugins + '}'; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have editor and plugins. Maybe we should rename
feature-api.yamlto something different. Because we don't have features anymore.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to change it because there is fresh blog post from Mario that uses instructions where this name is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oook. however, it looks weird. For how long are you going to keep it in this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Is it important to you?