本文整理汇总了Java中org.eclipse.swt.events.DisposeListener类的典型用法代码示例。如果您正苦于以下问题:Java DisposeListener类的具体用法?Java DisposeListener怎么用?Java DisposeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisposeListener类属于org.eclipse.swt.events包,在下文中一共展示了DisposeListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getListControl
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
@Override
public List getListControl(final Composite parent) {
if (this.list == null) {
this.list = new List(parent, 2820);
this.list.addSelectionListener(this.getSelectionListener());
this.list.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent event) {
ListFieldEditor.this.list = null;
}
});
} else {
this.checkParent(this.list, parent);
}
return this.list;
}
示例2: createPreviewer
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
private Control createPreviewer(Composite parent) {
final CompareConfiguration compareConfiguration = new CompareConfiguration();
compareConfiguration.setLeftLabel("Original " + docTypeName);
compareConfiguration.setLeftEditable(false);
compareConfiguration.setRightLabel("Updated " + docTypeName);
compareConfiguration.setRightEditable(false);
compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
compareConfiguration.setProperty(PREFIX_SUFFIX_PROPERTY, fPrefixSuffix);
fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
// add initial input in order to avoid problems when disposing the viewer later:
fViewer.setInput(new DiffNode(new TargetElementFromString(""), new TargetElementFromString("")));
Control control = fViewer.getControl();
control.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
compareConfiguration.dispose();
}
});
return control;
}
示例3: AbstractDataModelWidgetView
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
/**
* Constructor.
*
* @param model The {@link DataModel}.
* @param widget The {@link Widget} view.
*/
public AbstractDataModelWidgetView(DataModel<?, ?, ?> model, W widget) {
_Model = model;
_Widget = widget;
registerModelEventListener();
_Widget.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
unregisterModelEventListener();
_Widget.removeDisposeListener(this);
}
});
}
示例4: addControlDisposeListener
import org.eclipse.swt.events.DisposeListener; //导入依赖的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);
}
}
示例5: addImageHyperlinkToolBarContribution
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
protected void addImageHyperlinkToolBarContribution(final IManagedForm headerForm,
final IToolBarManager toolBarManager, final BaseControlContribution baseControlContribution,
final DataModel<?, ?, ?> model) {
final Separator separator = new Separator();
toolBarManager.add(separator);
toolBarManager.add(baseControlContribution);
baseControlContribution.addControlDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (!model.isDestroyed()) {
// Only do this clean up when the model destruction caused the widget disposal
// WARNING: toolBarManager.update(true); throws a NullPointer if called during app exit.
return;
}
toolBarManager.remove(separator);
separator.dispose();
toolBarManager.remove(baseControlContribution);
toolBarManager.update(true);
}
});
}
示例6: ZnodeNewWizardComposite
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
/**
* TODO: Comment.
*
* @param parent
*/
public ZnodeNewWizardComposite(Composite parent, ZnodeModel parentZnodeModel) {
super(parent);
_ParentZnodeModel = parentZnodeModel;
ParentZnodeModelEventListener delegate = new ParentZnodeModelEventListener();
final IGenericDataModelEventListener parentZnodeModelEventListener = (IGenericDataModelEventListener) SwtThreadSafeDelegatingInvocationHandler
.createProxyInstance(delegate, IGenericDataModelEventListener.class, true);
_ParentZnodeModel.addGenericEventListener(parentZnodeModelEventListener);
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
_ParentZnodeModel.removeGenericEventListener(parentZnodeModelEventListener);
}
});
setNumColumns(3);
}
示例7: ChartManager
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
public ChartManager ( final Composite parent, final int style )
{
super ( parent, style );
setLayout ( makeLayout () );
// title row
this.title = new Label ( this, SWT.NONE );
this.title.setLayoutData ( new GridData ( GridData.CENTER, GridData.FILL, true, false, 1, 1 ) );
// row 2
this.chartArea = new ChartArea ( this, SWT.NONE );
this.chartArea.setLayoutData ( makeMainLayoutData () );
addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
onDispose ();
}
} );
}
示例8: createControl
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
public void createControl ( final Composite parent )
{
this.wrapper = new Composite ( parent, SWT.NONE );
this.wrapper.setLayout ( GridLayoutFactory.slimStack () );
final Composite extensionSpace = new Composite ( this.wrapper, SWT.NONE );
extensionSpace.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );
extensionSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) );
this.chartArea = new ChartArea ( this.wrapper, SWT.NONE );
this.chartArea.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
this.viewer = new ChartViewer ( this.chartArea.getDisplay (), this.chartArea.getChartRenderer (), this.configuration, new CompositeExtensionSpace ( extensionSpace ), null );
parent.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
}
示例9: ToolBarNavigator
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
public ToolBarNavigator ( final Composite parent, final int style, final ViewManager viewManager )
{
this.viewManager = viewManager;
this.toolbar = new ToolBar ( parent, style );
this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ) );
this.toolbar.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
viewManager.addViewManagerListener ( this );
}
示例10: DataItemLabel
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
public DataItemLabel ( final Composite composite, final String connectionId, final String itemId )
{
this.label = new CLabel ( composite, SWT.NONE );
this.dataItem = new DataItemObservableValue ( Activator.getDefault ().getBundle ().getBundleContext (), connectionId, itemId );
this.label.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
this.model = PojoObservables.observeDetailValue ( this.dataItem, "value", Variant.class ); //$NON-NLS-1$
this.dbc = new DataBindingContext ();
bind ();
}
示例11: checkCreateDialog
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
private void checkCreateDialog ()
{
if ( this.dialog != null )
{
return;
}
this.dialog = new Shell ();
this.dialog.setText ( "Visibility Tester" );
this.dialog.open ();
this.dialog.setLayout ( new GridLayout ( 1, false ) );
this.dialog.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
VisibilityTester.this.dialog = null;
}
} );
}
示例12: createComposite
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
private Composite createComposite ( final Composite wrapper )
{
this.dbc = new DataBindingContext ( DisplayRealm.getRealm ( wrapper.getDisplay () ) );
wrapper.addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
CallbackDialog.this.dbc.dispose ();
}
} );
final Composite composite = new Composite ( wrapper, SWT.NONE );
composite.setLayout ( new GridLayout ( 2, false ) );
for ( final CallbackWidgetFactory factory : this.factories )
{
factory.createGridWidgets ( this.dbc, composite );
}
return composite;
}
示例13: ServersViewer
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
public ServersViewer ( final Composite parent )
{
parent.setLayout ( new FillLayout () );
this.viewer = new TreeViewer ( parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL );
this.contentProvider = new ObservableSetTreeContentProvider ( new ObservableFactoryImpl (), null );
this.viewer.setContentProvider ( this.contentProvider );
this.labelProvider = new ServerLabelProvider ( this.contentProvider.getKnownElements () );
this.viewer.setLabelProvider ( this.labelProvider );
this.viewer.setInput ( HivesPlugin.getDefault ().getServerManager () );
this.viewer.getControl ().addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
ColumnViewerToolTipSupport.enableFor ( this.viewer );
}
示例14: open
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
/**
* Setup the Disk window and display (open) it.
*/
public void open() {
shell = new Shell(parentShell, SWT.SHELL_TRIM);
shell.setLayout(new FillLayout());
shell.setImage(imageManager.get(ImageManager.ICON_DISK));
setStandardWindowTitle();
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
dispose(event);
}
});
CTabFolder tabFolder = new CTabFolder(shell, SWT.BOTTOM);
new DiskExplorerTab(tabFolder, disks, imageManager, this);
diskMapTabs = new DiskMapTab[disks.length];
for (int i=0; i<disks.length; i++) {
if (disks[i].supportsDiskMap()) {
diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
}
}
diskInfoTab = new DiskInfoTab(tabFolder, disks);
tabFolder.setSelection(tabFolder.getItems()[0]);
shell.open();
}
示例15: createDialogArea
import org.eclipse.swt.events.DisposeListener; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.getShell().setMinimumSize(950, 500);
folder = new CTabFolder(composite, SWT.NONE);
configureFolder();
createFolderItems(folder);
GridData folderData = new GridData(SWT.FILL, SWT.FILL, true, true);
folderData.widthHint = convertHorizontalDLUsToPixels(TAB_WIDTH_IN_DLUS);
folderData.heightHint = convertVerticalDLUsToPixels(TAB_HEIGHT_IN_DLUS);
folder.setLayoutData(folderData);
folder.addSelectionListener(createFolderSelectionListener());
folder.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
releaseContributions();
}
});
return composite;
}