FileDocCategorySizeDatePackage
SWTSkinObjectContainer.javaAPI DocAzureus 3.0.3.44924Mon Jun 25 23:30:30 BST 2007com.aelitis.azureus.ui.swt.skin

SWTSkinObjectContainer

public class SWTSkinObjectContainer extends SWTSkinObjectBasic
A SWTSkinObject that contains other SWTSkinObjects
author
TuxPaper
created
Jun 26, 2006

Fields Summary
boolean
bPropogate
Constructors Summary
public SWTSkinObjectContainer(SWTSkin skin, SWTSkinProperties properties, String sID, String sConfigID, SWTSkinObject parent)


	    
			      
		super(skin, properties, sID, sConfigID, "container", parent);
		createComposite();
	
public SWTSkinObjectContainer(SWTSkin skin, SWTSkinProperties properties, org.eclipse.swt.widgets.Control control, String sID, String sConfigID, String type, SWTSkinObject parent)

		super(skin, properties, sID, sConfigID, type, parent);

		if (control != null) {
			setControl(control);
		}
	
Methods Summary
private voidcreateComposite()

		int style = SWT.NONE;
		if (properties.getIntValue(sConfigID + ".border", 0) == 1) {
			style = SWT.BORDER;
		}

		Composite createOn;
		if (parent == null) {
			createOn = skin.getShell();
		} else {
			createOn = (Composite) parent.getControl();
		}

		Composite parentComposite;
		if (SWTSkin.DEBUGLAYOUT) {
			System.out.println("linkIDtoParent: Create Composite " + sID + " on "
					+ createOn);
			parentComposite = new Group(createOn, style);
			((Group) parentComposite).setText(sConfigID);
			parentComposite.setData("DEBUG", "1");
		} else {
			parentComposite = new Composite(createOn, style);
		}

		parentComposite.setLayout(new FormLayout());
		control = parentComposite;

		setControl(control);
	
public SWTSkinObject[]getChildren()

		String[] widgets = properties.getStringArray(sConfigID + ".widgets");
		if (widgets == null) {
			return new SWTSkinObject[0];
		}

		ArrayList list = new ArrayList();
		for (int i = 0; i < widgets.length; i++) {
			String id = widgets[i];
			SWTSkinObject skinObject = skin.getSkinObjectByID(id, this);
			if (skinObject != null) {
				list.add(skinObject);
			}
		}

		SWTSkinObject[] objects = new SWTSkinObject[list.size()];
		objects = (SWTSkinObject[]) list.toArray(objects);

		return objects;
	
public org.eclipse.swt.widgets.CompositegetComposite()

		return (Composite) control;
	
public booleangetPropogation()

		return bPropogate;
	
public voidsetPropogation(boolean propogate)

		bPropogate = propogate;
		if (SWTSkin.DEBUGLAYOUT) {
			((Group) control).setText(((Group) control).getText()
					+ (bPropogate ? ";P" : ""));
		}
	
protected voidsetViewID(java.lang.String viewID)

		super.setViewID(viewID);
		if (SWTSkin.DEBUGLAYOUT && control != null) {
			((Group) control).setText("[" + viewID + "]");
		}
	
public java.lang.StringswitchSuffix(java.lang.String suffix, int level, boolean walkUp)

		String sFullsuffix = super.switchSuffix(suffix, level, walkUp);

		if (bPropogate && suffix != null && control != null
				&& !control.isDisposed()) {
			SWTSkinObject[] children = getChildren();
			for (int i = 0; i < children.length; i++) {
				children[i].switchSuffix(suffix, level, false);
			}
		}
		return sFullsuffix;
	
public voidtriggerListeners(int eventType, java.lang.Object params)
Trigger the children listeners too!

		try {
			super.triggerListeners(eventType, params);
		} catch (Exception e) {
			Debug.out("Trigger of Skin Event "
					+ SWTSkinObjectListener.NAMES[eventType] + " caused an error", e);
		}

		SWTSkinObject[] children = getChildren();
		for (int i = 0; i < children.length; i++) {
			try {
				children[i].triggerListeners(eventType, params);
			} catch (Exception e) {
				Debug.out("Trigger of Skin Event "
						+ SWTSkinObjectListener.NAMES[eventType]
						+ " for Container child has caused an error", e);
			}
		}