mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
1) Created bookmark manager to facilitate the management of bookmarks. SMACK-144
2) Added RSS attribute to URLs. SMACK-136 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4007 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ae97f5fd6a
commit
8fe7e46330
5 changed files with 363 additions and 41 deletions
|
@ -12,10 +12,22 @@ package org.jivesoftware.smackx.bookmark;
|
|||
*
|
||||
* @author Derek DeMoro
|
||||
*/
|
||||
public class BookmarkedURL {
|
||||
public class BookmarkedURL implements SharedBookmark {
|
||||
|
||||
private String name;
|
||||
private String URL;
|
||||
private final String URL;
|
||||
private boolean isRss;
|
||||
private boolean isShared;
|
||||
|
||||
protected BookmarkedURL(String URL) {
|
||||
this.URL = URL;
|
||||
}
|
||||
|
||||
protected BookmarkedURL(String URL, String name, boolean isRss) {
|
||||
this.URL = URL;
|
||||
this.name = name;
|
||||
this.isRss = isRss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name representing the URL (eg. Jive Software). This can be used in as a label, or
|
||||
|
@ -32,7 +44,7 @@ public class BookmarkedURL {
|
|||
*
|
||||
* @param name the name.
|
||||
*/
|
||||
public void setName(String name) {
|
||||
protected void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
@ -44,14 +56,37 @@ public class BookmarkedURL {
|
|||
public String getURL() {
|
||||
return URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the URL.
|
||||
* Set to true if this URL is an RSS or news feed.
|
||||
*
|
||||
* @param URL the url.
|
||||
* @param isRss True if the URL is a news feed and false if it is not.
|
||||
*/
|
||||
public void setURL(String URL) {
|
||||
this.URL = URL;
|
||||
protected void setRss(boolean isRss) {
|
||||
this.isRss = isRss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this URL is a news feed.
|
||||
*
|
||||
* @return Returns true if this URL is a news feed.
|
||||
*/
|
||||
public boolean isRss() {
|
||||
return isRss;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof BookmarkedURL)) {
|
||||
return false;
|
||||
}
|
||||
BookmarkedURL url = (BookmarkedURL)obj;
|
||||
return url.getURL().equalsIgnoreCase(URL);
|
||||
}
|
||||
|
||||
protected void setShared(boolean shared) {
|
||||
this.isShared = shared;
|
||||
}
|
||||
|
||||
public boolean isShared() {
|
||||
return isShared;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue