?? iliststrategy.java
字號:
package com.swtplus.widgets.list;
import org.eclipse.swt.graphics.Point;
import com.swtplus.internal.PGC;
import com.swtplus.widgets.PListItem;
import com.swtplus.widgets.PList;
/**
* The IListStrategy draws items on a PList.
*
*/
public interface IListStrategy {
/**
* Returns the size for the given ListItem. The PList currently only
* supports vertical scrolling and sizes each item's width to the available
* width. Therefore the x value returned from this method is ignored.
* Accordingly, the hHint argument is always SWT.DEFAULT.
*
* @param item the item being sized
* @param gc a GCPlus created on the PList (allowing string/text extents)
* @param wHint width hint
* @param hHint height hint (currently always SWT.DEFAULT)
* @return the size of the item
*/
public Point computeSize(PListItem item,PGC gc,int wHint, int hHint);
/**
* Paints the given item
*
* @param item item to paint
* @param gc GCPlus from the paint event
* @param selected true if this item is selected
* @param focused true if this item is focused
* @param hovering true if the mouse is hovering over this item
* @param size the size returned from the computeSize method for this item
*
*/
public void paintItem(PListItem item,PGC gc,boolean selected, boolean focused, boolean hovering,Point size);
/**
* Checks a newly created item to verify that the item is as the strategy
* requires. This method is called when a list item is created.
* <p>
* For example, if a strategy requires that all items be a subclass of
* ListItem called ThisStrategyListItem then the code might look like:
* <p>
* <code>
* Assert.isTrue(item instanceof ThisStrategyListItem);<BR>
* </code>
*
* @param item Newly created item to verify
*/
public void checkItem(PListItem item);
/**
* Initializes the strategy.
*
* @param pList PList parent
*/
public void initialize(PList pList);
/**
* Returns true if the strategy draws items differently when the mouse is
* hovering over them. This method is necessary to eliminate unnecessary
* painting.
*
* @return true if items draw differently when hovered over.
*/
public boolean isHoverOnUnselected();
/**
* Dispose of this strategy.
*/
public void dispose();
/**
* Called when the PList's font is updated.
*/
public abstract void fontChanged();
/**
* Called when one of the PList's colors is updated.
*/
public abstract void colorChanged();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -