01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package org.pentaho.designstudio.controls;
14:
15: import org.eclipse.swt.SWT;
16: import org.eclipse.swt.widgets.Button;
17: import org.eclipse.swt.widgets.Composite;
18: import org.eclipse.swt.widgets.Control;
19: import org.eclipse.swt.widgets.Display;
20: import org.eclipse.swt.widgets.Label;
21: import org.eclipse.ui.forms.FormColors;
22: import org.eclipse.ui.forms.widgets.FormToolkit;
23:
24: public class ActionSequenceFormToolkit extends FormToolkit {
25:
26: public static final boolean isMacOS = System
27: .getProperty("os.name").startsWith("Mac"); //$NON-NLS-1$ //$NON-NLS-2$
28:
29: public ActionSequenceFormToolkit(Display display) {
30: super (display);
31: }
32:
33: public Label createLabel(Composite parent, String text, int style) {
34: Label label = super .createLabel(parent, text, style);
35: label.setForeground(getColors().getColor(FormColors.TITLE));
36: return label;
37: }
38:
39: public Button createButton(Composite parent, String text, int style) {
40: Button button = super .createButton(parent, text, style);
41: button.setForeground(getColors().getColor(FormColors.TITLE));
42: return button;
43: }
44:
45: public Composite createComposite(Composite parent, int style) {
46: Composite composite;
47: if (isMacOS) {
48: composite = new Composite(parent, style);
49: } else {
50: composite = new Composite(parent, style & ~SWT.BORDER);
51: if ((style & SWT.BORDER) != 0) {
52: composite.setData(FormToolkit.KEY_DRAW_BORDER,
53: FormToolkit.TEXT_BORDER);
54: }
55: paintBordersFor(composite);
56: }
57: adapt(composite);
58: return composite;
59: }
60:
61: public void adapt(Composite composite) {
62: }
63:
64: public void adapt(Control control, boolean trackFocus,
65: boolean trackKeyboard) {
66: }
67:
68: }
|