Back to index

wims  3.65+svn20090927
RenameMacroDialog.java
Go to the documentation of this file.
00001 /*
00002  * Created on 22.10.2005
00003  *
00004  */
00005 package rene.zirkel.dialogs;
00006 
00007 import java.awt.*;
00008 
00009 import rene.gui.*;
00010 import rene.zirkel.*;
00011 import rene.zirkel.macro.*;
00012 
00013 public class RenameMacroDialog extends CloseDialog
00014 {      boolean Aborted=true; 
00015        TextField Name; 
00016        TextArea Comment;
00017        
00018        public RenameMacroDialog (Frame frame, Macro m)
00019        {      super(frame,Zirkel.name("renamemacro.title","Rename Macro"),true); 
00020               setLayout(new BorderLayout()); 
00021               
00022               Panel north=new MyPanel(); 
00023               north.setLayout(new GridLayout(0,1)); 
00024               north.add(new MyLabel(Zirkel.name("renamemacro.name"))); 
00025               north.add(Name=new TextFieldAction(this,"OK",m.getName(),64)); 
00026               add("North",new Panel3D(north)); 
00027               
00028               add("Center",new Panel3D(Comment=new TextArea("",5,40,TextArea.SCROLLBARS_VERTICAL_ONLY)));
00029               Comment.setText(m.getComment());
00030               
00031               Panel south=new MyPanel(); 
00032               south.add(new ButtonAction(this,Zirkel.name("ok"),"OK")); 
00033               south.add(new ButtonAction(this,Zirkel.name("cancel"),"Close")); 
00034               add("South",new Panel3D(south)); 
00035               
00036               pack(); 
00037        }
00038        
00039        public void doAction (String o)
00040        {      Aborted=true; 
00041               if (o.equals("OK"))
00042               {      Aborted=false; 
00043                      doclose(); 
00044               }
00045               else super.doAction(o); 
00046        }
00047        
00048        public String getName ()
00049        {      return Name.getText(); 
00050        }
00051        
00052        public String getComment ()
00053        {      return Comment.getText();
00054        }
00055        
00056        public boolean isAborted ()
00057        {      return Aborted; 
00058        }
00059 }
00060