home *** CD-ROM | disk | FTP | other *** search
- package netscape.plugin.composer.io;
-
- public class Comment extends Token {
- String text;
- private static final String SELECTION_START = new String("-- selection start --");
- private static final String SELECTION_END = new String("-- selection end --");
- private static final String SELECTION_START_PLUS = new String("-- selection start+ --");
- private static final String SELECTION_END_PLUS = new String("-- selection end+ --");
-
- public Comment(StringBuffer var1) {
- this.text = var1.toString();
- }
-
- Comment(FooStringBuffer var1) {
- this.text = var1.toString();
- }
-
- public Comment(String var1) {
- this.text = var1;
- }
-
- public String getText() {
- return this.text;
- }
-
- public String toString() {
- return "<!" + this.text + ">";
- }
-
- public int hashCode() {
- return this.text.hashCode();
- }
-
- public boolean equals(Object var1) {
- return var1 != null && var1 instanceof Comment ? this.text.equals(((Comment)var1).text) : false;
- }
-
- public static Comment createSelectionStart() {
- return createSelectionStart(false);
- }
-
- public static Comment createSelectionStart(boolean var0) {
- return new Comment(var0 ? SELECTION_START_PLUS : SELECTION_START);
- }
-
- public static Comment createSelectionEnd() {
- return createSelectionEnd(false);
- }
-
- public static Comment createSelectionEnd(boolean var0) {
- return new Comment(var0 ? SELECTION_END_PLUS : SELECTION_END);
- }
-
- public boolean isSelection() {
- return this.isSelectionStart() || this.isSelectionEnd();
- }
-
- public boolean isSelectionStart() {
- return this.text.equals(SELECTION_START) || this.text.equals(SELECTION_START_PLUS);
- }
-
- public boolean isSelectionEnd() {
- return this.text.equals(SELECTION_END) || this.text.equals(SELECTION_END_PLUS);
- }
-
- public boolean isSelectionStickyAfter() {
- return this.text.equals(SELECTION_START_PLUS) || this.text.equals(SELECTION_END_PLUS);
- }
- }
-