-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add target constants for Anchor to use with alternate setTarget method
- Loading branch information
Showing
4 changed files
with
151 additions
and
1 deletion.
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
65 changes: 65 additions & 0 deletions
65
flow-html-components/src/main/java/com/vaadin/flow/component/html/AnchorTarget.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,65 @@ | ||
/* | ||
* Copyright 2000-2020 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.component.html; | ||
|
||
/** | ||
* Enum representing <code>target</code> attribute values for an <code><a></code> element. | ||
* | ||
* @author Vaadin Ltd | ||
* @since | ||
*/ | ||
public enum AnchorTarget { | ||
/** | ||
* Remove the target value. This has the same effect as <code>SELF</code>. | ||
*/ | ||
DEFAULT(""), | ||
/** | ||
* Open a link in the current context. | ||
*/ | ||
SELF("_self"), | ||
/** | ||
* Open a link in a new unnamed context. | ||
*/ | ||
BLANK("_blank"), | ||
/** | ||
* Open a link in the parent context, or the current context if there is no | ||
* parent context. | ||
*/ | ||
PARENT("_parent"), | ||
/** | ||
* Open a link in the top most grandparent | ||
* context, or the current context if there is no parent context. | ||
*/ | ||
TOP("_top"); | ||
|
||
private final String value; | ||
|
||
/** | ||
* @param value the text value to use by an {@code <a>} (anchor) tag. | ||
*/ | ||
AnchorTarget(String value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* @return | ||
* value the text value to use by an {@code <a>} (anchor) tag. | ||
*/ | ||
String getValue() { | ||
return value; | ||
} | ||
|
||
} |
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