comparison dwtx/jface/dialogs/InputDialog.d @ 70:46a6e0e6ccd4

Merge with d-fied sources of 3.4M7
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 01:36:46 +0200
parents ea8ff534f622
children
comparison
equal deleted inserted replaced
69:07b9d96fd764 70:46a6e0e6ccd4
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
170 | GridData.VERTICAL_ALIGN_CENTER); 170 | GridData.VERTICAL_ALIGN_CENTER);
171 data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); 171 data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
172 label.setLayoutData(data); 172 label.setLayoutData(data);
173 label.setFont(parent.getFont()); 173 label.setFont(parent.getFont());
174 } 174 }
175 text = new Text(composite, DWT.SINGLE | DWT.BORDER); 175 text = new Text(composite, getInputTextStyle());
176 text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL 176 text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
177 | GridData.HORIZONTAL_ALIGN_FILL)); 177 | GridData.HORIZONTAL_ALIGN_FILL));
178 text.addModifyListener(new class ModifyListener { 178 text.addModifyListener(new class ModifyListener {
179 public void modifyText(ModifyEvent e) { 179 public void modifyText(ModifyEvent e) {
180 validateInput(); 180 validateInput();
284 if (button !is null) { 284 if (button !is null) {
285 button.setEnabled(errorMessage is null); 285 button.setEnabled(errorMessage is null);
286 } 286 }
287 } 287 }
288 } 288 }
289
290 /**
291 * Returns the style bits that should be used for the input text field.
292 * Defaults to a single line entry. Subclasses may override.
293 *
294 * @return the integer style bits that should be used when creating the
295 * input text
296 *
297 * @since 3.4
298 */
299 protected int getInputTextStyle() {
300 return DWT.SINGLE | DWT.BORDER;
301 }
289 } 302 }