-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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-6162: Fix problem project detection procedure #6264
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
442e3eb
Fix problem project detection
vparfonov 534ca94
Add problems descriptor to MutableProjectConfig
vparfonov 2759698
Fix formatting
vparfonov 6ccafe9
Avoid call updatePresntation on get
vparfonov 8951b4a
formating
vparfonov 157605f
Code cleanup
vparfonov 1b23bb2
Move class to the shared lib
vparfonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...e-core-api-model/src/main/java/org/eclipse/che/api/core/model/project/ProjectProblem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.eclipse.che.api.core.model.project; | ||
|
||
/** @author Vitalii Parfonov */ | ||
public interface ProjectProblem { | ||
|
||
int getCode(); | ||
|
||
String getMessage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,24 +10,12 @@ | |
*/ | ||
package org.eclipse.che.ide.resources.tree; | ||
|
||
import static com.google.common.base.Preconditions.checkArgument; | ||
import static com.google.common.base.Preconditions.checkState; | ||
import static com.google.common.collect.Lists.newArrayListWithExpectedSize; | ||
import static java.util.Collections.emptyList; | ||
import static java.util.Collections.unmodifiableList; | ||
import static org.eclipse.che.ide.api.resources.Resource.FILE; | ||
import static org.eclipse.che.ide.api.resources.Resource.FOLDER; | ||
import static org.eclipse.che.ide.api.resources.Resource.PROJECT; | ||
import static org.eclipse.che.ide.api.vcs.VcsStatus.NOT_MODIFIED; | ||
|
||
import com.google.common.annotations.Beta; | ||
import com.google.common.base.MoreObjects; | ||
import com.google.common.base.Objects; | ||
import com.google.common.base.Optional; | ||
import com.google.web.bindery.event.shared.EventBus; | ||
import java.util.List; | ||
import java.util.Set; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import org.eclipse.che.api.promises.client.Function; | ||
import org.eclipse.che.api.promises.client.FunctionException; | ||
import org.eclipse.che.api.promises.client.Promise; | ||
|
@@ -49,8 +37,23 @@ | |
import org.eclipse.che.ide.project.shared.NodesResources; | ||
import org.eclipse.che.ide.ui.smartTree.presentation.HasPresentation; | ||
import org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation; | ||
import org.eclipse.che.ide.util.loging.Log; | ||
import org.vectomatic.dom.svg.ui.SVGResource; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import static com.google.common.base.Preconditions.checkArgument; | ||
import static com.google.common.base.Preconditions.checkState; | ||
import static com.google.common.collect.Lists.newArrayListWithExpectedSize; | ||
import static java.util.Collections.emptyList; | ||
import static java.util.Collections.unmodifiableList; | ||
import static org.eclipse.che.ide.api.resources.Resource.FILE; | ||
import static org.eclipse.che.ide.api.resources.Resource.FOLDER; | ||
import static org.eclipse.che.ide.api.resources.Resource.PROJECT; | ||
import static org.eclipse.che.ide.api.vcs.VcsStatus.NOT_MODIFIED; | ||
|
||
/** | ||
* Abstract based implementation for all resource based nodes in the IDE. | ||
* | ||
|
@@ -146,14 +149,15 @@ public final NodePresentation getPresentation(boolean update) { | |
nodePresentation = new NodePresentation(); | ||
} | ||
|
||
updatePresentation(nodePresentation); | ||
if (update) { | ||
updatePresentation(nodePresentation); | ||
} | ||
|
||
return nodePresentation; | ||
} | ||
|
||
@Override | ||
public void updatePresentation(@NotNull NodePresentation presentation) { | ||
|
||
final StringBuilder cssBuilder = new StringBuilder(); | ||
|
||
final Optional<Marker> presentableTextMarker = getData().getMarker(PresentableTextMarker.ID); | ||
|
@@ -189,6 +193,7 @@ public void updatePresentation(@NotNull NodePresentation presentation) { | |
? nodesResources.hiddenSimpleFolder() | ||
: nodesResources.simpleFolder()); | ||
} else if (getData().getResourceType() == PROJECT) { | ||
Log.info(getClass(), ((Project) getData()).isProblem()); | ||
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. Non-informative info log |
||
presentation.setPresentableIcon( | ||
((Project) getData()).isProblem() | ||
? nodesResources.notValidProjectFolder() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...core-api-project/src/main/java/org/eclipse/che/api/project/server/ProjectProblemImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.eclipse.che.api.project.server; | ||
|
||
import org.eclipse.che.api.core.model.project.ProjectProblem; | ||
|
||
/** @author Vitalii Parfonov */ | ||
public class ProjectProblemImpl implements ProjectProblem { | ||
|
||
public ProjectProblemImpl(int code, String message) { | ||
this.code = code; | ||
this.message = message; | ||
} | ||
|
||
int code; | ||
String message; | ||
|
||
@Override | ||
public int getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe it would be better to return actual list of problems?
reference.getProblems()
WDYT?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.
yes, thx