catch up with branch daily

Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/presentation/widgets/TrimmedWindowContent.java b/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/presentation/widgets/TrimmedWindowContent.java
index 1ce352d..30db615 100644
--- a/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/presentation/widgets/TrimmedWindowContent.java
+++ b/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/presentation/widgets/TrimmedWindowContent.java
@@ -15,9 +15,9 @@
 
 import com.vaadin.ui.Alignment;
 import com.vaadin.ui.Component;
-import com.vaadin.ui.GridLayout;
 import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Panel;
 import com.vaadin.ui.VerticalLayout;
 
 /**
@@ -28,7 +28,11 @@
 	private VerticalLayout windowBody;
 	private VerticalLayout windowCenterArea;
 	private HorizontalLayout helperLayout;
-	private GridLayout topContainerPanel;
+
+	private HorizontalLayout topContainerLayout = new HorizontalLayout();
+	private HorizontalLayout leftContainerChild = new HorizontalLayout();
+	private Panel middleContainerChild = new Panel();
+	private HorizontalLayout rightContainerChild = new HorizontalLayout();
 
 	private VerticalLayout leftBarContainer = new VerticalLayout();
 	private VerticalLayout rightBarContainer = new VerticalLayout();
@@ -36,8 +40,10 @@
 	private HorizontalLayout bottomBarContainer = new HorizontalLayout();
 
 	private boolean boundsValide = false;
-	
-	public enum TopBarPosition {TOPBAR_LEFT, TOPBAR_RIGHT};
+
+	public enum TopBarPosition {
+		TOPBAR_LEFT, TOPBAR_RIGHT
+	};
 
 	public TrimmedWindowContent() {
 		leftBarContainer.setWidth(-1, Unit.PIXELS);
@@ -68,16 +74,20 @@
 		helperLayout = new HorizontalLayout();
 		helperLayout.setSizeFull();
 
-		// Top panel - it contains the top trimbar and the perspective stack
-		// panel
-		topContainerPanel = new GridLayout(3, 1);
-		topContainerPanel.setColumnExpandRatio(0, 15);
-		topContainerPanel.setColumnExpandRatio(1, 0);
-		topContainerPanel.setColumnExpandRatio(2, 85);
-		topContainerPanel.setSizeUndefined();
-		topContainerPanel.setWidth("100%");
+		topContainerLayout.setWidth("100%");
+		windowBody.addComponent(topContainerLayout);
+		
+		topContainerLayout.addComponents(leftContainerChild, middleContainerChild, rightContainerChild);
+		
+		leftContainerChild.setWidth("250px");
+		topContainerLayout.setComponentAlignment(leftContainerChild, Alignment.TOP_LEFT);
+		
+		middleContainerChild.setSizeFull();
+		middleContainerChild.addStyleName("os-perspective-stack-slot");
+		topContainerLayout.setExpandRatio(middleContainerChild, 1.0f);
+		
+		topContainerLayout.setComponentAlignment(rightContainerChild, Alignment.TOP_RIGHT);
 
-		windowBody.addComponent(topContainerPanel);
 		// ------------------------
 		helperLayout.addComponent(leftBarContainer);
 		helperLayout.addComponent(windowCenterArea);
@@ -107,15 +117,15 @@
 	}
 
 	public HorizontalLayout getPerspectiveStackPanel() {
-		return (HorizontalLayout) topContainerPanel.getComponent(1, 0);
+		return leftContainerChild;
 	}
 
 	public void setPerspectiveStackPanel(HorizontalLayout perspectiveStackPanel) {
 		if (perspectiveStackPanel == null) {
-			this.topContainerPanel.removeComponent(1, 0);
+			middleContainerChild.setContent(null);
 		} else {
 			perspectiveStackPanel.setSizeUndefined();
-			this.topContainerPanel.addComponent(perspectiveStackPanel, 1, 0);
+			middleContainerChild.setContent(perspectiveStackPanel);
 		}
 	}
 
@@ -150,36 +160,29 @@
 	}
 
 	public void setTopBar(Component bar, TopBarPosition pos) {
-		int col = 0;
-		Alignment align = Alignment.MIDDLE_LEFT; 
-		if(pos == TopBarPosition.TOPBAR_RIGHT) {
-			col = 2;
-			align = Alignment.MIDDLE_RIGHT;			
+		Alignment align = Alignment.MIDDLE_LEFT;
+		if (pos == TopBarPosition.TOPBAR_RIGHT) {
+			align = Alignment.MIDDLE_RIGHT;
+			if (bar == null) {
+				rightContainerChild.removeAllComponents();
+			}else {
+				rightContainerChild.addComponent(bar);
+			}
+		} else {
+			if (bar == null) {
+				leftContainerChild.removeAllComponents();
+			}else {
+				leftContainerChild.addComponent(bar);
+			}
 		}
-		if (bar == null) {
-			this.topContainerPanel.removeComponent(col, 0);
-			return;
-		}
-
-		if (this.topContainerPanel.getComponent(col, 0) != null) {
-			this.topContainerPanel.removeComponent(col, 0);
-		}
-
-		HorizontalLayout topBarWrapper = new HorizontalLayout();
-		topBarWrapper.setWidth("100%");
-		topBarWrapper.addComponent(bar);
-		topBarWrapper.setComponentAlignment(bar, align);
-		bar.setSizeUndefined();
-		
-		this.topContainerPanel.addComponent(topBarWrapper, col, 0);
 	}
 
 	public Component getTopbar(TopBarPosition pos) {
-		int col = 0;
-		if(pos == TopBarPosition.TOPBAR_RIGHT) {
-			col = 2;
+		if (pos == TopBarPosition.TOPBAR_RIGHT) {
+			return rightContainerChild;
+		} else {
+			return leftContainerChild;
 		}
-		return this.topContainerPanel.getComponent(col, 0);
 	}
 
 	// -----------------------------------
diff --git a/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/widgets/ToolbarButtonBase.java b/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/widgets/ToolbarButtonBase.java
index 0cda9e6..6094171 100644
--- a/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/widgets/ToolbarButtonBase.java
+++ b/org.eclipse.osbp.vaaclipse.presentation/src/org/eclipse/osbp/vaaclipse/widgets/ToolbarButtonBase.java
@@ -32,7 +32,8 @@
 		this.setSizeUndefined();
 
 		setLabelAndIcon(label, iconURI);
-
+		addStyleName("os-toolbar-button");
+		
 		// hack
 		super.addClickListener(new ClickListener() {