org.eclipse.swt.custom.ControlEditor

Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Contributors: IBM Corporation - initial API and implementation Port to the D programming language: Frank Benoit <benoit@tionex.de>

Members

Classes

ControlEditor
class ControlEditor

* A ControlEditor is a manager for a Control that appears above a composite and tracks with the moving and resizing of that composite. It can be used to display one control above another control. This could be used when editing a control that does not have editing capabilities by using a text editor or for launching a dialog by placing a button above a control. * <p> Here is an example of using a ControlEditor: * <code><pre> Canvas canvas = new Canvas(shell, SWT.BORDER); canvas.setBounds(10, 10, 300, 300); Color color = new Color(null, 255, 0, 0); canvas.setBackground(color); ControlEditor editor = new ControlEditor (canvas); // The editor will be a button in the bottom right corner of the canvas. // When selected, it will launch a Color dialog that will change the background // of the canvas. Button button = new Button(canvas, SWT.PUSH); button.setText("Select Color..."); button.addSelectionListener (new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ColorDialog dialog = new ColorDialog(shell); dialog.open(); RGB rgb = dialog.getRGB(); if (rgb !is null) { if (color !is null) color.dispose(); color = new Color(null, rgb); canvas.setBackground(color); } * } }); * editor.horizontalAlignment = SWT.RIGHT; editor.verticalAlignment = SWT.BOTTOM; editor.grabHorizontal = false; editor.grabVertical = false; Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT); editor.minimumWidth = size.x; editor.minimumHeight = size.y; editor.setEditor (button); </pre></code> * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Meta