-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download external resources preference
Signed-off-by: azerr <azerr@redhat.com>
- Loading branch information
1 parent
1159498
commit c6c90b8
Showing
30 changed files
with
808 additions
and
282 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
62 changes: 62 additions & 0 deletions
62
...a/org/eclipse/lemminx/extensions/contentmodel/participants/ExternalResourceErrorCode.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,62 @@ | ||
/** | ||
* Copyright (c) 2022 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.lemminx.extensions.contentmodel.participants; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.eclipse.lemminx.services.extensions.diagnostics.IXMLErrorCode; | ||
|
||
/** | ||
* External resource error code when referenced XSD, DTD (with DOCTYPE, | ||
* xsi:schemaLocation) is downloaded. | ||
* | ||
*/ | ||
public enum ExternalResourceErrorCode implements IXMLErrorCode { | ||
|
||
DownloadResourceDisabled, // | ||
DownloadingResource, // | ||
ResourceNotInDeployedPath, // | ||
DownloadProblem; | ||
|
||
private final String code; | ||
|
||
private ExternalResourceErrorCode() { | ||
this(null); | ||
} | ||
|
||
private ExternalResourceErrorCode(String code) { | ||
this.code = code; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
if (code == null) { | ||
return name(); | ||
} | ||
return code; | ||
} | ||
|
||
private final static Map<String, ExternalResourceErrorCode> codes; | ||
|
||
static { | ||
codes = new HashMap<>(); | ||
for (ExternalResourceErrorCode errorCode : values()) { | ||
codes.put(errorCode.getCode(), errorCode); | ||
} | ||
} | ||
|
||
public static ExternalResourceErrorCode get(String name) { | ||
return codes.get(name); | ||
} | ||
} |
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.