Java Code Examples for org.eclipse.swt.widgets.Composite#dispose()

The following examples show how to use org.eclipse.swt.widgets.Composite#dispose() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Composite3DModifier.java    From ldparteditor with MIT License 5 votes vote down vote up
/**
 * Displays a horizontal and vertical scale around the
 * {@linkplain Composite3D}.
 *
 * @param shown
 *            True if the scale should be shown
 */
public void showScale(boolean shown) {
    NLogger.debug(Composite3DModifier.class, "[Show scale]"); //$NON-NLS-1$
    if (shown) {
        new CompositeScale(c3d.getCompositeContainer(), c3d, SWT.NONE);
    } else {
        Composite oldScale = c3d.getParent();
        c3d.setParent(c3d.getCompositeContainer());
        // Important, since the FillLayout from the parent requires no LayoutData
        c3d.setLayoutData(null);
        oldScale.dispose();
    }
    c3d.getCompositeContainer().layout();
}
 
Example 2
Source File: HistogramView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
public PackedScrolledComposite(Composite parent, int style) {
    super(parent, style);
    Composite composite = new Composite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    composite.setSize(1, 1);
    fScrollBarSize = composite.computeSize(0, 0);
    composite.dispose();
}
 
Example 3
Source File: SWTStrategyUIFactory.java    From atdl4j with MIT License 5 votes vote down vote up
public static StrategyUI createStrategyUIAndContainer(SWTStrategiesUI aStrategiesUI, StrategyT aStrategy)
{
	// create composite
	Composite strategyParent = new Composite( aStrategiesUI.getStrategiesPanel(), SWT.NONE );
	
	GridLayout strategyParentLayout = new GridLayout( 2, false );
	strategyParentLayout.verticalSpacing = 0;
	strategyParent.setLayout( strategyParentLayout );
	
	StrategyUI ui;

	// build strategy and catch strategy-specific errors
	try 
	{
		ui = createStrategyUI( aStrategy, aStrategiesUI.getStrategies(), aStrategiesUI.getStrategiesRules(), strategyParent, aStrategiesUI.getAtdl4jOptions() );
		
		// -- add additional components to take up space on left and bottom --
		Label tempLabel = new Label( strategyParent, SWT.NONE );
		tempLabel.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );					
		Label tempLabel2 = new Label( strategyParent, SWT.NONE );
		tempLabel2.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );					
		Label tempLabel3 = new Label( strategyParent, SWT.NONE );
		tempLabel3.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );					
	} 
	catch (Throwable e) 
	{
		getAtdl4jUserMessageHandler().displayException( "Strategy Load Error",
				"Error in Strategy: " + Atdl4jHelper.getStrategyUiRepOrName( aStrategy ), e );

		// rollback changes
		strategyParent.dispose();

		// skip to next strategy
		return null;
	} 

	ui.setCxlReplaceMode( aStrategiesUI.getAtdl4jOptions().getInputAndFilterData().getInputCxlReplaceMode() );

	return ui;
}
 
Example 4
Source File: PluginHelpDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 5
Source File: RTFCleanerDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 6
Source File: AboutDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 7
Source File: TBXMakerDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmpTemp = parent.getParent();
	parent.dispose();
	cmpTemp.layout();
}
 
Example 8
Source File: TMXValidatorDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	parent.dispose();
}
 
Example 9
Source File: JavaPropertiesViewerDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	// super.createButtonsForButtonBar(parent);
	parent.dispose();
}
 
Example 10
Source File: PluginHelpDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 11
Source File: PluginHelpDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 12
Source File: RTFCleanerDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 13
Source File: CSV2TMXConverterDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmpTemp = parent.getParent();
	parent.dispose();
	cmpTemp.layout();
}
 
Example 14
Source File: AboutDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 15
Source File: TBXMakerDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmpTemp = parent.getParent();
	parent.dispose();
	cmpTemp.layout();
}
 
Example 16
Source File: TMXValidatorDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	parent.dispose();
}
 
Example 17
Source File: JavaPropertiesViewerDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	// super.createButtonsForButtonBar(parent);
	parent.dispose();
}
 
Example 18
Source File: UpdateNoteDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	Composite cmp = parent.getParent();
	parent.dispose();
	cmp.layout();
}
 
Example 19
Source File: TypeInfoViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private int computeScrollBarWidth() {
	Composite t= new Composite(fTable.getShell(), SWT.V_SCROLL);
	int result= t.computeTrim(0, 0, 0, 0).width;
	t.dispose();
	return result;
}
 
Example 20
Source File: TabbedPropertySheetPage.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Disposes the TabContents objects passed to this method. If the
 * 'currentTab' is going to be disposed, then the caller should call
 * aboutToBeHidden() on the currentTab and set it to null before calling
 * this method. Also, the caller needs to ensure that descriptorToTab map
 * entries corresponding to the disposed TabContents objects are also
 * removed.
 *
 * @param tabs
 * @since 3.6
 */
protected void disposeTabs(Collection tabs) {
	for (Iterator<TabContents> iter = tabs.iterator(); iter.hasNext();) {
		TabContents tab = iter.next();
		Composite composite = tabToComposite.remove(tab);
		tab.dispose();
		if (composite != null) {
			composite.dispose();
		}
	}
}