[Btrwiz-commits] CVS: btrwiz/src BtrWiz.java,1.7,1.8 ExcludeFilters.java,1.3,1.4 FindReplace.java,1.
Brought to you by:
howama
|
From: Mark H. <ho...@us...> - 2002-09-03 07:41:58
|
Update of /cvsroot/btrwiz/btrwiz/src
In directory usw-pr-cvs1:/tmp/cvs-serv31375/btrwiz/src
Modified Files:
BtrWiz.java ExcludeFilters.java FindReplace.java
FolderSelect.java IncludeFilters.java InterfaceStr.properties
ProgressPage.java Replacer.java SummaryPage.java
WelcomePage.java
Log Message:
updates for new jgwizard
Index: BtrWiz.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/BtrWiz.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** BtrWiz.java 6 Aug 2002 15:20:31 -0000 1.7
--- BtrWiz.java 3 Sep 2002 07:41:53 -0000 1.8
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
import java.util.Locale;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
import java.util.Locale;
***************
*** 34,38 ****
messages = ResourceBundle.getBundle("InterfaceStr", Locale.getDefault() );
! Gtk.init(args.length, args);
BtrWiz app = new BtrWiz();
Gtk.main();
--- 34,38 ----
messages = ResourceBundle.getBundle("InterfaceStr", Locale.getDefault() );
! Gtk.init(args);
BtrWiz app = new BtrWiz();
Gtk.main();
***************
*** 50,55 ****
*/
public void customise(){
! GtkImage topLeft = new GtkImage("topleft.png");
! getTopLeft().add(topLeft);
Replacer btr = new Replacer();
--- 50,55 ----
*/
public void customise(){
! org.gnu.gtk.Image topLeft = new org.gnu.gtk.Image("topleft.png");
! setTopLeft(topLeft);
Replacer btr = new Replacer();
Index: ExcludeFilters.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/ExcludeFilters.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ExcludeFilters.java 18 Jul 2002 17:01:45 -0000 1.3
--- ExcludeFilters.java 3 Sep 2002 07:41:53 -0000 1.4
***************
*** 1,7 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
! import gnu.glib.*;
import java.util.ResourceBundle;
--- 1,7 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
! import org.gnu.glib.*;
import java.util.ResourceBundle;
***************
*** 14,20 ****
private Replacer btr;
! private GtkVBox content;
! private GtkEntry addTxt;
! private GtkListStore filtList;
/**
--- 14,20 ----
private Replacer btr;
! private VBox content;
! private Entry addTxt;
! private ListStore filtList;
/**
***************
*** 26,53 ****
btr = rep;
! content = new GtkVBox(false, 0);
! GtkLabel headLbl = new GtkLabel(messages.getString("ExcFilters") );
headLbl.setLineWrap(true);
! headLbl.setJustify(GtkJustification.FILL);
content.add(headLbl);
! GtkLabel curFiltLbl = new GtkLabel( messages.getString("CurExcFilters") );
content.add(curFiltLbl);
! GtkHBox addSpace = new GtkHBox(false, 2);
! addTxt = new GtkEntry();
addSpace.add(addTxt);
! GtkButton addBtn = new GtkButton( messages.getString("AddExcFilt") );
! addBtn.signalConnect("clicked", "addFilter", this);
addSpace.add(addBtn);
content.add(addSpace);
! GtkButton rmBtn = new GtkButton( messages.getString("RmExcFilt") );
! rmBtn.signalConnect("clicked", "rmSelected", this);
content.add(rmBtn);
-
- setButtons(true, messages.getString("Prev"), true, messages.getString("Next") );
setContent(content);
}
--- 26,51 ----
btr = rep;
! content = new VBox(false, 0);
! Label headLbl = new Label(messages.getString("ExcFilters") );
headLbl.setLineWrap(true);
! headLbl.setJustification(Justification.FILL);
content.add(headLbl);
! Label curFiltLbl = new Label( messages.getString("CurExcFilters") );
content.add(curFiltLbl);
! HBox addSpace = new HBox(false, 2);
! addTxt = new Entry();
addSpace.add(addTxt);
! Button addBtn = new Button( messages.getString("AddExcFilt") );
! // addBtn.signalConnect("clicked", "addFilter", this);
addSpace.add(addBtn);
content.add(addSpace);
! Button rmBtn = new Button( messages.getString("RmExcFilt") );
! // rmBtn.signalConnect("clicked", "rmSelected", this);
content.add(rmBtn);
setContent(content);
}
Index: FindReplace.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/FindReplace.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FindReplace.java 18 Jul 2002 17:01:45 -0000 1.2
--- FindReplace.java 3 Sep 2002 07:41:53 -0000 1.3
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
***************
*** 10,18 ****
class FindReplace extends WizardPage{
private Replacer btr;
! private GtkVBox content;
private ResourceBundle messages;
! private GtkTextBuffer findBuffer;
! private GtkTextBuffer replaceBuffer;
! private GtkCheckButton usingRegExp;
/*
* Creates the screen
--- 10,18 ----
class FindReplace extends WizardPage{
private Replacer btr;
! private VBox content;
private ResourceBundle messages;
! private TextBuffer findBuffer;
! private TextBuffer replaceBuffer;
! private CheckButton usingRegExp;
/*
* Creates the screen
***************
*** 23,83 ****
btr = rep;
! content = new GtkVBox(false, 0);
! GtkLabel msgLbl = new GtkLabel( messages.getString("FindReplaceHead") );
msgLbl.setLineWrap(true);
! msgLbl.setJustify(GtkJustification.FILL);
content.add(msgLbl);
! GtkScrolledWindow findScroll = new GtkScrolledWindow();
! findScroll.setPolicy(GtkPolicyType.AUTOMATIC, GtkPolicyType.AUTOMATIC);
! findScroll.setShadowType(GtkShadowType.IN);
! GtkLabel findLbl = new GtkLabel( messages.getString("FindTxt") );
! findLbl.setJustify(GtkJustification.LEFT);
content.add(findLbl);
! findBuffer = new GtkTextBuffer( new GtkTextTagTable() );
! GtkTextView findTxtView = new GtkTextView( findBuffer );
! findTxtView.setWrapMode(GtkWrapMode.WORD);
! findScroll.add(findTxtView);
! content.add(findScroll);
! GtkScrolledWindow replaceScroll = new GtkScrolledWindow();
! replaceScroll.setPolicy(GtkPolicyType.AUTOMATIC, GtkPolicyType.AUTOMATIC);
! replaceScroll.setShadowType(GtkShadowType.IN);
! GtkLabel replaceLbl = new GtkLabel( messages.getString("ReplaceTxt") );
! replaceLbl.setJustify(GtkJustification.RIGHT);
content.add(replaceLbl);
! replaceBuffer = new GtkTextBuffer( new GtkTextTagTable() );
! GtkTextView replaceTxtView = new GtkTextView( replaceBuffer );
! replaceTxtView.setWrapMode(GtkWrapMode.WORD);
! replaceScroll.add(replaceTxtView);
! content.add(replaceScroll);
! usingRegExp = new GtkCheckButton( messages.getString("UsingRegExp") );
! content.add(usingRegExp);
! GtkLabel warnLbl = new GtkLabel( messages.getString("FindReplaceWarning") );
warnLbl.setLineWrap(true);
! warnLbl.setJustify(GtkJustification.FILL);
content.add(warnLbl);
! setButtons(true, messages.getString("Prev"), true, messages.getString("StartReplacing") );
setContent(content);
}
public void postShow(){
! GtkTextIter start = null;
! GtkTextIter end = null;
! findBuffer.getStartIter(start);
! findBuffer.getEndIter(end);
! btr.setFindTxt( findBuffer.getText(start, end, true) ) ;
! System.out.println(start+" "+end+"Storing find text: " + findBuffer.getText(start, end, true) );
! replaceBuffer.getBounds(start, end);
! btr.setReplaceTxt( replaceBuffer.getText( start, end, false ) );
! btr.setUseRegExp( usingRegExp.getActive() );
}
}
--- 23,83 ----
btr = rep;
! content = new VBox(false, 0);
! Label msgLbl = new Label( messages.getString("FindReplaceHead") );
msgLbl.setLineWrap(true);
! msgLbl.setJustification(Justification.FILL);
content.add(msgLbl);
! // ScrolledWindow findScroll = new ScrolledWindow();
! // findScroll.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
! // findScroll.setShadowType(ShadowType.IN);
! Label findLbl = new Label( messages.getString("FindTxt") );
! findLbl.setJustification(Justification.LEFT);
content.add(findLbl);
! // findBuffer = new TextBuffer( new TextTagTable() );
! // TextView findTxtView = new TextView( findBuffer );
! // findTxtView.setWrapMode(WrapMode.WORD);
! // findScroll.add(findTxtView);
! // content.add(findScroll);
! // ScrolledWindow replaceScroll = new ScrolledWindow();
! // replaceScroll.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
! // replaceScroll.setShadowType(ShadowType.IN);
! Label replaceLbl = new Label( messages.getString("ReplaceTxt") );
! replaceLbl.setJustification(Justification.RIGHT);
content.add(replaceLbl);
! // replaceBuffer = new TextBuffer( new TextTagTable() );
! // TextView replaceTxtView = new TextView( replaceBuffer );
! // replaceTxtView.setWrapMode(WrapMode.WORD);
! // replaceScroll.add(replaceTxtView);
! // content.add(replaceScroll);
! // usingRegExp = new CheckButton( messages.getString("UsingRegExp") );
! // content.add(usingRegExp);
! Label warnLbl = new Label( messages.getString("FindReplaceWarning") );
warnLbl.setLineWrap(true);
! warnLbl.setJustification(Justification.FILL);
content.add(warnLbl);
! // setButtons(true, messages.getString("Prev"), true, messages.getString("StartReplacing") );
setContent(content);
}
public void postShow(){
! TextIter start = null;
! TextIter end = null;
! // findBuffer.getStartIter(start);
! // findBuffer.getEndIter(end);
! //// btr.setFindTxt( findBuffer.getText(start, end, true) ) ;
! // System.out.println(start+" "+end+"Storing find text: " + findBuffer.getText(start, end, true) );
! // replaceBuffer.getBounds(start, end);
! // btr.setReplaceTxt( replaceBuffer.getText( start, end, false ) );
! // btr.setUseRegExp( usingRegExp.getActive() );
}
}
Index: FolderSelect.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/FolderSelect.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FolderSelect.java 18 Jul 2002 17:01:45 -0000 1.5
--- FolderSelect.java 3 Sep 2002 07:41:53 -0000 1.6
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
***************
*** 15,20 ****
/** The content container to be shown on the screen */
! private GtkVBox content;
! GtkEntry dirEntry;
/**
--- 15,20 ----
/** The content container to be shown on the screen */
! private VBox content;
! Entry dirEntry;
/**
***************
*** 26,46 ****
btr = rep;
! content = new GtkVBox(false, 0);
! GtkLabel headLbl = new GtkLabel(messages.getString("Head") );
headLbl.setLineWrap(true);
! headLbl.setJustify(GtkJustification.FILL);
content.add(headLbl);
! dirEntry = new GtkEntry();
dirEntry.setText( System.getProperty("user.dir") + System.getProperty("file.separator") );
content.add(dirEntry);
! GtkButton selDir = new GtkButton( messages.getString("SelDir") );
! selDir.signalConnect("clicked", "showSelectBox", this);
content.add(selDir);
! setButtons(true, messages.getString("Prev"), true, messages.getString("Next") );
setContent(content);
--- 26,46 ----
btr = rep;
! content = new VBox(false, 0);
! Label headLbl = new Label(messages.getString("Head") );
headLbl.setLineWrap(true);
! headLbl.setJustification(Justification.FILL);
content.add(headLbl);
! dirEntry = new Entry();
dirEntry.setText( System.getProperty("user.dir") + System.getProperty("file.separator") );
content.add(dirEntry);
! Button selDir = new Button( messages.getString("SelDir") );
! // selDir.signalConnect("clicked", "showSelectBox", this);
content.add(selDir);
! // setButtons(true, messages.getString("Prev"), true, messages.getString("Next") );
setContent(content);
***************
*** 51,55 ****
}
! GtkFileSelection selector;
/**
--- 51,55 ----
}
! FileSelection selector;
/**
***************
*** 58,67 ****
*/
private void showSelectBox(){
! selector = new GtkFileSelection( messages.getString("SelDirTS") );
selector.setFilename(dirEntry.getText());
! selector.getOkButton().signalConnect("clicked", "setDir", this);
! selector.getCancelButton().signalConnect("clicked", "rmSelector", this);
! selector.getFileList().setSensitive(false);
! selector.getSelectionEntry().hide();
selector.show();
}
--- 58,67 ----
*/
private void showSelectBox(){
! selector = new FileSelection( messages.getString("SelDirTS") );
selector.setFilename(dirEntry.getText());
! // selector.getOkButton().signalConnect("clicked", "setDir", this);
! // selector.getCancelButton().signalConnect("clicked", "rmSelector", this);
! // selector.getFileList().setSensitive(false);
! // selector.getSelectionEntry().hide();
selector.show();
}
Index: IncludeFilters.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/IncludeFilters.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** IncludeFilters.java 18 Jul 2002 17:01:45 -0000 1.5
--- IncludeFilters.java 3 Sep 2002 07:41:53 -0000 1.6
***************
*** 1,7 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
! import gnu.glib.*;
import java.util.ResourceBundle;
--- 1,7 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
! import org.gnu.glib.*;
import java.util.ResourceBundle;
***************
*** 14,22 ****
private Replacer btr;
! private GtkVBox content;
! private GtkListStore filtList;
! private GtkEntry addTxt;
! private GtkCheckButton useIncFilt;
! private GtkVBox incWidgets;
/**
--- 14,22 ----
private Replacer btr;
! private VBox content;
! private ListStore filtList;
! private Entry addTxt;
! private CheckButton useIncFilt;
! private VBox incWidgets;
/**
***************
*** 28,52 ****
btr = rep;
! content = new GtkVBox(false, 0);
! GtkLabel headLbl = new GtkLabel(messages.getString("IncFilters") );
headLbl.setLineWrap(true);
! headLbl.setJustify(GtkJustification.FILL);
content.add(headLbl);
! useIncFilt = new GtkCheckButton( messages.getString("UseIncFilt"));
! useIncFilt.setActive(true);
! useIncFilt.signalConnect("toggled", "toggleView", this);
! content.add(useIncFilt);
! incWidgets = new GtkVBox(false, 0);
! GtkLabel curFiltLbl = new GtkLabel( messages.getString("CurIncFilters") );
incWidgets.add(curFiltLbl);
/*
! GtkListStore model;
! GtkTreeView view;
! GtkTreeViewColumn column;
! GtkCellRendererText cellRenderer;
GType[] types = new GType[1];
--- 28,52 ----
btr = rep;
! content = new VBox(false, 0);
! Label headLbl = new Label(messages.getString("IncFilters") );
headLbl.setLineWrap(true);
! headLbl.setJustification(Justification.FILL);
content.add(headLbl);
! // useIncFilt = new CheckButton( messages.getString("UseIncFilt"));
! // useIncFilt.setActive(true);
! // useIncFilt.signalConnect("toggled", "toggleView", this);
! // content.add(useIncFilt);
! incWidgets = new VBox(false, 0);
! Label curFiltLbl = new Label( messages.getString("CurIncFilters") );
incWidgets.add(curFiltLbl);
/*
! ListStore model;
! TreeView view;
! TreeViewColumn column;
! CellRendererText cellRenderer;
GType[] types = new GType[1];
***************
*** 54,66 ****
// types[1] = gnu.glib.GType.STRING();
! model = new GtkListStore( 1, types );
! view = new GtkTreeView(model);
! cellRenderer = new GtkCellRendererText();
! column = new GtkTreeViewColumn();
column.setTitle("title");
column.addAttribute(cellRenderer, "text", 0);
view.appendColumn(column);
! GtkTreeIter iter = null;
GValue gval = null;
model.append(iter); // This aquires the iterator
--- 54,66 ----
// types[1] = gnu.glib.GType.STRING();
! model = new ListStore( 1, types );
! view = new TreeView(model);
! cellRenderer = new CellRendererText();
! column = new TreeViewColumn();
column.setTitle("title");
column.addAttribute(cellRenderer, "text", 0);
view.appendColumn(column);
! TreeIter iter = null;
GValue gval = null;
model.append(iter); // This aquires the iterator
***************
*** 72,90 ****
content.add(view);
*/
! GtkHBox addSpace = new GtkHBox(false, 2);
! addTxt = new GtkEntry();
addSpace.add(addTxt);
! GtkButton addBtn = new GtkButton( messages.getString("AddIncFilt") );
! addBtn.signalConnect("clicked", "addFilter", this);
addSpace.add(addBtn);
incWidgets.add(addSpace);
! GtkButton rmBtn = new GtkButton( messages.getString("RmIncFilt") );
! rmBtn.signalConnect("clicked", "rmSelected", this);
incWidgets.add(rmBtn);
content.add(incWidgets);
! setButtons(true, messages.getString("Prev"), true, messages.getString("Next") );
setContent(content);
}
--- 72,90 ----
content.add(view);
*/
! HBox addSpace = new HBox(false, 2);
! addTxt = new Entry();
addSpace.add(addTxt);
! Button addBtn = new Button( messages.getString("AddIncFilt") );
! // addBtn.signalConnect("clicked", "addFilter", this);
addSpace.add(addBtn);
incWidgets.add(addSpace);
! Button rmBtn = new Button( messages.getString("RmIncFilt") );
! // rmBtn.signalConnect("clicked", "rmSelected", this);
incWidgets.add(rmBtn);
content.add(incWidgets);
! // setButtons(true, messages.getString("Prev"), true, messages.getString("Next") );
setContent(content);
}
***************
*** 95,99 ****
*/
private void toggleView(){
! incWidgets.setSensitive( useIncFilt.getActive() );
}
/**
--- 95,99 ----
*/
private void toggleView(){
! // incWidgets.setSensitive( useIncFilt.getActive() );
}
/**
***************
*** 111,115 ****
}
public void postShow(){
! btr.setUseInc( useIncFilt.getActive() );
btr.setIncFilt( new String[0] );
}
--- 111,115 ----
}
public void postShow(){
! // btr.setUseInc( useIncFilt.getActive() );
btr.setIncFilt( new String[0] );
}
Index: InterfaceStr.properties
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/InterfaceStr.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** InterfaceStr.properties 17 Jul 2002 18:26:09 -0000 1.3
--- InterfaceStr.properties 3 Sep 2002 07:41:53 -0000 1.4
***************
*** 46,49 ****
--- 46,50 ----
AddIncFilt = Add
RmIncFilt = Remove Selected
+ UseIncFilt = Use Include Filters
#
***************
*** 79,82 ****
--- 80,85 ----
FilesAdded = Files found:
PlzWait = Please Wait...
+ DoneScanning = Completed.
+
StageTwoHead = Searching files...
FilesProcessed = Files Processed:
***************
*** 92,97 ****
Success = The replace operation has successfully completed.
StartAgain = Start Again
!
!
--- 95,104 ----
Success = The replace operation has successfully completed.
StartAgain = Start Again
! TimeTaken = Time Taken:
! FScanned = Files Scanned:
! RepMade = Replacements Made:
! CumFScanned = Total Files Scanned by BtrWiz:
! CumReplaced = Total Replacements made:
! Seconds = s
Index: ProgressPage.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/ProgressPage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ProgressPage.java 18 Jul 2002 17:01:45 -0000 1.3
--- ProgressPage.java 3 Sep 2002 07:41:53 -0000 1.4
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
***************
*** 8,28 ****
* Displayed while the files are being scanned and text is being replaced.
*/
! class ProgressPage extends WizardPage{
private Replacer btr;
private WizardForm wizard;
! private GtkVBox content;
private ResourceBundle messages;
! private GtkProgressBar replaceProgress;
! private GtkFrame stageOneFrame;
! private GtkLabel filesAdded;
! private GtkLabel searchingFolders;
private int fileCount = 0;
private int done = 0;
! private GtkFrame stageTwoFrame;
! private GtkLabel processed;
! private GtkLabel curFile;
/*
--- 8,28 ----
* Displayed while the files are being scanned and text is being replaced.
*/
! class ProgressPage extends WizardPage implements ReplacerProgress{
private Replacer btr;
private WizardForm wizard;
! private VBox content;
private ResourceBundle messages;
! private ProgressBar replaceProgress;
! private Frame stageOneFrame;
! private Label filesAdded;
! private Label searchingFolders;
private int fileCount = 0;
private int done = 0;
! private Frame stageTwoFrame;
! private Label processed;
! private Label curFile;
/*
***************
*** 35,48 ****
btr = rep;
! content = new GtkVBox(false, 0);
! stageOneFrame = new GtkFrame(null);
! GtkVBox stageOneBox = new GtkVBox(false, 3);
stageOneFrame.add(stageOneBox);
! GtkLabel stOneHead = new GtkLabel( messages.getString("StageOneHead") );
stageOneBox.add(stOneHead);
! filesAdded = new GtkLabel( messages.getString("FilesAdded")+"0" );
stageOneBox.add(filesAdded);
! searchingFolders = new GtkLabel( messages.getString("PlzWait") );
stageOneBox.add(searchingFolders);
content.add(stageOneFrame);
--- 35,48 ----
btr = rep;
! content = new VBox(false, 0);
! stageOneFrame = new Frame(null);
! VBox stageOneBox = new VBox(false, 3);
stageOneFrame.add(stageOneBox);
! Label stOneHead = new Label( messages.getString("StageOneHead") );
stageOneBox.add(stOneHead);
! filesAdded = new Label( messages.getString("FilesAdded")+"0" );
stageOneBox.add(filesAdded);
! searchingFolders = new Label( messages.getString("PlzWait") );
stageOneBox.add(searchingFolders);
content.add(stageOneFrame);
***************
*** 52,65 ****
* Stage Two
*/
! stageTwoFrame = new GtkFrame(null);
! GtkVBox stageTwoBox = new GtkVBox(false, 3);
! GtkLabel scanning = new GtkLabel( messages.getString("StageTwoHead") );
stageTwoBox.add(scanning);
! processed = new GtkLabel( messages.getString("FilesProcessed") + done +"/"+fileCount);
stageTwoBox.add(processed);
! curFile = new GtkLabel( messages.getString("CurFile") + messages.getString("NoCur"));
stageTwoBox.add(curFile);
! replaceProgress = new GtkProgressBar();
stageTwoBox.add(replaceProgress);
--- 52,65 ----
* Stage Two
*/
! stageTwoFrame = new Frame(null);
! VBox stageTwoBox = new VBox(false, 3);
! Label scanning = new Label( messages.getString("StageTwoHead") );
stageTwoBox.add(scanning);
! processed = new Label( messages.getString("FilesProcessed") + done +"/"+fileCount);
stageTwoBox.add(processed);
! curFile = new Label( messages.getString("CurFile") + messages.getString("NoCur"));
stageTwoBox.add(curFile);
! replaceProgress = new ProgressBar();
stageTwoBox.add(replaceProgress);
***************
*** 68,72 ****
stageTwoFrame.setSensitive(false);
! setButtons(false, null, false, null );
setContent(content);
}
--- 68,72 ----
stageTwoFrame.setSensitive(false);
! // setButtons(false, false,);
setContent(content);
}
***************
*** 75,79 ****
* Sets all values as zero
*/
! synchronized void zeroProgress(){
stageOneFrame.setSensitive(true);
stageTwoFrame.setSensitive(false);
--- 75,79 ----
* Sets all values as zero
*/
! public synchronized void zeroProgress(){
stageOneFrame.setSensitive(true);
stageTwoFrame.setSensitive(false);
***************
*** 89,93 ****
/**
*/
! synchronized void startStageTwo(){
stageOneFrame.setSensitive(false);
stageTwoFrame.setSensitive(true);
--- 89,93 ----
/**
*/
! public synchronized void startStageTwo(){
stageOneFrame.setSensitive(false);
stageTwoFrame.setSensitive(true);
***************
*** 97,101 ****
/**
*/
! synchronized void stageOneProgress(int found){
fileCount = found;
filesAdded.setLabel( messages.getString("FilesAdded")+found );
--- 97,101 ----
/**
*/
! public synchronized void stageOneProgress(int found){
fileCount = found;
filesAdded.setLabel( messages.getString("FilesAdded")+found );
***************
*** 103,107 ****
/**
*/
! synchronized void stageTwoProgress(int filesCompleted, String current){
done = filesCompleted;
processed.setLabel( messages.getString("FilesProcessed") + done +"/"+fileCount);
--- 103,107 ----
/**
*/
! public synchronized void stageTwoProgress(int filesCompleted, String current){
done = filesCompleted;
processed.setLabel( messages.getString("FilesProcessed") + done +"/"+fileCount);
***************
*** 112,124 ****
*/
public void preShow(){
! Thread btrThread = new Thread(btr);
! btrThread.start();
}
!
/**
* This is called by the replacer thread when the task has been successful.
*/
! protected void success(){
! wizard.onNext();
}
}
--- 112,136 ----
*/
public void preShow(){
! //Thread btrThread = new Thread(btr);
! //btrThread.start();
! btr.run();
}
!
/**
* This is called by the replacer thread when the task has been successful.
*/
! public synchronized void success(){
! // wizard.onNext();
! }
!
! /**
! * This is called when an error has occured in the replacer thread. It
! * displays an error message and returns to the find/replace screen.
! */
! public synchronized void failure(String msg){
! MessageDialog errDialog = new MessageDialog( wizard.getWindow(), DialogFlags.MODAL.and(DialogFlags.DESTROY_WITH_PARENT) , MessageType.ERROR, ButtonsType.CLOSE, msg);
! errDialog.run();
! errDialog.destroy();
! // wizard.onPrev();
}
}
Index: Replacer.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/Replacer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Replacer.java 18 Jul 2002 17:01:45 -0000 1.2
--- Replacer.java 3 Sep 2002 07:41:53 -0000 1.3
***************
*** 6,9 ****
--- 6,10 ----
import java.util.*;
+
/**
* Performs replace operations, sending progress reports to the progress page.
***************
*** 50,53 ****
--- 51,61 ----
started = System.currentTimeMillis();
System.out.println( messages.getString("Started") );
+
+ if (validate() != null){
+ // There were errors with the settings.
+ progress.failure( validate() );
+ return;
+ }
+
System.out.println( messages.getString("RootDir")+ rootDir);
System.out.println( "Find Txt: "+findText );
***************
*** 151,154 ****
--- 159,183 ----
}
+ /**
+ * Performs simple tests on the settings
+ * @return undef if there are no errors, else and error string.
+ */
+ public String validate(){
+ File f = new File(rootDir);
+
+ if (! f.exists()){
+ return messages.getString("RootDirNotExist")+rootDir;
+ }
+ if (useIncFilters && Array.getLength(incFilters) < 1){
+ return messages.getString("NoIncFilt");
+ }
+ if (findText == null || findText.equals("") ){
+ return messages.getString("NoFindText");
+ }
+ if (replaceText == null || replaceText.indexOf(replaceText) > -1){
+ return messages.getString("FindInReplace");
+ }
+ return null;
+ }
/**
Index: SummaryPage.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/SummaryPage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SummaryPage.java 18 Jul 2002 17:01:45 -0000 1.2
--- SummaryPage.java 3 Sep 2002 07:41:53 -0000 1.3
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
***************
*** 10,22 ****
class SummaryPage extends WizardPage{
private Replacer btr;
! private GtkVBox content;
private ResourceBundle messages;
! private GtkProgressBar replaceProgress ;
! private GtkLabel timeTaken;
! private GtkLabel fScanned;
! private GtkLabel replacements;
! private GtkLabel cumScanned;
! private GtkLabel cumReplaced;
/*
* Creates the screen
--- 10,22 ----
class SummaryPage extends WizardPage{
private Replacer btr;
! private VBox content;
private ResourceBundle messages;
! private ProgressBar replaceProgress ;
! private Label timeTaken;
! private Label fScanned;
! private Label replacements;
! private Label cumScanned;
! private Label cumReplaced;
/*
* Creates the screen
***************
*** 27,49 ****
messages = rb;
! content = new GtkVBox(false, 0);
! GtkLabel headLbl = new GtkLabel( messages.getString("Success") );
content.add(headLbl);
! timeTaken = new GtkLabel( messages.getString("TimeTaken")+ "Unknown");
! fScanned = new GtkLabel(messages.getString("FScanned")+ "0");
! replacements = new GtkLabel( messages.getString("RepMade")+0);
content.add(timeTaken);
content.add(fScanned);
content.add(replacements);
! // cumScanned = new GtkLabel( messages.getString("CumFScanned") + 0);
! // cumReplaced = new GtkLabel( messages.getString("CumReplaced")+0);
// content.add(cumScanned);
// content.add(cumReplaced);
! setButtons(false, null, true, messages.getString("StartAgain") );
setContent(content);
}
--- 27,49 ----
messages = rb;
! content = new VBox(false, 0);
! Label headLbl = new Label( messages.getString("Success") );
content.add(headLbl);
! timeTaken = new Label( messages.getString("TimeTaken")+ "Unknown");
! fScanned = new Label(messages.getString("FScanned")+ "0");
! replacements = new Label( messages.getString("RepMade")+0);
content.add(timeTaken);
content.add(fScanned);
content.add(replacements);
! // cumScanned = new Label( messages.getString("CumFScanned") + 0);
! // cumReplaced = new Label( messages.getString("CumReplaced")+0);
// content.add(cumScanned);
// content.add(cumReplaced);
! // setButtons(false, null, true, messages.getString("StartAgain") );
setContent(content);
}
Index: WelcomePage.java
===================================================================
RCS file: /cvsroot/btrwiz/btrwiz/src/WelcomePage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** WelcomePage.java 17 Jul 2002 15:14:52 -0000 1.4
--- WelcomePage.java 3 Sep 2002 07:41:53 -0000 1.5
***************
*** 1,6 ****
import com.tildemh.jgwizard.*;
! import gnu.gdk.*;
! import gnu.gtk.*;
! import gnu.pango.*;
import java.util.ResourceBundle;
--- 1,6 ----
import com.tildemh.jgwizard.*;
! import org.gnu.gdk.*;
! import org.gnu.gtk.*;
! import org.gnu.pango.*;
import java.util.ResourceBundle;
***************
*** 10,14 ****
class WelcomePage extends WizardPage{
! private GtkVBox content;
private ResourceBundle messages;
--- 10,14 ----
class WelcomePage extends WizardPage{
! private VBox content;
private ResourceBundle messages;
***************
*** 20,51 ****
messages = rb;
! content = new GtkVBox(false, 0);
! GtkLabel titleLbl = new GtkLabel(null);
! titleLbl.setJustify(GtkJustification.CENTER);
titleLbl.setMarkup("<span size=\"xx-large\" weight=\"heavy\">Batch Text Replacer</span>");
titleLbl.setUseMarkup(true);
content.add(titleLbl);
! GtkLabel verLbl = new GtkLabel( messages.getString("Version")+BtrWiz.VERSION);
! verLbl.setJustify(GtkJustification.CENTER);
content.add(verLbl);
! GtkLabel msgLbl = new GtkLabel( messages.getString("DevelWarning") );
msgLbl.setLineWrap(true);
! msgLbl.setJustify(GtkJustification.FILL);
content.add(msgLbl);
! GtkLabel wsLbl = new GtkLabel("http://www.tildemh.com/sw/btrwiz");
! wsLbl.setJustify(GtkJustification.CENTER);
content.add(wsLbl);
! GtkLabel gmsgLbl = new GtkLabel( messages.getString("StartInfo") );
gmsgLbl.setLineWrap(true);
! gmsgLbl.setJustify(GtkJustification.FILL);
content.add(gmsgLbl);
! setButtons(false, null, true, messages.getString("Start") );
setContent(content);
}
--- 20,51 ----
messages = rb;
! content = new VBox(false, 0);
! Label titleLbl = new Label(",");
! titleLbl.setJustification(Justification.CENTER);
titleLbl.setMarkup("<span size=\"xx-large\" weight=\"heavy\">Batch Text Replacer</span>");
titleLbl.setUseMarkup(true);
content.add(titleLbl);
! Label verLbl = new Label( messages.getString("Version")+BtrWiz.VERSION);
! verLbl.setJustification(Justification.CENTER);
content.add(verLbl);
! Label msgLbl = new Label( messages.getString("DevelWarning") );
msgLbl.setLineWrap(true);
! msgLbl.setJustification(Justification.FILL);
content.add(msgLbl);
! Label wsLbl = new Label("http://www.tildemh.com/sw/btrwiz");
! wsLbl.setJustification(Justification.CENTER);
content.add(wsLbl);
! Label gmsgLbl = new Label( messages.getString("StartInfo") );
gmsgLbl.setLineWrap(true);
! gmsgLbl.setJustification(Justification.FILL);
content.add(gmsgLbl);
! // setButtons(false, null, true, messages.getString("Start") );
setContent(content);
}
|