@@ -0,0 +1,1499 @@
+package org.csstudio.opibuilder.widgets.figures;%0A%0Aimport org.eclipse.draw2d.Figure;%0Aimport org.eclipse.draw2d.Label;%0Aimport org.eclipse.draw2d.PositionConstants;%0Aimport org.eclipse.draw2d.RectangleFigure;%0Aimport org.eclipse.draw2d.Triangle;%0Aimport org.eclipse.draw2d.geometry.Rectangle;%0Aimport org.eclipse.swt.graphics.Color;%0A%0A/**Figure for a Combo.%0A * @author Xihui Chen%0A *%0A */%0Apublic class ComboFigure extends RectangleFigure %7B%0A%0A%09private Label label;%0A%09%0A%09private Triangle selector;%0A%09%0A%09private static final int SELECTOR_WIDTH = 20;%0A%09private static final int MARGIN = 3;%0A%09public ComboFigure() %7B%0A%09%09label = new Label();%0A%09%09selector = new Triangle();%09%0A%09%09selector.setDirection(PositionConstants.SOUTH);%0A%09%09selector.setFill(true);%0A%09%09add(label);%0A%09%09add(selector);%0A%09%09setOutline(false);%0A%09%7D%0A%09%0A%09%0A%09public void setText(String text)%7B%0A%09%09label.setText(text);%0A%09%7D%0A%09%0A%09@Override%0A%09public void setForegroundColor(Color fg) %7B%0A%09%09super.setForegroundColor(fg);%0A%09%09selector.setBackgroundColor(fg);%0A%09%7D%0A%09%0A%09@Override%0A%09public void setBackgroundColor(Color bg) %7B%0A%09%09super.setBackgroundColor(bg);%0A%09%09selector.setBackgroundColor(getForegroundColor());%0A%09%7D%0A%09%0A%09@Override%0A%09protected void layout() %7B%0A%09%09super.layout();%0A%09%09Rectangle clientArea = getClientArea();%0A%09%09selector.setBounds(new Rectangle(clientArea.x + clientArea.width - SELECTOR_WIDTH,%0A%09%09%09%09clientArea.y, SELECTOR_WIDTH, clientArea.height));%0A%09%09label.setBounds(new Rectangle(clientArea.x + MARGIN, clientArea.y,%0A%09%09%09%09clientArea.width - SELECTOR_WIDTH, clientArea.height));%0A%09%7D%0A%09%0A%09%0A%09%0A%09%0A%09%0A%7D%0A

create combo