本文整理汇总了Java中org.eclipse.swt.widgets.Control.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Control.isDisposed方法的具体用法?Java Control.isDisposed怎么用?Java Control.isDisposed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Control
的用法示例。
在下文中一共展示了Control.isDisposed方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addControlDisposeListener
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
/**
* Adds a {@link DisposeListener} to the created {@link Control}. Listeners can be added either before or after the
* Control is created.
*
* @param disposeListener The {@link DisposeListener} to add.
*
* @see Control#addControlDisposeListener(DisposeListener)
*/
public void addControlDisposeListener(DisposeListener disposeListener) {
Control control = getControl();
if (control != null) {
if (control.isDisposed()) {
return;
}
control.addDisposeListener(disposeListener);
}
else {
if (_DisposeListeners == null) {
_DisposeListeners = new LinkedHashSet<DisposeListener>();
}
_DisposeListeners.add(disposeListener);
}
}
示例2: tableSelectionChanged
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void tableSelectionChanged(TableItem item) {
Button setIdButton = getSetIdButton();
setIdButton.setEnabled(SCHEME_DIGEST.equals(item.getText(TABLE_COLUMN_SCHEME)));
Button removeButton = getRemoveButton();
removeButton.setEnabled(item != null);
initSchemeTableEditor(item);
initIdTableEditor(item);
Control idEditor = _IdTableEditor.getEditor();
if (idEditor != null && !idEditor.isDisposed()) {
idEditor.setFocus();
}
}
示例3: rebuild
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void rebuild(BatchScriptModel model) {
if (model == null) {
return;
}
contentProvider.rebuildTree(model);
TreeViewer treeViewer = getTreeViewer();
if (treeViewer != null) {
Control control = treeViewer.getControl();
if (control == null || control.isDisposed()){
return;
}
treeViewer.setInput(model);
}
}
示例4: addViewerControlDisposeListener
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void addViewerControlDisposeListener() {
StructuredViewer viewer = getViewer();
if (viewer == null) {
return;
}
Control control = viewer.getControl();
if (control.isDisposed()) {
return;
}
control.addDisposeListener(_ControlDisposeListener);
}
示例5: rebuild
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void rebuild(BashScriptModel model) {
if (model == null) {
return;
}
contentProvider.rebuildTree(model);
TreeViewer treeViewer = getTreeViewer();
if (treeViewer != null) {
Control control = treeViewer.getControl();
if (control == null || control.isDisposed()){
return;
}
treeViewer.setInput(model);
}
}
示例6: setHeight
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public static int setHeight(FormData fd, Control control, int rowcount) {
int height = 0;
if (control != null && !control.isDisposed()) {
GC gc = new GC(control);
try {
gc.setFont(JFaceResources.getDialogFont());
fd.height = Dialog.convertHeightInCharsToPixels(gc.getFontMetrics(), rowcount);
} finally {
gc.dispose();
}
}
return height;
}
示例7: refreshViewer
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public static void refreshViewer(Viewer viewer) {
Control widget = viewer.getControl();
if (widget.isDisposed()) {
return;
}
widget.getDisplay().asyncExec(() -> {
Control ctrl = widget;
if (ctrl == null || ctrl.isDisposed()) {
return;
}
viewer.refresh();
});
}
示例8: dataSourceChanged
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
public Object dataSourceChanged(SWTSkinObject skinObject, Object params) {
datasource = params;
if (soListArea != null) {
Control control = soListArea.getControl();
if ( !control.isDisposed()){
control.setData("DataSource", params);
}
}
return null;
}
示例9: ShellDocker
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public ShellDocker(Control anchorControl, Shell dockedShell) {
if (null == anchorControl || anchorControl.isDisposed()) {
throw new NullPointerException("anchorControl cannot be null or disposed");
}
if (null == dockedShell || dockedShell.isDisposed()) {
throw new NullPointerException("dockedShell cannot be null or disposed");
}
this.anchorControl = anchorControl;
this.dockedShell = dockedShell;
mainShell = anchorControl.getShell();
}
示例10: redraw
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void redraw() {
TreeViewer viewer = getTreeViewer();
if (viewer != null) {
Control control = viewer.getControl();
if ((control != null) && (!control.isDisposed())) {
control.setRedraw(false);
viewer.expandAll();
control.setRedraw(true);
}
}
}
示例11: outlinePageVisible
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected boolean outlinePageVisible(BatchEditorContentOutlinePage outlinePage) {
Control control = outlinePage.getControl();
/* when control is not available - means outline view is not visible, */
boolean controlAvailable = control==null || control.isDisposed() || ! control.isVisible();
return controlAvailable;
}
示例12: outlinePageVisible
import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected boolean outlinePageVisible(BashEditorContentOutlinePage outlinePage) {
Control control = outlinePage.getControl();
/* when control is not available - means outline view is not visible, */
boolean controlAvailable = control==null || control.isDisposed() || ! control.isVisible();
return controlAvailable;
}