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


Java Composite.addDisposeListener方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Composite.addDisposeListener方法的典型用法代码示例。如果您正苦于以下问题:Java Composite.addDisposeListener方法的具体用法?Java Composite.addDisposeListener怎么用?Java Composite.addDisposeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Composite的用法示例。


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

示例1: createControl

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void createControl(Composite parent) {
	Composite listComposite = new Composite(parent, NONE);
	listComposite.setLayout(new FillLayout());

	ListViewer projectListViewer = new ListViewer(listComposite, SWT.BORDER | SWT.MULTI);
	projectListViewer.setContentProvider(ArrayContentProvider.getInstance());
	projectListViewer.setInput(getNonTestProjects());

	// Data binding
	DataBindingContext databindingContext = new DataBindingContext();
	parent.addDisposeListener(e -> databindingContext.dispose());

	databindingContext.bindList(ViewersObservables.observeMultiSelection(projectListViewer),
			PojoProperties.list(N4MFProjectInfo.class, N4MFProjectInfo.TESTED_PROJECT_PROP_NAME)
					.observe(projectInfo));

	setControl(listComposite);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:N4MFWizardTestedProjectPage.java

示例2: createTopContent

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
protected void createTopContent(String title, InputStream imageName) {
    Composite top = new Composite(composite, SWT.NONE);

    top.setLayout(new GridLayout(2, false));
    top.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    top.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    
    final Image image = new Image(top.getDisplay(), imageName);
    Image resized = resizeImage(image, 48, 48);
    Label labelImage = new Label(top, SWT.CENTER);
    labelImage.setImage(resized);
    
    Label label = new Label(top, SWT.NONE);
    label.setText(title);
    final Font newFont = new Font(display, fontName, getTitleFontSize(), SWT.NORMAL);
    label.setFont(newFont);
    label.setBackground(rowColorSelection);
    
    createLineContent();
    
    top.addDisposeListener(e -> {
        newFont.dispose();
        resized.dispose();
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:26,代码来源:PluginDialog.java

示例3: createControl

import org.eclipse.swt.widgets.Composite; //导入方法依赖的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

示例4: createComposite

import org.eclipse.swt.widgets.Composite; //导入方法依赖的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

示例5: init

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
private void init(Composite parent, BrowserContext browserContext) {
    browserView = new BrowserView(new Browser(browserContext));
	Frame frame = SWT_AWT.new_Frame(this);
	frame.add(browserView);
	threadSwt = parent.getDisplay().getThread();
	parent.addDisposeListener(new DisposeListener() {
		
		@Override
		public void widgetDisposed(DisposeEvent e) {
			dispose();
		}
	});
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:14,代码来源:C8oBrowser.java

示例6: initialize

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public void initialize(Composite composite, int defaultOrientation) {
	display = composite.getDisplay();
	composite.addDisposeListener((DisposeListener) this::dispose);
	
	tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
	table = tableViewer.getTable();
	
       GridData gridData = new GridData();
       gridData.verticalAlignment = GridData.FILL;
       gridData.horizontalSpan = 2;
       gridData.grabExcessHorizontalSpace = true;
       gridData.grabExcessVerticalSpace = true;
       gridData.horizontalAlignment = GridData.FILL;
       tableViewer.getControl().setLayoutData(gridData);
	
	tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
	table.addListener(SWT.Selection, event-> {
		TableItem item = (TableItem) event.item;
		contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
		handleSelection();
	});
	composite.getShell().addListener(SWT.Resize, event ->  autoAdjustColumnWidths(composite));
	
	// TODO try throttleLast or custom scheduler
	//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));

}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:28,代码来源:KaviList.java

示例7: ProjectCompareTree

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 * Create an instance.
 */
public ProjectCompareTree(Composite parent, int style, ProjectCompareTreeHelper projectCompareTreeHelper) {
	super(parent, style);
	this.projectCompareTreeHelper = projectCompareTreeHelper;

	parent.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			onDispose();
		}
	});

	col_diff_error_fg = new Color(parent.getDisplay(), 255, 40, 40);
	col_diff_conformant_fg = new Color(parent.getDisplay(), 60, 127, 95);
	col_classifier_bg = new Color(parent.getDisplay(), 200, 220, 250);

	final Tree tree = getTree();
	for (int n = 0; n < NUM_OF_COLUMNS; n++) {
		final TreeColumn colN = new TreeColumn(tree, SWT.LEFT);
		if (n == 0)
			colN.setWidth(300); // make API column a bit wider
		else
			colN.setWidth(200);
	}

	tree.setHeaderVisible(true);
	tree.setLinesVisible(true);

	setLabelProvider(new MyLabelProvider());
	setContentProvider(new MyContentProvider());

	setComparison(null, null, null);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:36,代码来源:ProjectCompareTree.java

示例8: createControl

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
public void createControl(final Composite parent) {
	super.createControl(parent); // We need to create the UI controls from the parent class.

	final Composite control = (Composite) getControl();
	control.setLayout(GridLayoutFactory.fillDefaults().create());
	control.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	final DataBindingContext dbc = new DataBindingContext();
	control.addDisposeListener(e -> dbc.dispose());

	createVendorIdControls(dbc, control);

	ComboViewer projectTypeCombo = new ComboViewer(control, READ_ONLY);
	projectTypeCombo.setLabelProvider(new ProjectTypeLabelProvider());
	projectTypeCombo.setContentProvider(ArrayContentProvider.getInstance());
	projectTypeCombo.getControl().setLayoutData(fillDefaults().grab(true, false).create());
	projectTypeCombo.setInput(ProjectType.values());

	Composite projectTypePropertyControls = new Composite(control, NONE);
	StackLayout changingStackLayout = new StackLayout();
	projectTypePropertyControls.setLayout(changingStackLayout);
	projectTypePropertyControls.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	Composite defaultOptions = initDefaultOptionsUI(dbc, projectTypePropertyControls);
	Composite libraryProjectOptionsGroup = initLibraryOptionsUI(dbc, projectTypePropertyControls);
	Composite testProjectOptionsGroup = initTestProjectUI(dbc, projectTypePropertyControls);

	initProjectTypeBinding(dbc, projectTypeCombo);

	// Configure stack layout to show advanced options
	projectTypeCombo.addPostSelectionChangedListener(e -> {
		switch (projectInfo.getProjectType()) {
		case LIBRARY:
			changingStackLayout.topControl = libraryProjectOptionsGroup;
			break;
		case TEST:
			changingStackLayout.topControl = testProjectOptionsGroup;
			break;
		default:
			changingStackLayout.topControl = defaultOptions;
		}
		projectTypePropertyControls.layout(true);
		setPageComplete(validatePage());
	});

	// IDs from: org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs.class
	createWorkingSetGroup(
			(Composite) getControl(),
			null,
			new String[] { "org.eclipse.ui.resourceWorkingSetPage",
					"org.eclipse.jdt.ui.JavaWorkingSetPage",
					"org.eclipse.jdt.internal.ui.OthersWorkingSet"
			}); // $NON-NLS-1$
	Dialog.applyDialogFont(getControl());

	dbc.updateTargets();

	setControl(control);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:61,代码来源:N4MFWizardNewProjectCreationPage.java

示例9: createToolTipContentArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Composite createToolTipContentArea ( final Event event, final Composite parent )
{
    parent.setLayout ( new FillLayout () );
    final Composite wrapper = new Composite ( parent, SWT.NONE );

    wrapper.addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            DataItemToolTip.this.resourceManager.dispose ();
        }
    } );

    final GridLayout layout = new GridLayout ( 2, false );
    layout.marginHeight = 10;
    layout.marginWidth = 10;
    layout.horizontalSpacing = 20;
    layout.verticalSpacing = 20;

    wrapper.setLayout ( layout );
    wrapper.setBackground ( wrapper.getDisplay ().getSystemColor ( SWT.COLOR_WHITE ) );
    wrapper.setBackgroundMode ( SWT.INHERIT_DEFAULT );

    this.headerLabel = new Label ( wrapper, SWT.NONE );
    this.headerLabel.setText ( this.item.getId () );
    this.headerLabel.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false, 2, 1 ) );
    this.headerLabel.setFont ( JFaceResources.getHeaderFont () );

    final Label warnIcon = new Label ( wrapper, SWT.NONE );
    warnIcon.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, false, false ) );
    warnIcon.setImage ( Activator.getDefault ().getImageRegistry ().get ( Activator.IMG_WARN_BIG ) );

    this.text = new StyledText ( wrapper, SWT.MULTI );
    this.text.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );

    if ( this.currentText != null )
    {
        this.text.setText ( this.currentText.getString () );
        this.text.setStyleRanges ( this.currentText.getStyleRanges () );
    }

    return wrapper;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:46,代码来源:DataItemToolTip.java


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