btrwiz-commits Mailing List for Batch Text Replacer Wizard
Brought to you by:
howama
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(23) |
Aug
(7) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|
From: Mark H. <ho...@us...> - 2002-09-03 15:36:16
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv27289/btrwiz/src Added Files: BTRStrings.properties INSTALL Makefile ReplacerProgress.java topleft.png Log Message: more work --- NEW FILE: BTRStrings.properties --- # # Strings for the BTR Replacement program # Started = BTR Replacer Thread Initialised RootDir = Base Directory for Scanning: # # Error Messages # RootDirNotExist = The root directory does not exist - NoIncFilt = You have selected to use include filters, yet have not defined any\ include filters NoFindText = You have not defined any text to search for FindInReplace = The find text is part of the replace text. This is currently \ unsupported. --- NEW FILE: INSTALL --- $Id: INSTALL,v 1.1 2002/09/03 15:36:11 howama Exp $ BTRWiz A very early developmental version. Gui mostly works apart from the treeview, a few issues with multi threading and all the list boxes (waiting for more work on java-gnome). To Install: * install java :) * install java-gnome - LATEST CODE FORM CVS ONLY. * javac *.java (hopefully it will all work) * java BtrWiz Pleas send me all bug reports, and if possible patches. The latest code is available from CVS at sourceforge. This package will be obsolete in a few days (or hours :)), so please do try to get code from CVS if possible. If you are interested in helping out, please do! All help is welcome - java programming, gui work, critiques, help documentation, anything! We particularly welcome students and other people with no experiance - working on open source projects is a great way to learn. Contact me via the btrwiz-devel mailing list btr...@li... http://www.sf.net/projects/btrwiz --- NEW FILE: Makefile --- # # Makefile created at Mon Sep 2 19:27:09 2002, by mmake # # Programs (with common options): SHELL = /bin/sh RM = rm -f MV = mv -f SED = sed ETAGS = etags XARGS = xargs CAT = cat FIND = find CPP = cpp -C -P INSTALL = install INSTALL_PROG = $(INSTALL) -m $(MODE_PROGS) INSTALL_FILE = $(INSTALL) -m $(MODE_FILES) INSTALL_DIR = $(INSTALL) -m $(MODE_DIRS) -d # Install modes MODE_PROGS = 555 MODE_FILES = 444 MODE_DIRS = 2755 # Build programs JAVA = java JAVAC = javac JAVADOC = javadoc JAR = jar # Build flags/home/mark/jgwiz/jgwizard/src/jgwizard.jar JAVAC_FLAGS = -classpath .:/home/mark/indexgen/indexgen/src/gnu-regexp-1.1.4.jar:/home/mark/java-gnome/lib/gtk-0.8.0.jar:/home/mark/jgwiz/jgwizard/src/jgwizard.jar JAVADOC_FLAGS = -version -author JAR_FLAGS = cvf0 JIKES_DEP_FLAG = +M # ------------------------------------------------------------------- # # Prefix for every install directory PREFIX = /usr/share/ # Where to start installing the class files. Set this to an empty value # if you dont want to install classes CLASS_DIR = $(PREFIX)../classes # The directory to install the jar file in. Set this to an empty value # if you dont want to install a jar file JAR_DIR = $(PREFIX)/usr/share/btrwiz # The directory to install html files generated by javadoc DOC_DIR = $(PREFIX)/usr/share/doc/btrwiz/apt # The directory to install script files in SCRIPT_DIR = $(PREFIX)bin # ------------------------------------------------------------------- # # The name of the jar file to install JAR_FILE = btrwiz.jar # # The VERSION variable below should be set to a value # that will be tested in the .xjava code. # VERSION = CHANGE_ME # ------------------------------------------------------------------- # # Packages we should compile PACKAGES = # Resource packages RESOURCES = # Directories with shell scripts SCRIPTS = # ------------------------------------------------------------------- # # A marker variable for the top level directory TOPLEVEL := . # Subdirectories with java files: JAVA_DIRS := $(subst .,/,$(PACKAGES)) $(TOPLEVEL) # Subdirectories with only resource files: RESOURCE_DIRS := $(subst .,/,$(RESOURCES)) # All the .xjava source files: XJAVA_SRC := $(foreach dir, $(JAVA_DIRS), $(wildcard $(dir)/*.xjava)) # All the xjava files to build XJAVA_OBJS := $(XJAVA_SRC:.xjava=.java) # All the .java source files: JAVA_SRC := $(foreach dir, $(JAVA_DIRS), $(wildcard $(dir)/*.java)) JAVA_SRC := $(XJAVA_OBJS) $(JAVA_SRC) # Dependency files: DEPEND_OBJS := $(JAVA_SRC:.java=.u) # Objects that should go into the jar file. (find syntax) JAR_OBJS := \( -name '*.class' -o -name '*.gif' -o -name "*.au" \ -o -name '*.properties' \) # The intermediate java files and main classes we should build: JAVA_OBJS := $(XJAVA_OBJS) $(JAVA_SRC:.java=.class) # Resource files: # Extend the list to install other files of your choice RESOURCE_SRC := *.properties *.gif *.au # Search for resource files in both JAVA_DIRS and RESOURCE_DIRS RESOURCE_OBJS := $(foreach dir, $(JAVA_DIRS) $(RESOURCE_DIRS), \ $(wildcard $(foreach file, $(RESOURCE_SRC), \ $(dir)/$(file)))) # All the shell scripts source SCRIPT_SRCS := $(foreach dir, $(SCRIPTS), $(wildcard $(dir)/*.sh)) # All shell scripts we should install SCRIPT_OBJS := $(SCRIPT_SRCS:.sh=) # All the files to install into CLASS_DIR INSTALL_OBJS := $(foreach dir, $(JAVA_DIRS), $(wildcard $(dir)/*.class)) # Escape inner class delimiter $ INSTALL_OBJS := $(subst $$,\$$,$(INSTALL_OBJS)) # Add the resource files to be installed as well INSTALL_OBJS := $(INSTALL_OBJS) $(RESOURCE_OBJS) # ------------------------------------------------------------------- # define check-exit || exit 1 endef # ----------- # Build Rules # ----------- test: all $(shell export LD_LIBRARY_PATH=/home/mark/java-gnome/lib/) \ $(JAVA) $(JAVAC_FLAGS) BtrWiz %.java: %.xjava $(CPP) -D$(VERSION) $< $@ %.class: %.java $(JAVAC) $(JAVAC_FLAGS) $< %.jar: $(JAVA_OBJS) $(RESOURCE_OBJS) $(FIND) $(TOPLEVEL) $(JAR_OBJS) -print | $(XARGS) \ $(JAR) $(JAR_FLAGS) $(JAR_FILE) %.u: %.java $(JAVAC) $(JIKES_DEP_FLAG) $< # ------- # Targets # ------- .PHONY: all jar install uninstall doc clean depend tags all:: $(JAVA_OBJS) help: @echo "Usage: make {all|jar|install|uninstall|doc|clean|depend|tags}" # Jar target ifneq ($(strip $(JAR_FILE)),) jar: $(JAR_FILE) ifneq ($(strip $(JAR_DIR)),) install:: $(JAR_FILE) @echo "===> [Installing jar file, $(JAR_FILE) in $(JAR_DIR)] " $(INSTALL_DIR) $(JAR_DIR) $(check-exit) $(INSTALL_FILE) $(JAR_FILE) $(JAR_DIR) $(check-exit) uninstall:: @echo "===> [Removing jar file, $(JAR_FILE) from $(JAR_DIR)] " $(RM) $(JAR_DIR)/$(JAR_FILE) $(check-exit) else install:: @echo "No jar install dir defined" endif clean:: $(RM) $(JAR_FILE) else jar: @echo "No jar file defined" endif # Install target for Classes and Resources ifneq ($(strip $(CLASS_DIR)),) install:: $(JAVA_OBJS) @echo "===> [Installing classes in $(CLASS_DIR)] " $(INSTALL_DIR) $(CLASS_DIR) $(check-exit) $(foreach dir, $(JAVA_DIRS) $(RESOURCE_DIRS), \ $(INSTALL_DIR) $(CLASS_DIR)/$(dir) $(check-exit)) $(foreach file, $(INSTALL_OBJS), \ $(INSTALL_FILE) $(file) $(CLASS_DIR)/$(file) \ $(check-exit)) uninstall:: @echo "===> [Removing class-files from $(CLASS_DIR)] " $(foreach file, $(INSTALL_OBJS), \ $(RM) $(CLASS_DIR)/$(file) \ $(check-exit)) else # Print a warning here if you like. (No class install dir defined) endif # Depend target ifeq ($(findstring jikes,$(JAVAC)),jikes) depend: $(XJAVA_OBJS) $(DEPEND_OBJS) ( $(CAT) $(DEPEND_OBJS) | $(SED) -e '/\.class$$/d' \ -e '/.*$$.*/d' > $(MAKEFILE_DEPEND); $(RM) $(DEPEND_OBJS); ) else depend: @echo "mmake needs the jikes compiler to build class dependencies" endif # Doc target ifneq ($(strip $(PACKAGES)),) doc: $(JAVA_SRC) @echo "===> [Installing java documentation in $(DOC_DIR)] " $(INSTALL_DIR) $(DOC_DIR) $(check-exit) $(JAVADOC) -d $(DOC_DIR) $(JAVADOC_FLAGS) $(PACKAGES) else doc: @echo "You must put your source files in a package to run make doc" endif # Script target ifneq ($(strip $(SCRIPT_OBJS)),) all:: $(SCRIPT_OBJS) ifneq ($(strip $(SCRIPT_DIR)),) install:: $(SCRIPT_OBJS) @echo "===> [Installing shell-scripts in $(SCRIPT_DIR)] " $(INSTALL_DIR) $(SCRIPT_DIR) $(check-exit) $(foreach file, $(SCRIPT_OBJS), \ $(INSTALL_PROG) $(file) $(SCRIPT_DIR) $(check-exit)) uninstall:: @echo "===> [Removing shell-scripts from $(SCRIPT_DIR)] " $(foreach file, $(SCRIPT_OBJS), \ $(RM) $(SCRIPT_DIR)/$(file) $(check-exit)) else # Print a warning here if you like. (No script install dir defined) endif clean:: rm -f $(SCRIPT_OBJS) endif # Tag target tags: @echo "Tagging" $(ETAGS) $(filter-out $(XJAVA_OBJS), $(JAVA_SRC)) $(XJAVA_SRC) # Various cleanup routines clean:: $(FIND) . \( -name '*~' -o -name '*.class' \) -print | \ $(XARGS) $(RM) $(FIND) . -name '*.u' -print | $(XARGS) $(RM) ifneq ($(strip $(XJAVA_SRC)),) clean:: $(RM) $(XJAVA_OBJS) endif # ---------------------------------------- # Include the dependency graph if it exist # ---------------------------------------- MAKEFILE_DEPEND = makefile.dep DEPEND = $(wildcard $(MAKEFILE_DEPEND)) ifneq ($(DEPEND),) include $(MAKEFILE_DEPEND) endif --- NEW FILE: ReplacerProgress.java --- /** * Programs which use the replacer class must be able to respond to progress * reports. This is done via this interface. */ interface ReplacerProgress{ void zeroProgress(); void startStageTwo(); void stageOneProgress(int found); void stageTwoProgress(int filesCompleted, String current); void success(); void failure(String msg); } --- NEW FILE: topleft.png --- (This appears to be a binary file; contents omitted.) |
From: Mark H. <ho...@us...> - 2002-09-03 15:28:45
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv24701/btrwiz/src Modified Files: BtrWiz.java FolderSelect.java ProgressPage.java WelcomePage.java Log Message: more work. Index: BtrWiz.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/BtrWiz.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BtrWiz.java 3 Sep 2002 07:41:53 -0000 1.8 --- BtrWiz.java 3 Sep 2002 15:28:41 -0000 1.9 *************** *** 43,47 **** */ public BtrWiz(){ ! super( "BTRWiz "+VERSION ); } --- 43,47 ---- */ public BtrWiz(){ ! super( "BTRz "+VERSION ); } *************** *** 56,86 **** WizardPage welcomePage = new WelcomePage(messages, this, null, messages.getString("WelcomeTitle") ); WizardPage selFolders = new FolderSelect(btr, messages, this, welcomePage, messages.getString("SelFoldersTitle") ); ! WizardPage incFilters = new IncludeFilters(btr, messages, this, selFolders, messages.getString("IncFiltersTitle") ); ! WizardPage excFilters = new ExcludeFilters(btr, messages, this, selFolders, messages.getString("ExcFiltersTitle") ); ! WizardPage findReplace = new FindReplace(btr, messages, this, welcomePage, messages.getString("FindReplaceTitle") ); ! ProgressPage progress = new ProgressPage(btr, messages, this, findReplace, messages.getString("ProgressTitle") ); ! WizardPage finished = new SummaryPage(btr, messages, this, welcomePage, messages.getString("SummaryTitle") ); ! btr.setProgressPage(progress); setFirstPage(welcomePage); welcomePage.setFirstChild(selFolders); - welcomePage.setNextScreen(welcomePage); - selFolders.setParentScreen(welcomePage); ! selFolders.setFirstChild(incFilters); ! incFilters.setParentScreen(selFolders); ! incFilters.setNextScreen(excFilters); ! excFilters.setPreviousScreen(incFilters); ! excFilters.setNextScreen(null); ! ! selFolders.setNextScreen(findReplace); ! findReplace.setPreviousScreen(selFolders); ! findReplace.setFirstChild(progress); ! progress.setNextScreen(finished); ! } --- 56,79 ---- WizardPage welcomePage = new WelcomePage(messages, this, null, messages.getString("WelcomeTitle") ); WizardPage selFolders = new FolderSelect(btr, messages, this, welcomePage, messages.getString("SelFoldersTitle") ); ! // WizardPage incFilters = new IncludeFilters(btr, messages, this, selFolders, messages.getString("IncFiltersTitle") ); ! // WizardPage excFilters = new ExcludeFilters(btr, messages, this, selFolders, messages.getString("ExcFiltersTitle") ); ! // WizardPage findReplace = new FindReplace(btr, messages, this, welcomePage, messages.getString("FindReplaceTitle") ); ! // ProgressPage progress = new ProgressPage(btr, messages, this, findReplace, messages.getString("ProgressTitle") ); ! // WizardPage finished = new SummaryPage(btr, messages, this, welcomePage, messages.getString("SummaryTitle") ); ! // btr.setProgressPage(progress); setFirstPage(welcomePage); welcomePage.setFirstChild(selFolders); ! // selFolders.setFirstChild(incFilters); ! // incFilters.setParentScreen(selFolders); ! // incFilters.joinNextScreen(excFilters); ! // selFolders.joinNextScreen(findReplace); + // findReplace.setFirstChild(progress); + // progress.setNextScreen(finished); } Index: FolderSelect.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/FolderSelect.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FolderSelect.java 3 Sep 2002 07:41:53 -0000 1.6 --- FolderSelect.java 3 Sep 2002 15:28:41 -0000 1.7 *************** *** 7,11 **** /** ! * The second page of the wizard, responsible for delecting the folders to be * scanned. */ --- 7,11 ---- /** ! * The second page of the wizard, responsible for detecting the folders to be * scanned. */ *************** *** 16,20 **** /** The content container to be shown on the screen */ private VBox content; ! Entry dirEntry; /** --- 16,20 ---- /** The content container to be shown on the screen */ private VBox content; ! private Entry dirEntry; /** Index: ProgressPage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/ProgressPage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProgressPage.java 3 Sep 2002 07:41:53 -0000 1.4 --- ProgressPage.java 3 Sep 2002 15:28:41 -0000 1.5 *************** *** 37,41 **** content = new VBox(false, 0); ! stageOneFrame = new Frame(null); VBox stageOneBox = new VBox(false, 3); stageOneFrame.add(stageOneBox); --- 37,41 ---- content = new VBox(false, 0); ! stageOneFrame = new Frame("Stage One"); VBox stageOneBox = new VBox(false, 3); stageOneFrame.add(stageOneBox); *************** *** 52,56 **** * Stage Two */ ! stageTwoFrame = new Frame(null); VBox stageTwoBox = new VBox(false, 3); Label scanning = new Label( messages.getString("StageTwoHead") ); --- 52,56 ---- * Stage Two */ ! stageTwoFrame = new Frame("Stage two"); VBox stageTwoBox = new VBox(false, 3); Label scanning = new Label( messages.getString("StageTwoHead") ); Index: WelcomePage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/WelcomePage.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WelcomePage.java 3 Sep 2002 07:41:53 -0000 1.5 --- WelcomePage.java 3 Sep 2002 15:28:41 -0000 1.6 *************** *** 39,42 **** --- 39,43 ---- Label wsLbl = new Label("http://www.tildemh.com/sw/btrwiz"); wsLbl.setJustification(Justification.CENTER); + wsLbl.setSelectable(true); content.add(wsLbl); *************** *** 45,51 **** gmsgLbl.setJustification(Justification.FILL); content.add(gmsgLbl); - ! // setButtons(false, null, true, messages.getString("Start") ); setContent(content); } --- 46,52 ---- gmsgLbl.setJustification(Justification.FILL); content.add(gmsgLbl); ! setButtonVisibility(true, true); ! setButtonCaptions("", messages.getString("Start")); setContent(content); } |
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); } |
From: Mark H. <ho...@us...> - 2002-08-06 15:20:34
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv8520 Modified Files: BtrWiz.java Log Message: added image Index: BtrWiz.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/BtrWiz.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BtrWiz.java 18 Jul 2002 17:01:45 -0000 1.6 --- BtrWiz.java 6 Aug 2002 15:20:31 -0000 1.7 *************** *** 50,53 **** --- 50,56 ---- */ public void customise(){ + GtkImage topLeft = new GtkImage("topleft.png"); + getTopLeft().add(topLeft); + Replacer btr = new Replacer(); WizardPage welcomePage = new WelcomePage(messages, this, null, messages.getString("WelcomeTitle") ); |
From: Mark H. <ho...@us...> - 2002-08-06 15:18:08
|
Update of /cvsroot/btrwiz/btrwiz/doc/src In directory usw-pr-cvs1:/tmp/cvs-serv7207/doc/src Added Files: btren.pm makedoc.pl Log Message: initial documentation work --- NEW FILE: btren.pm --- #!/usr bin/perl # # BtrWiz documentation translations # package btren; $btren::data = { 'full name' => 'Batch Text Replacer Wizard', 'Version: ' => 'Version: ', 'help docs' => 'Help Documentation', 'index head' => 'BTRWiz is a graphical application for replacing text over multiple files. BTRWiz is given a list of directories and filters, from which it determines the files to be scanned. Each of these files is searched for the find text and all occurances are replaced with the replace text. If the user wishes, these can be interpreted as regular expressions. This document describes the operation of Batch Text Replacer.', 'authors' => 'This help documentation has been written by Mark Howard. This is part of an open source project. We always need more help writing documentation. If you could spare a few moments of time, either to write more documentation, review documentation, or just send encouraging mail, we would be very grateful', # Rewrite the next paragraph to give details of yourself and your # translation. 'translation' => 'This is the native Engligh (GB) documentation by Mark Howard.', 'also avail in' => 'This document is available in the following languages: ', 'please translate' => 'If your language is not listed above, please consider translating the documentation to your own language. It is not a difficult task, involves minimal work and will make a lot of people happy :).', # Various page titles, also used on the index page 'command line options' => 'Command Line Options', 'screens' => 'Wizard Pages', 'Start Screen' => 'Start Screen', 'Development' => 'Development', 'Getting More Help' => 'Getting More Help', 'options head' => 'BTRWiz is primarily a graphical application. In order to make any text replacements, it must (currently) be run as a graphical application. However, we do provide the following command line options:', 'version' => 'Displays a version message and exits', 'help' => 'Displays a help message and exits', 'screens head' => 'BTRWiz is composed of a number of wizard "screens". Each of these performs a specific task in the replacement process. The following page describes the function of each screen', 'welcome screen' => 'Welcome screen', 'welcome details' => 'This page is merely a banner screen for the start of the program. It serves no purpose other than to tell you the program version and a little bit about what the proceeding screens do.', }; 1; --- NEW FILE: makedoc.pl --- #!/usr/bin/perl # # BTRWiz documentation creator # use strict; use warnings; use CGI qw(:standard *table *Tr *td); use CGI::Pretty; use btren; my %locales = ('en' => 'English', ); my $version = '0.0.0.0.1'; &generatehtml; sub generatehtml{ foreach my $locale (keys %locales){ my $data; $data = $btren::data if ($locale eq 'en'); printindex( $locale, $data); printoptions( $locale, $data); printscreens( $locale, $data); printmorehelp( $locale, $data); } } sub printheader{ my $out = shift; my $data = shift; print $out start_html({-style => {src => '../stylesheet.css'}}), start_table({-class => 'head', -cellspacing => 0, -cellpadding => 0, -border => 0 }), Tr( td({-rowspan => 3}, 'LOGO' ), td( h3({-class => 'head'}, $data->{'full name'}) ), ), Tr( td( h2({-class => 'head'}, $data->{'help docs'})), ), Tr( td( p({-class => 'head'}, $data->{"Version: "}, $version)), ), end_table, ; print OUT start_table({-width => '100%'}), start_Tr(), start_td(); print OUT ul( li(a({-href => 'options.html'}, $data->{'command line options'}) ), li( a({-href => 'screens.html'}, $data->{'screens'})), # ul( # li($data->{'Start Screen'} ) # )), li(a({-href => 'morehelp.html'}, $data->{'Getting More Help'})), ), end_td(), start_td(); } sub printfooter{ my $out = shift; my $data = shift; print $out end_td(), end_Tr(), table({-class => 'head', -width=> '100%', -cellspacing => 0, -cellpadding => 0, -border => 0}), Tr( td( p({-class => 'head'}, $data->{'full name'})), td( p({-class => 'head', -align => 'right'}, $data->{'help docs'})) ), end_html; } sub printindex{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/index.html" or die "Unable to open output file, ../user/$locale/index.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'help docs'}), p( $data->{'index head'} ), p( $data->{'authors'} ), p( $data->{'tranlation'} ), p( $data->{'also avail in'} ), ul( li( a({-href => '../en/index.html'}, 'English') ), ), p( $data->{'please translate'} ); printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/index.html\: $!"; } sub printoptions{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/options.html" or die "Unable to open output file, ../user/$locale/options.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'command line options'}), p($data->{'options head'}), dl( dt( code('-v, --version') ), dd( $data->{'version'} ), dt( code('-h, --help') ), dd( $data->{'help'} ), ); printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/options.html\: $!"; } sub printmorehelp{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/morehelp.html" or die "Unable to open output file, ../user/$locale/morehelp.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'Getting More Help'}), p( a({-href => 'mailto:btr...@li...'}, 'btr...@li...') ), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/morehelp.html\: $!"; } sub printscreens{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/screens.html" or die "Unable to open output file, ../user/$locale/screens.html\: $!"; printheader( \*OUT, $data); print OUT h1( $data->{'screens'}), p( $data->{'screens head'} ), h2( $data->{'welcome screen'} ), p( $data->{'welcome details'}), '.', br(), '.', br(), '.', br(), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/screens.html\: $!"; } sub printopns{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/index.html" or die "Unable to open output file, ../user/$locale/index.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'help docs'}), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/index.html\: $!"; } |
From: Mark H. <ho...@us...> - 2002-08-06 15:18:08
|
Update of /cvsroot/btrwiz/btrwiz/doc/user In directory usw-pr-cvs1:/tmp/cvs-serv7207/doc/user Added Files: stylesheet.css Log Message: initial documentation work --- NEW FILE: stylesheet.css --- /* * CSS Stylesheet for btrwiz documentation */ body{ background-color:#ffcc00; } table.head{ background-color:#cc9900; width:100%; border: 0; } h2.head{ padding:0; margin:3px; color:#000000; } h3.head{ border:0; padding:0; margin:0; /* color:#ffcc00;*/ } p.head{ border:0; padding:0; margin:0; /* color:#ffcc00;*/ } /* h1{ color:#000066; } h2{ color:#000066; } h3{ color:#000066; } */ |
From: Mark H. <ho...@us...> - 2002-08-06 15:16:49
|
Update of /cvsroot/btrwiz/btrwiz/doc/user In directory usw-pr-cvs1:/tmp/cvs-serv6719/doc/user Log Message: Directory /cvsroot/btrwiz/btrwiz/doc/user added to the repository |
From: Mark H. <ho...@us...> - 2002-08-06 15:16:49
|
Update of /cvsroot/btrwiz/btrwiz/doc/src In directory usw-pr-cvs1:/tmp/cvs-serv6719/doc/src Log Message: Directory /cvsroot/btrwiz/btrwiz/doc/src added to the repository |
From: Mark H. <ho...@us...> - 2002-08-06 15:16:49
|
Update of /cvsroot/btrwiz/btrwiz/doc/user/en In directory usw-pr-cvs1:/tmp/cvs-serv6719/doc/user/en Log Message: Directory /cvsroot/btrwiz/btrwiz/doc/user/en added to the repository |
From: Mark H. <ho...@us...> - 2002-08-06 15:15:24
|
Update of /cvsroot/btrwiz/btrwiz/doc In directory usw-pr-cvs1:/tmp/cvs-serv6120/doc Log Message: Directory /cvsroot/btrwiz/btrwiz/doc added to the repository |
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv5826 Modified Files: BtrWiz.java ExcludeFilters.java FindReplace.java FolderSelect.java IncludeFilters.java ProgressPage.java Replacer.java SummaryPage.java Log Message: various chanes Index: BtrWiz.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/BtrWiz.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BtrWiz.java 17 Jul 2002 18:31:15 -0000 1.5 --- BtrWiz.java 18 Jul 2002 17:01:45 -0000 1.6 *************** *** 50,60 **** */ public void customise(){ WizardPage welcomePage = new WelcomePage(messages, this, null, messages.getString("WelcomeTitle") ); ! WizardPage selFolders = new FolderSelect(messages, this, welcomePage, messages.getString("SelFoldersTitle") ); ! WizardPage incFilters = new IncludeFilters(messages, this, selFolders, messages.getString("IncFiltersTitle") ); ! WizardPage excFilters = new ExcludeFilters(messages, this, selFolders, messages.getString("ExcFiltersTitle") ); ! WizardPage findReplace = new FindReplace(messages, this, welcomePage, messages.getString("FindReplaceTitle") ); ! WizardPage progress = new ProgressPage(messages, this, findReplace, messages.getString("ProgressTitle") ); ! WizardPage finished = new SummaryPage(messages, this, welcomePage, messages.getString("SummaryTitle") ); setFirstPage(welcomePage); --- 50,63 ---- */ public void customise(){ + Replacer btr = new Replacer(); WizardPage welcomePage = new WelcomePage(messages, this, null, messages.getString("WelcomeTitle") ); ! WizardPage selFolders = new FolderSelect(btr, messages, this, welcomePage, messages.getString("SelFoldersTitle") ); ! WizardPage incFilters = new IncludeFilters(btr, messages, this, selFolders, messages.getString("IncFiltersTitle") ); ! WizardPage excFilters = new ExcludeFilters(btr, messages, this, selFolders, messages.getString("ExcFiltersTitle") ); ! WizardPage findReplace = new FindReplace(btr, messages, this, welcomePage, messages.getString("FindReplaceTitle") ); ! ProgressPage progress = new ProgressPage(btr, messages, this, findReplace, messages.getString("ProgressTitle") ); ! WizardPage finished = new SummaryPage(btr, messages, this, welcomePage, messages.getString("SummaryTitle") ); ! ! btr.setProgressPage(progress); setFirstPage(welcomePage); *************** *** 74,77 **** --- 77,81 ---- findReplace.setFirstChild(progress); + progress.setNextScreen(finished); Index: ExcludeFilters.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/ExcludeFilters.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExcludeFilters.java 17 Jul 2002 18:24:41 -0000 1.2 --- ExcludeFilters.java 18 Jul 2002 17:01:45 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- class ExcludeFilters extends WizardPage{ private ResourceBundle messages; + private Replacer btr; private GtkVBox content; *************** *** 20,26 **** * Creates the page */ ! ExcludeFilters(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); --- 21,28 ---- * Creates the page */ ! ExcludeFilters(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; + btr = rep; content = new GtkVBox(false, 0); *************** *** 63,66 **** System.out.println("Remove Selected"); } ! } --- 65,71 ---- System.out.println("Remove Selected"); } ! ! public void postShow(){ ! btr.setExcFilt( new String[0] ); ! } } Index: FindReplace.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/FindReplace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FindReplace.java 17 Jul 2002 15:09:28 -0000 1.1 --- FindReplace.java 18 Jul 2002 17:01:45 -0000 1.2 *************** *** 9,13 **** */ class FindReplace extends WizardPage{ ! private GtkVBox content; private ResourceBundle messages; --- 9,13 ---- */ class FindReplace extends WizardPage{ ! private Replacer btr; private GtkVBox content; private ResourceBundle messages; *************** *** 18,24 **** * Creates the screen */ ! FindReplace(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); --- 18,25 ---- * Creates the screen */ ! FindReplace(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; + btr = rep; content = new GtkVBox(false, 0); *************** *** 66,69 **** --- 67,83 ---- 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() ); } } Index: FolderSelect.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/FolderSelect.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FolderSelect.java 17 Jul 2002 18:30:23 -0000 1.4 --- FolderSelect.java 18 Jul 2002 17:01:45 -0000 1.5 *************** *** 12,16 **** class FolderSelect extends WizardPage{ private ResourceBundle messages; ! /** The content container to be shown on the screen */ private GtkVBox content; --- 12,17 ---- class FolderSelect extends WizardPage{ private ResourceBundle messages; ! private Replacer btr; ! /** The content container to be shown on the screen */ private GtkVBox content; *************** *** 20,26 **** * Creates the graphical elements and sets up signals */ ! FolderSelect(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); --- 21,28 ---- * Creates the graphical elements and sets up signals */ ! FolderSelect(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; + btr = rep; content = new GtkVBox(false, 0); *************** *** 45,49 **** } ! GtkFileSelection selector; --- 47,54 ---- } ! public void postShow(){ ! btr.setRoot(dirEntry.getText()); ! } ! GtkFileSelection selector; Index: IncludeFilters.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/IncludeFilters.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IncludeFilters.java 17 Jul 2002 18:20:53 -0000 1.4 --- IncludeFilters.java 18 Jul 2002 17:01:45 -0000 1.5 *************** *** 12,26 **** class IncludeFilters extends WizardPage{ private ResourceBundle messages; private GtkVBox content; private GtkListStore filtList; private GtkEntry addTxt; /** * Creates the page */ ! IncludeFilters(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); --- 12,30 ---- class IncludeFilters extends WizardPage{ private ResourceBundle messages; + private Replacer btr; private GtkVBox content; private GtkListStore filtList; private GtkEntry addTxt; + private GtkCheckButton useIncFilt; + private GtkVBox incWidgets; /** * Creates the page */ ! IncludeFilters(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; + btr = rep; content = new GtkVBox(false, 0); *************** *** 31,36 **** content.add(headLbl); GtkLabel curFiltLbl = new GtkLabel( messages.getString("CurIncFilters") ); ! content.add(curFiltLbl); /* GtkListStore model; --- 35,47 ---- 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; *************** *** 67,80 **** addBtn.signalConnect("clicked", "addFilter", this); addSpace.add(addBtn); ! content.add(addSpace); GtkButton rmBtn = new GtkButton( messages.getString("RmIncFilt") ); rmBtn.signalConnect("clicked", "rmSelected", this); ! content.add(rmBtn); setButtons(true, messages.getString("Prev"), true, messages.getString("Next") ); setContent(content); } ! /** * Event handler for pressing of 'add' button. --- 78,100 ---- 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); } ! ! /** ! * Handles the display of the widgets, depedning on the status of the tuse ! * filters toggel button. ! */ ! private void toggleView(){ ! incWidgets.setSensitive( useIncFilt.getActive() ); ! } /** * Event handler for pressing of 'add' button. *************** *** 89,92 **** --- 109,116 ---- private void rmSelected(){ System.out.println("Remove Selected"); + } + public void postShow(){ + btr.setUseInc( useIncFilt.getActive() ); + btr.setIncFilt( new String[0] ); } } Index: ProgressPage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/ProgressPage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProgressPage.java 17 Jul 2002 18:25:21 -0000 1.2 --- ProgressPage.java 18 Jul 2002 17:01:45 -0000 1.3 *************** *** 9,17 **** */ class ProgressPage extends WizardPage{ ! private GtkVBox content; private ResourceBundle messages; private GtkProgressBar replaceProgress; ! private GtkFrame stageOneFrame; private GtkLabel filesAdded; --- 9,19 ---- */ 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; *************** *** 27,43 **** * Creates the screen */ ! ProgressPage(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); stageOneFrame = new GtkFrame(null); GtkLabel stOneHead = new GtkLabel( messages.getString("StageOneHead") ); ! stageOneFrame.add(stOneHead); filesAdded = new GtkLabel( messages.getString("FilesAdded")+"0" ); ! stageOneFrame.add(filesAdded); ! searchingFolders = new GtkLabel( messages.getstring("PlzWait") ); ! stageOneFrame.add(searchingFolders); content.add(stageOneFrame); --- 29,49 ---- * Creates the screen */ ! ProgressPage(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; + wizard = parent; + 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); *************** *** 69,102 **** * Sets all values as zero */ ! protected void zeroProgress(){ stageOneFrame.setSensitive(true); stageTwoFrame.setSensitive(false); replaceProgress.setFraction(0); ! private GtkLabel filesAdded; ! private GtkLabel searchingFolders; ! private int fileCount = 0; ! private int done = 0; ! private GtkLabel processed; ! private GtkLabel curFile; } /** - * Sets up the screen for stage one to progress. */ ! protected void startStageOne(){ } /** */ ! protected void startStageTwo(){ } /** */ ! protected void stageOneProgress(){ ! } ! /** */ ! protected void stageTwoProgress(){ } } --- 75,124 ---- * Sets all values as zero */ ! synchronized void zeroProgress(){ stageOneFrame.setSensitive(true); stageTwoFrame.setSensitive(false); replaceProgress.setFraction(0); ! filesAdded.setLabel( messages.getString("FilesAdded")+"0" ); ! searchingFolders.setLabel( messages.getString("PlzWait")); ! fileCount = 0; ! done = 0; ! processed.setLabel( messages.getString("FilesProcessed") + done +"/"+fileCount); ! curFile.setLabel( messages.getString("CurFile") + messages.getString("NoCur")); } /** */ ! synchronized void startStageTwo(){ ! stageOneFrame.setSensitive(false); ! stageTwoFrame.setSensitive(true); ! filesAdded.setLabel( messages.getString("FilesAdded")+fileCount ); ! searchingFolders.setLabel( messages.getString("DoneScanning")); } /** */ ! synchronized void stageOneProgress(int found){ ! fileCount = found; ! filesAdded.setLabel( messages.getString("FilesAdded")+found ); } /** */ ! synchronized void stageTwoProgress(int filesCompleted, String current){ ! done = filesCompleted; ! processed.setLabel( messages.getString("FilesProcessed") + done +"/"+fileCount); ! curFile.setLabel( messages.getString("CurFile") + current); ! replaceProgress.setFraction(done / fileCount); } ! /* */ ! 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(); } } Index: Replacer.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/Replacer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Replacer.java 17 Jul 2002 15:16:25 -0000 1.1 --- Replacer.java 18 Jul 2002 17:01:45 -0000 1.2 *************** *** 1,9 **** /** * Performs replace operations, sending progress reports to the progress page. */ ! public class Replacer{ /** Root Directory for scanning */ private String rootDir; /** Filters for inclusion. Order Allow, Deny */ private String[] incFilters; --- 1,17 ---- + import gnu.regexp.*; + import java.lang.reflect.Array; + import java.io.*; + import java.util.ResourceBundle; + import java.util.Locale; + import java.util.*; /** * Performs replace operations, sending progress reports to the progress page. */ ! public class Replacer implements Runnable{ /** Root Directory for scanning */ private String rootDir; + /** If true, include filters should be used */ + private boolean useIncFilters; /** Filters for inclusion. Order Allow, Deny */ private String[] incFilters; *************** *** 17,23 **** --- 25,214 ---- * expressions */ private boolean regExp; + /** The progress WizardPage, used for updating progress reports. */ + private ProgressPage progress; + /** When false, the thread will terminate */ + private boolean runFreely = true; + private static ResourceBundle messages; + private Stack toScan; // Folders to be scanned + private Stack toSearch; // files to be searched + private int fileCount = 0; + private int completed = 0; + private int replacementsMade =0; + private long started; + private long timeTaken = 0; + + public Replacer(){ + messages = ResourceBundle.getBundle("BTRStrings", Locale.getDefault() ); + } + public void setProgressPage( ProgressPage progScreen){ + progress = progScreen; + } + /** + * The main thread for performing the replace operations. + */ + public void run(){ + started = System.currentTimeMillis(); + System.out.println( messages.getString("Started") ); + System.out.println( messages.getString("RootDir")+ rootDir); + System.out.println( "Find Txt: "+findText ); + System.out.println( "Replace Txt: "+replaceText ); + progress.zeroProgress(); + toScan = new Stack(); + toScan.push(rootDir); + toSearch = new Stack(); + fileCount = 0; + completed = 0; + + while (toScan.empty() == false){ + scanDir((String) toScan.pop()); + } + replacementsMade = 0; + progress.startStageTwo(); + while (toSearch.empty() ==false){ + searchFile( (String) toSearch.pop() ); + } + timeTaken = System.currentTimeMillis() - started; + progress.success(); + } + + /** + * Performs search and replace on a single file. + */ + private void searchFile(String fileName){ + System.out.println("Scanning file: "+fileName); + progress.stageTwoProgress(completed, fileName); + BufferedReader fileBR; + try{ + fileBR = new BufferedReader( new FileReader(fileName) ); + }catch(IOException e){ + System.out.println("Error opening "+fileName+e); + return; + } + String file = ""; + try{ + file += fileBR.readLine() + System.getProperty("line.separator"); + }catch(EOFException c){ + }catch(IOException e){ + System.out.println("Error Reading file: "+e); + } + try{ + fileBR.close(); + }catch(Exception e){ + System.out.println("Error closing "+fileName+e); + } + int curRepMade =0; + + if (regExp){ + try{ + + }catch(Exception e){} + }else{ + while (file.indexOf(findText) > - 1){ + System.out.println("Found one!!!"); + curRepMade++; + file = file.substring(0, file.indexOf(findText)) + replaceText + file.substring( file.indexOf(findText) + replaceText.length() ) ; + } + } + if(curRepMade > 0){ + // save the file + + } + replacementsMade += curRepMade; + completed++; + } + private void scanDir( String dirToScan ){ + for (int i =0; i < Array.getLength( excFilters ); i++){ + if ( excFilters[i].equals("")){ continue; } + try{ + RE exp = new RE( excFilters[i] ); + if (exp.isMatch(toScan) ){ + // ignore the entry + return; + } + }catch(REException e){ + System.out.println("RE Exception"); + } + } + + File dir = new File(dirToScan); + File[] dirFiles = dir.listFiles(); + if ( Array.getLength(dirFiles) >0){ + for (int i = 0; i< Array.getLength(dirFiles); i++){ + if (dirFiles[i].isDirectory()){ + scanDir(dirFiles[i].toString()); + }else{ + // Add the file to the list + /* + * TODO: TEST FILTERS + */ + toSearch.push( dirFiles[i].toString() ); + fileCount++; + progress.stageOneProgress(fileCount); + } + } } + } + + + /** + * Requests to stop the thread. + */ + public void pleaseStop(){ + runFreely = false; + } + /* + */ + public void setRoot(String root){ + rootDir = root; + } + /** + */ + public void setUseInc(boolean useInc){ + useIncFilters = useInc; + } + /* + */ + public void setIncFilt(String[] incFilt){ + incFilters = incFilt; + } + /** + */ + public void setExcFilt(String[] excFilt){ + excFilters = excFilt; + } + /** + */ + public void setFindTxt(String toFind){ + findText = toFind; + } + /** + */ + public void setReplaceTxt(String replaceWith){ + replaceText = replaceWith; + } + + /** + */ + public void setUseRegExp(boolean useRE){ + regExp = useRE; + } + /** + */ + public long getTimeTaken(){ + return timeTaken; + } + + /** + */ + public int getFileCount(){ + return completed; + } + /** + */ + public int getReplacementCount(){ + return replacementsMade; + } Index: SummaryPage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/SummaryPage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SummaryPage.java 17 Jul 2002 15:10:49 -0000 1.1 --- SummaryPage.java 18 Jul 2002 17:01:45 -0000 1.2 *************** *** 9,22 **** */ class SummaryPage extends WizardPage{ ! private GtkVBox content; private ResourceBundle messages; private GtkProgressBar replaceProgress ; /* * Creates the screen */ ! SummaryPage(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; --- 9,28 ---- */ 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 */ ! SummaryPage(Replacer rep, ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); + btr = rep; messages = rb; *************** *** 26,32 **** --- 32,58 ---- 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); + } + public void preShow(){ + System.out.println("Summary Page Pre Show proc"); + long time = btr.getTimeTaken() ; + time = time / 1000; + timeTaken.setLabel( messages.getString("TimeTaken")+ time + messages.getString("Seconds") ); + fScanned.setLabel( messages.getString("FScanned") + btr.getFileCount() ); + replacements.setLabel( messages.getString("RepMade") + btr.getReplacementCount() ); } } |
From: Mark H. <ho...@us...> - 2002-07-17 18:31:19
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv29575 Modified Files: BtrWiz.java Log Message: fix typo Index: BtrWiz.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/BtrWiz.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BtrWiz.java 17 Jul 2002 14:59:58 -0000 1.4 --- BtrWiz.java 17 Jul 2002 18:31:15 -0000 1.5 *************** *** 56,60 **** WizardPage findReplace = new FindReplace(messages, this, welcomePage, messages.getString("FindReplaceTitle") ); WizardPage progress = new ProgressPage(messages, this, findReplace, messages.getString("ProgressTitle") ); ! WizardPage finished = new SummaryPage(messages, this, welcomePage, messages.getString("summaryTitle") ); setFirstPage(welcomePage); --- 56,60 ---- WizardPage findReplace = new FindReplace(messages, this, welcomePage, messages.getString("FindReplaceTitle") ); WizardPage progress = new ProgressPage(messages, this, findReplace, messages.getString("ProgressTitle") ); ! WizardPage finished = new SummaryPage(messages, this, welcomePage, messages.getString("SummaryTitle") ); setFirstPage(welcomePage); |
From: Mark H. <ho...@us...> - 2002-07-17 18:30:25
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv29315 Modified Files: FolderSelect.java Log Message: added parent screen Index: FolderSelect.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/FolderSelect.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FolderSelect.java 13 Jul 2002 14:00:26 -0000 1.3 --- FolderSelect.java 17 Jul 2002 18:30:23 -0000 1.4 *************** *** 20,25 **** * Creates the graphical elements and sets up signals */ ! FolderSelect(ResourceBundle rb, WizardForm parent, String title){ ! super(parent, title, null); messages = rb; --- 20,25 ---- * Creates the graphical elements and sets up signals */ ! FolderSelect(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ ! super(parent, parentScreen, title, null); messages = rb; |
From: Mark H. <ho...@us...> - 2002-07-17 18:26:12
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv26918 Modified Files: InterfaceStr.properties Log Message: progress updates + more Index: InterfaceStr.properties =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/InterfaceStr.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InterfaceStr.properties 17 Jul 2002 15:13:05 -0000 1.2 --- InterfaceStr.properties 17 Jul 2002 18:26:09 -0000 1.3 *************** *** 44,47 **** --- 44,49 ---- excluded from inspection, regardless of the include filters. CurIncFilters = Current Include Filters: + AddIncFilt = Add + RmIncFilt = Remove Selected # *************** *** 52,55 **** --- 54,59 ---- that file will be explicitely excluded from the search and replace operation. CurExcFilters = Current Exclude Filters: + AddExcFilt = Add + RmExcFilt = Remove Selected *************** *** 72,75 **** --- 76,88 ---- # ProgressTitle = Progress + StageOneHead = Determining Folders to Scan... + FilesAdded = Files found: + PlzWait = Please Wait... + StageTwoHead = Searching files... + FilesProcessed = Files Processed: + CurFile = Current File: + NoCur = None + + # *************** *** 79,80 **** --- 92,98 ---- Success = The replace operation has successfully completed. StartAgain = Start Again + + + + + |
From: Mark H. <ho...@us...> - 2002-07-17 18:25:24
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv26112 Modified Files: ProgressPage.java Log Message: i18n, start of methods to update display. Index: ProgressPage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/ProgressPage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProgressPage.java 17 Jul 2002 15:10:15 -0000 1.1 --- ProgressPage.java 17 Jul 2002 18:25:21 -0000 1.2 *************** *** 12,16 **** private GtkVBox content; private ResourceBundle messages; ! private GtkProgressBar replaceProgress ; /* --- 12,26 ---- 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; /* *************** *** 23,42 **** content = new GtkVBox(false, 0); ! GtkFrame stageOneFrame = new GtkFrame(null); ! GtkLabel fileSearch = new GtkLabel("Determining Folders to Scan"); ! stageOneFrame.add(fileSearch); content.add(stageOneFrame); ! GtkFrame stageTwoFrame = new GtkFrame(null); GtkVBox stageTwoBox = new GtkVBox(false, 3); ! GtkLabel scanning = new GtkLabel("Searching files"); stageTwoBox.add(scanning); ! GtkLabel processed = new GtkLabel("Files Processed: 5/65"); stageTwoBox.add(processed); ! GtkLabel curFile = new GtkLabel("Current file: index.cgi"); stageTwoBox.add(curFile); replaceProgress = new GtkProgressBar(); - replaceProgress.setFraction(0.34); stageTwoBox.add(replaceProgress); --- 33,59 ---- content = new GtkVBox(false, 0); ! stageOneFrame = new GtkFrame(null); ! GtkLabel stOneHead = new GtkLabel( messages.getString("StageOneHead") ); ! stageOneFrame.add(stOneHead); ! filesAdded = new GtkLabel( messages.getString("FilesAdded")+"0" ); ! stageOneFrame.add(filesAdded); ! searchingFolders = new GtkLabel( messages.getstring("PlzWait") ); ! stageOneFrame.add(searchingFolders); content.add(stageOneFrame); + ! /* ! * 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); *************** *** 47,50 **** --- 64,102 ---- setButtons(false, null, false, null ); setContent(content); + } + + /** + * Sets all values as zero + */ + protected void zeroProgress(){ + stageOneFrame.setSensitive(true); + stageTwoFrame.setSensitive(false); + replaceProgress.setFraction(0); + private GtkLabel filesAdded; + private GtkLabel searchingFolders; + private int fileCount = 0; + private int done = 0; + private GtkLabel processed; + private GtkLabel curFile; + + } + /** + * Sets up the screen for stage one to progress. + */ + protected void startStageOne(){ + } + /** + */ + protected void startStageTwo(){ + } + /** + */ + protected void stageOneProgress(){ + + } + /** + */ + protected void stageTwoProgress(){ + } } |
From: Mark H. <ho...@us...> - 2002-07-17 18:24:43
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv25849 Modified Files: ExcludeFilters.java Log Message: add & remove options Index: ExcludeFilters.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/ExcludeFilters.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExcludeFilters.java 17 Jul 2002 15:07:31 -0000 1.1 --- ExcludeFilters.java 17 Jul 2002 18:24:41 -0000 1.2 *************** *** 14,18 **** private GtkVBox content; ! private GtkListStore filtList; --- 14,18 ---- private GtkVBox content; ! private GtkEntry addTxt; private GtkListStore filtList; *************** *** 33,36 **** --- 33,48 ---- 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); *************** *** 38,40 **** --- 50,66 ---- setContent(content); } + /** + * Event handler for pressing of 'add' button. + */ + private void addFilter(){ + System.out.println(addTxt.getText()); + } + + /** + * Event handler for pressing of 'remove' button. + */ + private void rmSelected(){ + System.out.println("Remove Selected"); + } + } |
From: Mark H. <ho...@us...> - 2002-07-17 18:20:57
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv23450 Modified Files: IncludeFilters.java Log Message: added add & remove boxes Index: IncludeFilters.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/IncludeFilters.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IncludeFilters.java 17 Jul 2002 15:13:34 -0000 1.3 --- IncludeFilters.java 17 Jul 2002 18:20:53 -0000 1.4 *************** *** 14,19 **** private GtkVBox content; - private GtkListStore filtList; /** --- 14,19 ---- private GtkVBox content; private GtkListStore filtList; + private GtkEntry addTxt; /** *************** *** 61,67 **** --- 61,92 ---- 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); + content.add(addSpace); + + GtkButton rmBtn = new GtkButton( messages.getString("RmIncFilt") ); + rmBtn.signalConnect("clicked", "rmSelected", this); + content.add(rmBtn); setButtons(true, messages.getString("Prev"), true, messages.getString("Next") ); setContent(content); + } + + /** + * Event handler for pressing of 'add' button. + */ + private void addFilter(){ + System.out.println(addTxt.getText()); + } + + /** + * Event handler for pressing of 'remove' button. + */ + private void rmSelected(){ + System.out.println("Remove Selected"); } } |
From: Mark H. <ho...@us...> - 2002-07-17 15:16:28
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv21649 Added Files: Replacer.java Log Message: initial work at code to make the replacements --- NEW FILE: Replacer.java --- /** * Performs replace operations, sending progress reports to the progress page. */ public class Replacer{ /** Root Directory for scanning */ private String rootDir; /** Filters for inclusion. Order Allow, Deny */ private String[] incFilters; /** Exclude filters */ private String[] excFilters; /** Text to be found */ private String findText; /** Text to replace it with */ private String replaceText; /** true if find/replace are supposed to be processed as regular * expressions */ private boolean regExp; } |
From: Mark H. <ho...@us...> - 2002-07-17 15:14:54
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv21108 Modified Files: WelcomePage.java Log Message: added parent screen Index: WelcomePage.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/WelcomePage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WelcomePage.java 13 Jul 2002 14:00:26 -0000 1.3 --- WelcomePage.java 17 Jul 2002 15:14:52 -0000 1.4 *************** *** 16,21 **** * Creates the screen */ ! WelcomePage(ResourceBundle rb, WizardForm parent, String title){ ! super(parent, title, null); messages = rb; --- 16,21 ---- * Creates the screen */ ! WelcomePage(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ ! super(parent, parentScreen, title, null); messages = rb; |
From: Mark H. <ho...@us...> - 2002-07-17 15:13:37
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv20532 Modified Files: IncludeFilters.java Log Message: list work Index: IncludeFilters.java =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/IncludeFilters.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IncludeFilters.java 13 Jul 2002 14:00:26 -0000 1.2 --- IncludeFilters.java 17 Jul 2002 15:13:34 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- import gnu.gtk.*; import gnu.pango.*; + import gnu.glib.*; import java.util.ResourceBundle; *************** *** 13,22 **** private GtkVBox content; /** * Creates the page */ ! IncludeFilters(ResourceBundle rb, WizardForm parent, String title){ ! super(parent, title, null); messages = rb; --- 14,25 ---- private GtkVBox content; + + private GtkListStore filtList; /** * Creates the page */ ! IncludeFilters(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ ! super(parent, parentScreen, title, null); messages = rb; *************** *** 28,31 **** --- 31,64 ---- content.add(headLbl); + GtkLabel curFiltLbl = new GtkLabel( messages.getString("CurIncFilters") ); + content.add(curFiltLbl); + /* + GtkListStore model; + GtkTreeView view; + GtkTreeViewColumn column; + GtkCellRendererText cellRenderer; + + GType[] types = new GType[1]; + types[0] = gnu.glib.GType.STRING(); + // 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 + model.getValue(iter, 0, gval); + // gval.setString("Testing"); + model.setValue(iter, 0, gval); + + + content.add(view); + */ setButtons(true, messages.getString("Prev"), true, messages.getString("Next") ); |
From: Mark H. <ho...@us...> - 2002-07-17 15:13:07
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv20321 Modified Files: InterfaceStr.properties Log Message: added more screens Index: InterfaceStr.properties =================================================================== RCS file: /cvsroot/btrwiz/btrwiz/src/InterfaceStr.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InterfaceStr.properties 13 Jul 2002 11:11:25 -0000 1.1 --- InterfaceStr.properties 17 Jul 2002 15:13:05 -0000 1.2 *************** *** 8,13 **** # Generic Strings # ! Next = Next ! Prev = Previous #' --- 8,13 ---- # Generic Strings # ! Next = _Next ! Prev = _Previous #' *************** *** 19,23 **** \n\nThis is open source software, written in Java and using the Java-GNOME \ Gtk Bindings. If you know anything about java or Gtk programming and would \ ! like to help, please get in contact with us" StartInfo = The following pages will guide you through selecting files to \ search, choosing the text and starting the replacements.\nClick start to begin. --- 19,23 ---- \n\nThis is open source software, written in Java and using the Java-GNOME \ Gtk Bindings. If you know anything about java or Gtk programming and would \ ! like to help, please get in contact with us StartInfo = The following pages will guide you through selecting files to \ search, choosing the text and starting the replacements.\nClick start to begin. *************** *** 43,46 **** --- 43,80 ---- will be given the option to choose filters for files to be explicitely \ excluded from inspection, regardless of the include filters. + CurIncFilters = Current Include Filters: + + # + # Exclude Filters + # + ExcFiltersTitle = Exclude Filters + ExcFilters = The following are exclude filters. If any file matches them, then \ + that file will be explicitely excluded from the search and replace operation. + CurExcFilters = Current Exclude Filters: + + + # + # Find/Replace Page + #' + FindReplaceTitle = Find/Replace Text + FindReplaceHead = Please use the boxes below to define the text to search for \ + and the text to replace it with. Be careful not to leave unwanted new line \ + characters in the text entry boxes. + UsingRegExp = Process as Regular Expressions + FindTxt = Text to find: + ReplaceTxt = Text to replace it with: + StartReplacing = Commence Replacement + FindReplaceWarning = WARNING: The following stage is not reversible. Please \ + make sure you have a backup copy of your work. + # + # Progress Page + # + ProgressTitle = Progress + # + # Summary Page + # + SummaryTitle = Completed + Success = The replace operation has successfully completed. + StartAgain = Start Again |
From: Mark H. <ho...@us...> - 2002-07-17 15:10:52
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv19573 Added Files: SummaryPage.java Log Message: new screen --- NEW FILE: SummaryPage.java --- import com.tildemh.jgwizard.*; import gnu.gdk.*; import gnu.gtk.*; import gnu.pango.*; import java.util.ResourceBundle; /** * the final , summary screen */ class SummaryPage extends WizardPage{ private GtkVBox content; private ResourceBundle messages; private GtkProgressBar replaceProgress ; /* * Creates the screen */ SummaryPage(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); GtkLabel headLbl = new GtkLabel( messages.getString("Success") ); content.add(headLbl); setButtons(false, null, true, messages.getString("StartAgain") ); setContent(content); } } |
From: Mark H. <ho...@us...> - 2002-07-17 15:10:18
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv19426 Added Files: ProgressPage.java Log Message: new screen --- NEW FILE: ProgressPage.java --- import com.tildemh.jgwizard.*; import gnu.gdk.*; import gnu.gtk.*; import gnu.pango.*; import java.util.ResourceBundle; /** * Displayed while the files are being scanned and text is being replaced. */ class ProgressPage extends WizardPage{ private GtkVBox content; private ResourceBundle messages; private GtkProgressBar replaceProgress ; /* * Creates the screen */ ProgressPage(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; content = new GtkVBox(false, 0); GtkFrame stageOneFrame = new GtkFrame(null); GtkLabel fileSearch = new GtkLabel("Determining Folders to Scan"); stageOneFrame.add(fileSearch); content.add(stageOneFrame); GtkFrame stageTwoFrame = new GtkFrame(null); GtkVBox stageTwoBox = new GtkVBox(false, 3); GtkLabel scanning = new GtkLabel("Searching files"); stageTwoBox.add(scanning); GtkLabel processed = new GtkLabel("Files Processed: 5/65"); stageTwoBox.add(processed); GtkLabel curFile = new GtkLabel("Current file: index.cgi"); stageTwoBox.add(curFile); replaceProgress = new GtkProgressBar(); replaceProgress.setFraction(0.34); stageTwoBox.add(replaceProgress); stageTwoFrame.add(stageTwoBox); content.add(stageTwoFrame); stageTwoFrame.setSensitive(false); setButtons(false, null, false, null ); setContent(content); } } |
From: Mark H. <ho...@us...> - 2002-07-17 15:09:31
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv18990 Added Files: FindReplace.java Log Message: new screen --- NEW FILE: FindReplace.java --- import com.tildemh.jgwizard.*; import gnu.gdk.*; import gnu.gtk.*; import gnu.pango.*; import java.util.ResourceBundle; /** * Screen for entering text to be found and replaced. */ class FindReplace extends WizardPage{ private GtkVBox content; private ResourceBundle messages; private GtkTextBuffer findBuffer; private GtkTextBuffer replaceBuffer; private GtkCheckButton usingRegExp; /* * Creates the screen */ FindReplace(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; 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); } } |
From: Mark H. <ho...@us...> - 2002-07-17 15:07:34
|
Update of /cvsroot/btrwiz/btrwiz/src In directory usw-pr-cvs1:/tmp/cvs-serv18365 Added Files: ExcludeFilters.java Log Message: new screen --- NEW FILE: ExcludeFilters.java --- import com.tildemh.jgwizard.*; import gnu.gdk.*; import gnu.gtk.*; import gnu.pango.*; import gnu.glib.*; import java.util.ResourceBundle; /** * The fourth page of the wizard defines filters for files to be excluded from * the scanning. */ class ExcludeFilters extends WizardPage{ private ResourceBundle messages; private GtkVBox content; private GtkListStore filtList; /** * Creates the page */ ExcludeFilters(ResourceBundle rb, WizardForm parent, WizardPage parentScreen, String title){ super(parent, parentScreen, title, null); messages = rb; 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); setButtons(true, messages.getString("Prev"), true, messages.getString("Next") ); setContent(content); } } |