FileDocCategorySizeDatePackage
ShellFactory.javaAPI DocAzureus 3.0.3.46948Tue May 08 16:12:48 BST 2007org.gudy.azureus2.ui.swt.components.shell

ShellFactory

public final class ShellFactory extends Object
Facilitates the creation of SWT Shells with platform-specific additions. All shells normal to the user should be created from ShellFactory
version
1.0
author
James Yeh

Fields Summary
Constructors Summary
Methods Summary
public static org.eclipse.swt.widgets.ShellcreateMainShell(int styles)

		Shell parent = null;
		
		UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();

		if ( uiFunctions != null ){
			
			parent = uiFunctions.getMainShell();
		}
		
		if ( parent == null ){
			
			return createShell(SWTThread.getInstance().getDisplay());
		}
		
		return( createShell( parent, styles ));
	
public static org.eclipse.swt.widgets.ShellcreateShell(org.eclipse.swt.widgets.Display disp, int styles)

Creates a shell

For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar

see
org.eclipse.swt.widgets.Shell

        return getRegisteredShell(new AEShell(disp, styles));
    
public static org.eclipse.swt.widgets.ShellcreateShell(org.eclipse.swt.widgets.Display disp)

Creates a shell

For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar

see
org.eclipse.swt.widgets.Shell

        return getRegisteredShell(new AEShell(disp));
    
public static org.eclipse.swt.widgets.ShellcreateShell(org.eclipse.swt.widgets.Shell parent, int styles)

Creates a shell

For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar

see
org.eclipse.swt.widgets.Shell

        if (parent != null && parent.isDisposed())
    		    return null;
    	
        return getRegisteredShell(new AEShell(parent, styles));
    
public static org.eclipse.swt.widgets.ShellcreateShell(org.eclipse.swt.widgets.Shell parent)

Creates a shell

For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar

see
org.eclipse.swt.widgets.Shell

        return getRegisteredShell(new AEShell(parent));
    
public static org.eclipse.swt.widgets.ShellcreateShell(int styles)

Creates a shell

For platforms that use a unified menu bar, the shell's menu bar is set to the main window's menu bar

see
org.eclipse.swt.widgets.Shell

        return getRegisteredShell(new AEShell(styles));
    
private static org.eclipse.swt.widgets.ShellgetRegisteredShell(org.eclipse.swt.widgets.Shell toRegister)

Gets the registered shell

Registration entails setting its menu bar if platform uses a unified menu bar. Also, the shell is added to the shared ShellManager

param
toRegister A SWT Shell
return
The SWT Shell

		// register main menu
		if (Constants.isOSX) {
			UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
			if (uiFunctions == null)
				throw new IllegalStateException("Main window is not initialized yet");

			new MainMenu(toRegister);
		}

		ShellManager.sharedManager().addWindow(toRegister);

		return toRegister;