TwoInputDialog.java
Go to the documentation of this file.
00001 package com.generalrobotix.ui.util;
00002 
00003 import org.eclipse.jface.dialogs.IInputValidator;
00004 import org.eclipse.jface.dialogs.InputDialog;
00005 import org.eclipse.swt.SWT;
00006 import org.eclipse.swt.layout.GridData;
00007 import org.eclipse.swt.widgets.Composite;
00008 import org.eclipse.swt.widgets.Control;
00009 import org.eclipse.swt.widgets.Label;
00010 import org.eclipse.swt.widgets.Shell;
00011 import org.eclipse.swt.widgets.Text;
00012 
00013 public class TwoInputDialog extends InputDialog {
00014         private String dialogMessage1_=null;
00015         private String initialValue1_=null;
00016         private String value1_=null;
00017         private Text text1_=null;
00018         
00019         public TwoInputDialog(Shell parentShell, String dialogTitle,
00020                         String dialogMessage0, String initialValue0, IInputValidator validator, String dialogMessage1, String initialValue1) {
00021                 super(parentShell, dialogTitle, dialogMessage0, initialValue0, validator);
00022                 dialogMessage1_=dialogMessage1;
00023                 initialValue1_=initialValue1;
00024         }
00025 
00026         protected Control createDialogArea(Composite parent) {
00027             Composite composite = (Composite)super.createDialogArea(parent);
00028             Label label1 = new Label(composite, SWT.NONE);
00029             label1.setText(dialogMessage1_);
00030             text1_ = new Text(composite, SWT.BORDER);
00031             text1_.setText(initialValue1_);
00032             GridData gridData = new GridData();
00033             gridData.horizontalAlignment=GridData.FILL;
00034             text1_.setLayoutData(gridData);
00035             return composite;
00036         }
00037         
00038          protected void buttonPressed(int buttonId) {
00039                 value1_=text1_.getText();
00040                  super.buttonPressed(buttonId);
00041          }
00042          
00043         public String[] getValues(){
00044                 String[] values = new String[2];
00045                 values[0]=super.getValue();
00046                 values[1]=value1_;
00047                 return values;
00048         }
00049         
00050 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:19