当前位置: 首页>>代码示例>>Java>>正文


Java DisposeEvent类代码示例

本文整理汇总了Java中org.eclipse.swt.events.DisposeEvent的典型用法代码示例。如果您正苦于以下问题:Java DisposeEvent类的具体用法?Java DisposeEvent怎么用?Java DisposeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DisposeEvent类属于org.eclipse.swt.events包,在下文中一共展示了DisposeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getListControl

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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;
}
 
开发者ID:rajendarreddyj,项目名称:eclipse-weblogic-plugin,代码行数:18,代码来源:ListFieldEditor.java

示例2: createPreviewer

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:SpecComparePage.java

示例3: AbstractDataModelWidgetView

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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);
        }
    });
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:22,代码来源:AbstractDataModelWidgetView.java

示例4: addImageHyperlinkToolBarContribution

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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);
        }
    });
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:27,代码来源:DataModelFormEditor.java

示例5: ZnodeNewWizardComposite

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:27,代码来源:ZnodeNewWizardComposite.java

示例6: ChartManager

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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 ();
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:26,代码来源:ChartManager.java

示例7: createControl

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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 ();
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ChartViewerPane.java

示例8: ToolBarNavigator

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:18,代码来源:ToolBarNavigator.java

示例9: DataItemLabel

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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 ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:18,代码来源:DataItemLabel.java

示例10: checkCreateDialog

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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;
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:VisibilityTester.java

示例11: createComposite

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:CallbackDialog.java

示例12: ServersViewer

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:ServersViewer.java

示例13: open

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:29,代码来源:DiskWindow.java

示例14: createDialogArea

import org.eclipse.swt.events.DisposeEvent; //导入依赖的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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:HydrographInstallationDialog.java

示例15: createTextMenu

import org.eclipse.swt.events.DisposeEvent; //导入依赖的package包/类
/**
 * Create the context menu for the text widget.
 * 
 * @since 3.4
 */
private void createTextMenu() {
	final MenuManager textManager = new MenuManager();
	textManager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
			null, IWorkbenchCommandConstants.EDIT_COPY, CommandContributionItem.STYLE_PUSH)));
	textManager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
			null, IWorkbenchCommandConstants.EDIT_SELECT_ALL, CommandContributionItem.STYLE_PUSH)));
	text.setMenu(textManager.createContextMenu(text));
	text.addDisposeListener(new DisposeListener() {

		public void widgetDisposed(DisposeEvent e) {
			textManager.dispose();
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:CustomAboutDialog.java


注:本文中的org.eclipse.swt.events.DisposeEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。