亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rcomboboxmodel.java

?? 具有不同語法高亮的編輯器實例
?? JAVA
字號:
/*
 * 01/15/2004
 *
 * RComboBoxModel.java - A combo box model that limits the number of items
 * the combo box wil remember.  It also won't add an item to the combo box
 * if it is already there.
 * Copyright (C) 2004 Robert Futrell
 * email@address.com
 * www.website.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package org.fife.ui;

import java.io.Serializable;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;


/**
 * A combo box model that limits the number of items the combo box will
 * "remember."  You can use it like so:
 * <br>
 * <code>RComboBoxModel model = new RComboBoxModel();</code><br>
 * <code>model.setMaxNumElements(10);</code><br>
 * <code>JComboBox comboBox = new JComboBox(model);</code><br><br>
 * It also won't let you add an item to the combo box twice (i.e., no
 * duplicates), and it adds new items to the beginning of the list, not
 * the end (as <code>JComboBox</code>'s do by default).<br><br>
 * It defaults to 10 elements remembered.
 *
 * @author Robert Futrell
 * @version 0.8
 */
public class RComboBoxModel extends DefaultComboBoxModel
										implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7656706291506122984L;

	/**
	 * The number of items the combo box will remember.
	 */
	private int maxNumElements;


/*****************************************************************************/


	/**
	 * Creates a new combo box model with a maximum element count of
	 * <code>8</code>.
	 */
	public RComboBoxModel() {
		super();
		setMaxNumElements(8);
	}


/*****************************************************************************/


	/**
	 * Creates a new combo box model with a maximum element count of
	 * <code>8</code>.
	 *
	 * @param items The initial items to use to populate the combo box.
	 */
	public RComboBoxModel(Object[] items) {
		super(items);
		setMaxNumElements(8);
	}


/*****************************************************************************/


	/**
	 * Creates a new combo box model with a maximum element count of
	 * <code>8</code>.
	 *
	 * @param v The initial items to use to populate the combo box.
	 */
	public RComboBoxModel(Vector v) {
		super(v);
		setMaxNumElements(8);
	}


/*****************************************************************************/


	/**
	 * Adds the object (if it's not already in the list) to the front of
	 * the list.  If it's already in the list, move it to the top.
	 *
	 * @param anObject The object to add.
	 */
	public void addElement(Object anObject) {

		// If the object is already in the list, ensure that it is at
		// the top of the list.
		int index = getIndexOf(anObject);
		if (index>0) {
			removeElementAt(index);
			super.insertElementAt(anObject, 0);
		}

		// If the item isn't in the list yet, add it to the top.
		else if (index<0) {
			super.insertElementAt(anObject, 0);
			ensureValidItemCount();
		}

	}


/*****************************************************************************/


	/**
	 * Ensures the number if items remembered by this combo box is valid.
	 */
	private void ensureValidItemCount() {
		while (getSize()>maxNumElements)
			removeElementAt(getSize()-1);
	}


/*****************************************************************************/


	/**
	 * Returns the maximum number of items this combo box can hold.
	 *
	 * @return The maximum number of items this combo box can hold.
	 */
	public int getMaxNumElements() {
		return maxNumElements;
	}


/*****************************************************************************/


	/**
	 * Adds an item at a specified index.  The implementation of this method
	 * should notify all registered <code>ListDataListeners</code> that the
	 * item has been added.
	 *
	 * @param anObject The <code>Object</code> to be added.
	 * @param index Location to add the object.
	 */
	public void insertElementAt(Object anObject, int index) {

		// Don't add the object if it's already in the list.
		if (getIndexOf(anObject)>-1)
			return;

		super.insertElementAt(anObject, index);
		ensureValidItemCount();

	}


/*****************************************************************************/


	/**
	 * Sets the maximum number of items this combo box can hold.
	 *
	 * @param numElements The maximum number of items this combo box can hold.
	 *        If <code>numElements <= 0</code>, then the capacity
	 *        of this combo box is set to <code>4</code>.
	 */
	public void setMaxNumElements(int numElements) {
		maxNumElements = numElements<=0 ? 4 : numElements;
		ensureValidItemCount();
	}


/*****************************************************************************/

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品一区二区三区| 日韩欧美在线影院| 国产99久久久精品| 九九热在线视频观看这里只有精品| 国产精品丝袜在线| 国产精品动漫网站| 亚洲人一二三区| 亚洲最快最全在线视频| 最新久久zyz资源站| 亚洲精品亚洲人成人网在线播放| 国产精品传媒入口麻豆| 亚洲免费观看高清完整| 国产精品色眯眯| 国产精品情趣视频| 亚洲视频图片小说| 亚洲成人黄色小说| 美女国产一区二区三区| 久久精品国产一区二区三| 午夜不卡av免费| 国产一区二区主播在线| 午夜精品福利久久久| 99国内精品久久| 欧美激情在线一区二区三区| 黄色精品一二区| 精品国产乱码久久久久久久久| 亚洲高清免费视频| 欧美性猛交xxxxxxxx| 亚洲三级在线看| av日韩在线网站| 综合久久久久久久| 一本一本大道香蕉久在线精品| 国产精品国产精品国产专区不蜜| 丁香一区二区三区| 国产亚洲欧美一级| 懂色一区二区三区免费观看| 国产农村妇女毛片精品久久麻豆 | 欧美一级免费大片| 日韩av高清在线观看| 制服丝袜一区二区三区| 丝袜美腿亚洲一区二区图片| 91精品免费观看| 麻豆精品一区二区av白丝在线| 欧美一区二区三区在线| 奇米色777欧美一区二区| 精品国产一区二区三区av性色 | 国产精品18久久久| 国产精品色婷婷| 欧美性受xxxx黑人xyx性爽| 亚洲国产日韩精品| 日韩一区二区中文字幕| 精品一区二区三区久久久| 国产香蕉久久精品综合网| 成人午夜激情视频| 亚洲日本va午夜在线影院| 欧美日韩国产综合一区二区| 久久精品久久精品| 日韩伦理av电影| 欧美高清精品3d| 国产一区欧美二区| 亚洲午夜久久久久久久久久久| 7777精品伊人久久久大香线蕉超级流畅 | 久久91精品久久久久久秒播| 国产欧美视频一区二区| 色综合色综合色综合| 日韩av一区二区在线影视| 久久综合久久综合九色| 色综合色狠狠天天综合色| 麻豆免费精品视频| 亚洲色图色小说| 久久综合色综合88| 欧美日韩在线播放三区| 国产一区二区在线观看免费| 国产精品免费视频网站| 欧美亚洲愉拍一区二区| 懂色av中文字幕一区二区三区| 一区二区三国产精华液| 久久精品一区二区三区不卡| 在线观看日韩高清av| 国产麻豆视频一区| 日韩综合小视频| 成人免费在线视频| 久久久夜色精品亚洲| 欧美精品aⅴ在线视频| 成人性生交大片免费看在线播放| 天天色天天操综合| 亚洲视频一区在线观看| 久久综合色一综合色88| 欧美一级xxx| 欧美中文字幕一区二区三区| 风间由美中文字幕在线看视频国产欧美| 亚洲国产日韩精品| 亚洲天堂久久久久久久| 国产欧美一区二区精品性| 日韩欧美在线1卡| 欧美日韩视频专区在线播放| 99re热这里只有精品视频| 经典三级视频一区| 青草av.久久免费一区| 亚洲成人av资源| 亚洲综合色在线| 亚洲欧美日韩一区二区 | 欧美电影免费观看高清完整版 | 亚洲亚洲精品在线观看| 亚洲品质自拍视频网站| 日韩av午夜在线观看| 视频一区视频二区中文| 婷婷久久综合九色国产成人 | 国产剧情一区在线| 另类小说综合欧美亚洲| 美女国产一区二区三区| 免费观看在线综合| 日本不卡免费在线视频| 日韩精品一级中文字幕精品视频免费观看| 亚洲精品日韩一| 国产精品欧美一区二区三区| 国产亚洲精品超碰| 日本一区二区高清| 国产欧美日韩精品a在线观看| 精品国免费一区二区三区| 91偷拍与自偷拍精品| 欧美日韩精品二区第二页| 欧美视频第二页| 欧美疯狂做受xxxx富婆| 91麻豆精品国产综合久久久久久| 欧美电影在哪看比较好| 日韩精品最新网址| 国产日韩欧美一区二区三区综合| 国产色综合久久| 欧美高清视频www夜色资源网| 日韩欧美国产综合一区| 国产精品一区一区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久男人中文字幕资源站| 91精品国产综合久久久蜜臀粉嫩 | 日韩一区二区精品| 久久久久久久久久电影| 亚洲欧洲av另类| 亚洲综合一区二区| 老司机精品视频在线| 成人精品国产免费网站| 色婷婷综合视频在线观看| 91精品欧美一区二区三区综合在| 欧美www视频| 亚洲视频在线观看一区| 日韩高清一区在线| 成人av在线一区二区| 欧美午夜精品一区二区蜜桃| 日韩精品一区二区三区三区免费| 亚洲国产精品99久久久久久久久| 亚洲精品免费电影| 久国产精品韩国三级视频| 91在线视频播放地址| 欧美一区午夜精品| 综合激情网...| 免费在线观看成人| 色妞www精品视频| 日韩欧美中文字幕公布| 亚洲黄色小说网站| 卡一卡二国产精品| 日本韩国一区二区三区视频| 精品久久久久久久久久久院品网| 日韩理论片在线| 国产乱码精品一区二区三区五月婷 | 欧美日韩视频在线第一区 | 91亚洲国产成人精品一区二三| 欧美三级午夜理伦三级中视频| 久久久蜜臀国产一区二区| 亚洲午夜精品17c| av网站一区二区三区| 精品国产乱码久久久久久免费| 亚洲午夜视频在线| 99精品欧美一区| 国产欧美日韩视频一区二区| 日韩福利视频导航| 欧美中文字幕久久| 国产精品久久久久一区| 国产在线国偷精品免费看| 91精品国产色综合久久ai换脸| 亚洲精品乱码久久久久久久久| 国产精品一级片在线观看| 日韩午夜精品电影| 亚洲国产精品久久艾草纯爱 | 欧美片在线播放| 亚洲免费在线电影| 波多野结衣在线aⅴ中文字幕不卡| 日韩你懂的电影在线观看| 国产又黄又大久久| 色屁屁一区二区| www成人在线观看| 一片黄亚洲嫩模| 国产精品1024| 日韩午夜在线观看视频| 中文字幕日韩欧美一区二区三区| 亚洲成人免费观看| 国产凹凸在线观看一区二区| 欧美色视频一区| 中文字幕一区二区三区在线播放 | 奇米影视一区二区三区| 不卡一二三区首页| 欧美一区二区三区不卡|