本文整理匯總了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;
}