KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > stringsubstitution > StringPrompt


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 Matt Conway and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Matt Conway - initial implementation
10  * IBM Corporation - integration and code cleanup
11  *******************************************************************************/

12 package org.eclipse.debug.internal.ui.stringsubstitution;
13
14 import org.eclipse.jface.dialogs.InputDialog;
15 import org.eclipse.jface.window.Window;
16
17 /**
18  * Prompts the user to input a string and expands to the value entered
19  */

20 public class StringPrompt extends PromptingResolver {
21     
22     /**
23      * Prompts the user to input a string.
24      * @see PromptExpanderBase#prompt()
25      */

26     public void prompt() {
27         InputDialog dialog = new InputDialog(null, StringSubstitutionMessages.StringPromptExpander_0, dialogMessage, defaultValue == null ? lastValue : defaultValue, null);
28         int dialogResult = dialog.open();
29         if (dialogResult == Window.OK) {
30             dialogResultString = dialog.getValue();
31         }
32     }
33
34 }
35
Popular Tags