本文整理汇总了Java中org.eclipse.swt.widgets.Item.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Item.isDisposed方法的具体用法?Java Item.isDisposed怎么用?Java Item.isDisposed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Item
的用法示例。
在下文中一共展示了Item.isDisposed方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: useItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
protected void useItem ( final Item item )
{
if ( this.label != null )
{
item.setText ( this.label );
}
item.setImage ( getEmptyImage () );
this.blinker = new StyleBlinker () {
@Override
public void update ( final CurrentStyle currentStyle )
{
if ( !item.isDisposed () )
{
updateItem ( item, currentStyle );
}
}
};
this.styler = new StateStyler ( this.blinker );
this.styler.style ( new SummaryStateInformation ( this.summaryInformation ) );
}
示例2: getChildren
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
@Override
protected Item[] getChildren(Widget parent) {
if (parent.isDisposed()) return new Item[0];
Item[] result = super.getChildren(parent);
for (Item item : result) {
if (item.isDisposed()) {
return getChildrenIgnoringDisposed(result).toArray(result);
}
}
return result;
}
示例3: getChildrenIgnoringDisposed
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
private List<Item> getChildrenIgnoringDisposed(Item[] unfiltered) {
ArrayList result = new ArrayList(unfiltered.length);
for (Item child : unfiltered) {
if (!child.isDisposed()) {
result.add(child);
}
}
return result;
}
示例4: doUpdateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void doUpdateItem(final Item item, Object element) {
super.doUpdateItem(item, element);
updateRowHeader(item);
if(autoPreferredHeight && !item.isDisposed())
((GridItem)item).pack();
}
示例5: applyEditorValue
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
/**
* Deactivates the currently active cell editor.
*/
public void applyEditorValue() {
CellEditor c = this.cellEditor;
if (c != null) {
// null out cell editor before calling save
// in case save results in applyEditorValue being re-entered
// see 1GAHI8Z: ITPUI:ALL - How to code event notification when
// using cell editor ?
this.cellEditor = null;
Item t = this.tableItem;
// don't null out table item -- same item is still selected
if (t != null && !t.isDisposed()) {
saveEditorValue(c, t);
}
setEditor(null, null, 0);
c.removeListener(cellEditorListener);
Control control = c.getControl();
if (control != null) {
if (mouseListener != null) {
control.removeMouseListener(mouseListener);
}
if (focusListener != null) {
control.removeFocusListener(focusListener);
}
}
c.deactivate();
}
}
示例6: doUpdateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
protected void doUpdateItem(Item item, Object element) {
super.doUpdateItem(item, element);
if(!item.isDisposed() && checkStateProvider != null) {
setChecked(element, checkStateProvider.isChecked(element));
setGrayed(element, checkStateProvider.isGrayed(element));
}
}
示例7: dispose
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
public static void dispose(Item i) {
if (i != null && !i.isDisposed())
i.dispose();
}
示例8: isDisposed
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
public static boolean isDisposed(Item x) {
return x==null || x.isDisposed();
}
示例9: updateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
private void updateItem(Item item) {
if (!item.isDisposed()) {
fContentViewerAccess.doUpdateItem(item);
}
}
示例10: updateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
private void updateItem(Item item) {
if (!item.isDisposed()) {
_commonViewer.doUpdateItem(item);
}
}
示例11: doUpdateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
protected void doUpdateItem(Item item, Object element) {
// update icon and label
// Similar code in TableTreeViewer.doUpdateItem()
IBaseLabelProvider prov = getLabelProvider();
ITableLabelProvider tprov = null;
if (prov instanceof ITableLabelProvider) {
tprov = (ITableLabelProvider) prov;
}
int columnCount = tableTree.getTable().getColumnCount();
TableTreeItem ti = (TableTreeItem) item;
// Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
// TableViewer with 0 columns does not work
for (int column = 0; column < columnCount || column == 0; column++) {
String text = "";//$NON-NLS-1$
Image image = null;
if (tprov != null) {
text = tprov.getColumnText(element, column);
image = tprov.getColumnImage(element, column);
} else {
if (column == 0) {
ViewerLabel updateLabel = new ViewerLabel(item.getText(),
item.getImage());
buildLabel(updateLabel, element);
// As it is possible for user code to run the event
// loop check here.
if (item.isDisposed()) {
unmapElement(element, item);
return;
}
text = updateLabel.getText();
image = updateLabel.getImage();
}
}
// Avoid setting text to null
if (text == null) {
text = ""; //$NON-NLS-1$
}
ti.setText(column, text);
// Apparently a problem to setImage to null if already null
if (ti.getImage(column) != image) {
ti.setImage(column, image);
}
getColorAndFontCollector().setFontsAndColors(element);
getColorAndFontCollector().applyFontsAndColors(ti);
}
}
示例12: doUpdateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
protected void doUpdateItem(Widget widget, Object element, boolean fullMap) {
boolean oldBusy = isBusy();
setBusy(true);
try {
if (widget instanceof Item) {
final Item item = (Item) widget;
// remember element we are showing
if (fullMap) {
associate(element, item);
} else {
Object data = item.getData();
if (data != null) {
unmapElement(data, item);
}
item.setData(element);
mapElement(element, item);
}
int columnCount = doGetColumnCount();
if (columnCount == 0)
columnCount = 1;// If there are no columns do the first one
ViewerRow viewerRowFromItem = getViewerRowFromItem(item);
boolean isVirtual = (getControl().getStyle() & SWT.VIRTUAL) != 0;
// If the control is virtual, we cannot use the cached viewer row object. See bug 188663.
if (isVirtual) {
viewerRowFromItem = (ViewerRow) viewerRowFromItem.clone();
}
// Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
// TableViewer with 0 columns does not work
for (int column = 0; column < columnCount || column == 0; column++) {
ViewerColumn columnViewer = getViewerColumn(column);
ViewerCell cellToUpdate = updateCell(viewerRowFromItem,
column, element);
// If the control is virtual, we cannot use the cached cell object. See bug 188663.
if (isVirtual) {
cellToUpdate = new ViewerCell(cellToUpdate.getViewerRow(), cellToUpdate.getColumnIndex(), element);
}
columnViewer.refresh(cellToUpdate);
// clear cell (see bug 201280)
updateCell(null, 0, null);
// As it is possible for user code to run the event
// loop check here.
if (item.isDisposed()) {
unmapElement(element, item);
return;
}
}
}
} finally {
setBusy(oldBusy);
}
}
示例13: doUpdateItem
import org.eclipse.swt.widgets.Item; //导入方法依赖的package包/类
/**
* Copies the attributes of the given element into the given SWT item.
*
* @param item
* the SWT item
* @param element
* the element
*/
protected void doUpdateItem(final Item item, Object element) {
if (item.isDisposed()) {
unmapElement(element, item);
return;
}
int columnCount = doGetColumnCount();
if (columnCount == 0)// If no columns are created then fake one
columnCount = 1;
ViewerRow viewerRowFromItem = getViewerRowFromItem(item);
boolean isVirtual = (getControl().getStyle() & SWT.VIRTUAL) != 0;
// If the control is virtual, we cannot use the cached viewer row
// object. See bug 188663.
if (isVirtual) {
viewerRowFromItem = (ViewerRow) viewerRowFromItem.clone();
}
for (int column = 0; column < columnCount; column++) {
ViewerColumn columnViewer = getViewerColumn(column);
ViewerCell cellToUpdate = updateCell(viewerRowFromItem, column,
element);
// If the control is virtual, we cannot use the cached cell object.
// See bug 188663.
if (isVirtual) {
cellToUpdate = new ViewerCell(cellToUpdate.getViewerRow(),
cellToUpdate.getColumnIndex(), element);
}
columnViewer.refresh(cellToUpdate);
// clear cell (see bug 201280)
updateCell(null, 0, null);
// As it is possible for user code to run the event
// loop check here.
if (item.isDisposed()) {
unmapElement(element, item);
return;
}
}
}