Package

Source Code of Input

// Vips - Visual Programming with Structograms
// Copyright (C) 2005 Michael Partheil, michael.partheil@gmx.de
// All rights reserved.

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

import vips.gui.InputDlg;
import vips.model.*;
import vips.model.wert.*;

import java.util.*;

public class Input extends AbstractOperation
{
  private Display display;
  private Shell parentShell;

  public Input(Display display, Shell shell)
  {
    this.display = display;
    parentShell = shell;
    params.put("MSG", new ParamInfo("msg", String.class));
    params.put("INITTEXT", new ParamInfo("initText", String.class));
  }

  private String ergebnis=null;

  public Wert aufrufen(Map argumente, Object einzelschrittLock) throws LaufzeitException
  {
    Wert argMsg = (Wert)argumente.get("MSG");
    final String msg = (String)argMsg.getWert();
    Wert argInit = (Wert)argumente.get("INITTEXT");
    final String initText = (String)argInit.getWert();
             
    display.syncExec(new Runnable()
      {
        public void run()
        {
          InputDlg dlg = new InputDlg(parentShell);
          dlg.setText("Vips");
          ergebnis = dlg.open(msg, initText, InputDlg.STANDARD_VERIFIZIERER, true);
        }
      } )
     
    if (ergebnis == null)
      ergebnis = "";
    return new Wert(ergebnis);
  }

  public String getName()
  {
    return "Input";
  }

  public Class getRueckgabeTyp()
  {
    return String.class;
  }
}
TOP

Related Classes of Input

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.