⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xabstractbookmark.java

📁 XBrowser是一个完全免费并且开源的Web浏览器
💻 JAVA
字号:
/****************************************************************
*              XBrowser  -  eXtended web Browser                *
*                                                               *
*           Copyright (c) 2000-2001  Armond Avanes              *
*     Refer to ReadMe & License files for more information      *
*                                                               *
*                                                               *
*                      By: Armond Avanes                        *
*       Armond555@yahoo.com     &    Armond333@yahoo.com        *
*                http://xbrowser.sourceforge.net/               *
*****************************************************************/
package xbrowser.bookmark;

import java.util.*;
import java.beans.*;

/** Bookmark item that have title, creation/modification dates and
 *  its own place in bookmark tree, but dont have storage for url.
 */
public abstract class XAbstractBookmark
{
	/** Create empty bookmark that was created and modified today. */
	public XAbstractBookmark()
	{
		creationDate = new Date();
		modificationDate = new Date();

		propChangeSupport = new PropertyChangeSupport(this);
	}

	/** Create bookmark with given title and description
	 *  that was created and modified today. */
	public XAbstractBookmark(String title, String desc)
	{
		this();
		setTitle(title);
		setDescription(desc);
	}

	public void addPropertyChangeListener(PropertyChangeListener listener)
	{
		propChangeSupport.addPropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener)
	{
		propChangeSupport.removePropertyChangeListener(listener);
	}

	public String toString()
	{
		return getTitle();
	}

	/** Set title. */
	public void setTitle(String new_title)
	{
	String old_title = title;

		title = new_title;
		propChangeSupport.firePropertyChange("Title",old_title,new_title);
	}

	/** Get title. */
	public String getTitle()
	{
		return title;
	}

	/** Set bookmark's description. */
	public void setDescription(String new_description)
	{
	String old_description = description;

		description = new_description;
		propChangeSupport.firePropertyChange("Description",old_description,new_description);
	}

	/** Get bookmark's description. */
	public String getDescription()
	{
		return description;
	}

	/** Set Folder where bookmark will have place. */
	public void setParent(XBookmarkFolder new_parent)
	{
	XBookmarkFolder old_parent = parent;

		parent = new_parent;
		propChangeSupport.firePropertyChange("Parent",old_parent,new_parent);
	}

	/** Get Folder where bookmark have place. */
	public XBookmarkFolder getParent()
	{
		return parent;
	}

	/** Set bookmark creation date. */
	public void setCreationDate(Date new_date)
	{
	Date old_date = creationDate;

		creationDate = new_date;
		propChangeSupport.firePropertyChange("CreationDate",old_date,new_date);
	}

	/** Get bookmark creation date. */
	public Date getCreationDate()
	{
		return creationDate;
	}

	/** Set bookmark modification date. */
	public void setModificationDate(Date new_date)
	{
	Date old_date = modificationDate;

		modificationDate = new_date;
		propChangeSupport.firePropertyChange("ModificationDate",old_date,new_date);
	}

	/** Get bookmark modification date. */
	public Date getModificationDate()
	{
		return modificationDate;
	}

	/** Is bookark in Folder that marked 'Personal'?. */
	public boolean isUnderPersonalFolder()
	{
		if( parent!=null )
			return( parent.isPersonalFolder() ? true : parent.isUnderPersonalFolder() );
		else
			return false;
	}

	/** Override to implement opening bookmark. */
	public abstract void open();
	/** Override to implement copying bookmark. */
	public abstract void copy();

// Attributes:
	protected String title = "";
	protected String description = "";
	protected XBookmarkFolder parent = null;
	protected Date creationDate = null;
	protected Date modificationDate = null;

	protected PropertyChangeSupport propChangeSupport = null;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -