forked from eclipse-che/che
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHE-5339: Mark with color Git changed files in project explorer (ecli…
- Loading branch information
Showing
33 changed files
with
909 additions
and
38 deletions.
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
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
32 changes: 32 additions & 0 deletions
32
ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/vcs/HasVcsStatus.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,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2017 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.api.vcs; | ||
|
||
/** | ||
* Indicates that specified resource has VCS status attribute. | ||
* | ||
* @author Igor Vinokur | ||
*/ | ||
public interface HasVcsStatus { | ||
|
||
/** | ||
* Returns VCS status attribute of the resource. | ||
*/ | ||
VcsStatus getVcsStatus(); | ||
|
||
/** | ||
* Set VCS status attribute to the resource. | ||
* | ||
* @param vcsStatus | ||
* VCS status to set | ||
*/ | ||
void setVcsStatus(VcsStatus vcsStatus); | ||
} |
54 changes: 54 additions & 0 deletions
54
ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/vcs/VcsStatus.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,54 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2017 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.api.vcs; | ||
|
||
import org.eclipse.che.ide.api.theme.Style; | ||
|
||
import static java.util.Arrays.stream; | ||
|
||
public enum VcsStatus { | ||
|
||
UNTRACKED("untracked"), | ||
ADDED("added"), | ||
MODIFIED("modified"), | ||
NOT_MODIFIED("not_modified"); | ||
|
||
private String value; | ||
|
||
VcsStatus(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public String getColor() { | ||
switch (this) { | ||
case UNTRACKED: | ||
return Style.getVcsStatusUntrackedColor(); | ||
case MODIFIED: | ||
return Style.getVcsStatusModifiedColor(); | ||
case ADDED: | ||
return Style.getVcsStatusAddedColor(); | ||
case NOT_MODIFIED: | ||
return Style.getMainFontColor(); | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
public static VcsStatus from(String value) { | ||
return stream(VcsStatus.values()).filter(vcsStatus -> vcsStatus.getValue().equals(value.toLowerCase())) | ||
.findAny() | ||
.orElse(null); | ||
} | ||
} |
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
Oops, something went wrong.