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