2005/02/21
Hi I'm aki
There are my OpenSource Java codes.(some of them are junk or not implemented)
I'm sorry ,I didn't release internatinal version software yet. one day I'd like to introduce them here.
Thank you for Java2Html. it's very easy and suitable for me.
If you can read Japanese,you can see my software here. Enjoy Java
org.jpn.xucker.audiotowma9
org.jpn.xucker.audiotowma9.AudioToWma9Executer
org.jpn.xucker.audiotowma9.AudioToWma9Wrapper
org.jpn.xucker.commons.audio
org.jpn.xucker.commons.audio.AudioClipAudioPlayer
org.jpn.xucker.commons.audio.AudioStopper
org.jpn.xucker.commons.audio.FileAudioPlayer
org.jpn.xucker.commons.audio.InputStreamAudioPlayer
org.jpn.xucker.commons.audio.JavaSoundAudioPlayer
org.jpn.xucker.commons.audio.ThreadJavaSoundAudioPlayer
org.jpn.xucker.commons.audio.TimerAudioStopper
org.jpn.xucker.commons.audio.word
org.jpn.xucker.commons.audio.word.AbstractWordPlayer
org.jpn.xucker.commons.audio.word.FreeTTSWordPlayer
org.jpn.xucker.commons.audio.word.LocalFileAlphabetDirWordFinder
org.jpn.xucker.commons.audio.word.LocalFilePlainWordFinder
org.jpn.xucker.commons.audio.word.LocalFilePlainWordPlayer
org.jpn.xucker.commons.audio.word.LocalFileWordFinder
org.jpn.xucker.commons.audio.word.LocalFileWordPlayer
org.jpn.xucker.commons.audio.word.MutchWordPlaySystem
org.jpn.xucker.commons.audio.word.WordPlayer
org.jpn.xucker.commons.audio.word.WordPlaySystem
org.jpn.xucker.commons.audio.word.ZipFileWordPlayer
org.jpn.xucker.commons.google
org.jpn.xucker.commons.google.Channel
org.jpn.xucker.commons.google.GoogleAdSenseChannelParser
org.jpn.xucker.commons.io
org.jpn.xucker.commons.io.LineSeparatorChangeInputStream
org.jpn.xucker.commons.io.LineSeparatorCountInputStream
org.jpn.xucker.commons.io.WordCountInputStream
org.jpn.xucker.commons.ipod
org.jpn.xucker.commons.ipod.DoubleLineTextPopper
org.jpn.xucker.commons.ipod.MenuMaker
org.jpn.xucker.commons.ipod.PrevNextMenu
org.jpn.xucker.commons.ipod.SrtConverter
org.jpn.xucker.commons.ipod.TextConverter
org.jpn.xucker.commons.ipod.TextConvertTest
org.jpn.xucker.commons.ipod.TextPopper
org.jpn.xucker.commons.ipod.TextUtil
org.jpn.xucker.commons.property
org.jpn.xucker.commons.property.StatusChangeListener
org.jpn.xucker.commons.property.StatusChangeMonitor
org.jpn.xucker.commons.swt.series
org.jpn.xucker.commons.swt.series.FileListTypeMenu
org.jpn.xucker.commons.swt.series.PropertyMenuListener
org.jpn.xucker.commons.swt.series.ResultData
org.jpn.xucker.commons.swt.series.ResultDialog
org.jpn.xucker.commons.swt.series.fls
org.jpn.xucker.commons.swt.series.fls.FileListStandard
org.jpn.xucker.commons.swt.series.fls.Sample
org.jpn.xucker.commons.swt.series.wfs
org.jpn.xucker.commons.swt.series.wfs.WrapperExecuter
org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard
org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandardSettingDialog
org.jpn.xucker.commons.swt.ui
org.jpn.xucker.commons.swt.ui.CopyTable
org.jpn.xucker.commons.swt.ui.FileDirChoicer
org.jpn.xucker.commons.swt.ui.FileListImage
org.jpn.xucker.commons.swt.ui.FileListImageStatusChangeListener
org.jpn.xucker.commons.swt.ui.FileListTable
org.jpn.xucker.commons.swt.ui.FileStatusChangeEvent
org.jpn.xucker.commons.swt.ui.FileStatusChangeListener
org.jpn.xucker.commons.swt.ui.FileStatusChanger
org.jpn.xucker.commons.swt.ui.GroupCheckTreeContoler
org.jpn.xucker.commons.swt.ui.ImageCanvas
org.jpn.xucker.commons.swt.ui.MenuItemContainer
org.jpn.xucker.commons.swt.ui.MenuItemContainerImp
org.jpn.xucker.commons.swt.ui.OkCancelDialog
org.jpn.xucker.commons.swt.ui.OkCancelDialogListener
org.jpn.xucker.commons.swt.ui.SWTBasicFileApplication
org.jpn.xucker.commons.swt.ui.SWTFileNoFoundtAction
org.jpn.xucker.commons.swt.ui.SWTStatusChangedMonitor
org.jpn.xucker.commons.swt.ui.tree
org.jpn.xucker.commons.swt.ui.tree.TreeBuilder
org.jpn.xucker.commons.swt.ui.tree.TreeObject
org.jpn.xucker.commons.undo
org.jpn.xucker.commons.undo.AbstractCommand
org.jpn.xucker.commons.undo.Addable
org.jpn.xucker.commons.undo.AddCommand
org.jpn.xucker.commons.undo.Command
org.jpn.xucker.commons.undo.CommandControl
org.jpn.xucker.commons.undo.Deletable
org.jpn.xucker.commons.undo.DeleteCommand
org.jpn.xucker.commons.undo.UndoCommand
org.jpn.xucker.commons.util
org.jpn.xucker.commons.util.AbstractBasicFileApplication
org.jpn.xucker.commons.util.ApplicationProperties
org.jpn.xucker.commons.util.ApplicationUtil
org.jpn.xucker.commons.util.ClipboardUtil
org.jpn.xucker.commons.util.FileNotFoundAction
org.jpn.xucker.commons.util.FileProperties
org.jpn.xucker.commons.util.IOClassLoader
org.jpn.xucker.commons.util.TagUtil
org.jpn.xucker.commons.util.WildCard
org.jpn.xucker.commons.util._FilePreference
org.jpn.xucker.dualsubmit
org.jpn.xucker.dualsubmit.ClipboardTextListener
org.jpn.xucker.dualsubmit.ClipboardTextMonitor
org.jpn.xucker.dualsubmit.ClipboardTextMonitorImp
org.jpn.xucker.dualsubmit.DefaultApplication
org.jpn.xucker.dualsubmit.DualSubmit
org.jpn.xucker.dualsubmit.DualSubmitBrowser
org.jpn.xucker.dualsubmit.DualSubmitBrowserImp
org.jpn.xucker.dualsubmit.DualSubmitMenu
org.jpn.xucker.dualsubmit.DualSubmitMenuImp
org.jpn.xucker.dualsubmit.DualSubmitPlugin
org.jpn.xucker.dualsubmit.DualSubmitPluginImp
org.jpn.xucker.dualsubmit.DualSubmitPluginLoader
org.jpn.xucker.dualsubmit.DualSubmitPluginLoaderImp
org.jpn.xucker.dualsubmit.DualSubmitPreference
org.jpn.xucker.dualsubmit.LoopControler
org.jpn.xucker.dualsubmit.SimpleWindowCloser
org.jpn.xucker.dualsubmit.StringValidator
org.jpn.xucker.dualsubmit.validator
org.jpn.xucker.dualsubmit.validator.AlphabetAndHyphenValidator
org.jpn.xucker.dualsubmit.validator.AlphabetValidator
org.jpn.xucker.dualsubmit.validator.AndValidator
org.jpn.xucker.dualsubmit.validator.NoLineSeparatorValidator
org.jpn.xucker.dualsubmit.validator.NotValidator
org.jpn.xucker.dualsubmit.validator.NoWhiteSpaceValidator
org.jpn.xucker.dualsubmit.validator.OrValidator
org.jpn.xucker.english
org.jpn.xucker.english.Util
org.jpn.xucker.findsame
org.jpn.xucker.findsame.CompositeList
org.jpn.xucker.findsame.CompositeListItem
org.jpn.xucker.findsame.CompositePixelList
org.jpn.xucker.findsame.Error
org.jpn.xucker.findsame.FileUtil
org.jpn.xucker.findsame.FindSameEachOtherMain
org.jpn.xucker.findsame.FindSameFileMain
org.jpn.xucker.findsame.FindSameFolderMain
org.jpn.xucker.findsame.MD5Util
org.jpn.xucker.findsame.Result
org.jpn.xucker.findsame.ResultList
org.jpn.xucker.freemind
org.jpn.xucker.freemind.FreeMindUtils
org.jpn.xucker.freemind.Map
org.jpn.xucker.freemind.Node
org.jpn.xucker.imagemarker
org.jpn.xucker.imagemarker.GUIProperties
org.jpn.xucker.imagemarker.ImageMarker
org.jpn.xucker.linkcheck
org.jpn.xucker.linkcheck.LinkChecker
org.jpn.xucker.mp3
org.jpn.xucker.mp3.MP3JavaSoundAudioPlayer
org.jpn.xucker.optipngwrapper
org.jpn.xucker.optipngwrapper.OptiPNGExecuter
org.jpn.xucker.optipngwrapper.OptiPngWrap
org.jpn.xucker.optipngwrapper.ResultData
org.jpn.xucker.optipngwrapper.ResultDialog
org.jpn.xucker.phonixSplit
org.jpn.xucker.phonixSplit.PhonixSplit
org.jpn.xucker.phonixSplit.PhonixSplitCanvas
org.jpn.xucker.phonixSplit.QuestionControl
org.jpn.xucker.phonixSplit.QuestionFolder
org.jpn.xucker.playdict
org.jpn.xucker.playdict.DictPreference
org.jpn.xucker.playdict.PlayDictMain
org.jpn.xucker.playdict.SoundWord
org.jpn.xucker.repeatrecorder
org.jpn.xucker.repeatrecorder.ControledObject
org.jpn.xucker.repeatrecorder.RepeatRecorder
org.jpn.xucker.repeatrecorder.RepeatRecorderMenu
org.jpn.xucker.returncode
org.jpn.xucker.returncode.ReturnCodeChecker
org.jpn.xucker.returncode.ReturnCodeMain
org.jpn.xucker.rssCreator
org.jpn.xucker.rssCreator.main
org.jpn.xucker.snacksoundtoolkit
org.jpn.xucker.snacksoundtoolkit.ESPS
org.jpn.xucker.snacksoundtoolkit.ESPSParser
org.jpn.xucker.snacksoundtoolkit.PitchCanvas
org.jpn.xucker.srtipod
org.jpn.xucker.srtipod.main
org.jpn.xucker.srtipod.SrtIPodMain
org.jpn.xucker.subconverter
org.jpn.xucker.subconverter.SubConverter
org.jpn.xucker.subplayer
org.jpn.xucker.subplayer.ImageCanvas
org.jpn.xucker.subplayer.Mark
org.jpn.xucker.subplayer.MarkControler
org.jpn.xucker.subplayer.SubMainMenu
org.jpn.xucker.subplayer.SubPlayFileUpdater
org.jpn.xucker.subplayer.SubPlayFileXmlDialog
org.jpn.xucker.subplayer.SubPlayFileXmlObject
org.jpn.xucker.subplayer.SubPlayMain
org.jpn.xucker.subplayer.SubPlayPreferenceXmlObject
org.jpn.xucker.subtitle
org.jpn.xucker.subtitle.StandardSubObject
org.jpn.xucker.subtitle.SubUtils
org.jpn.xucker.subtitle.spumux
org.jpn.xucker.subtitle.spumux.Action
org.jpn.xucker.subtitle.spumux.Button
org.jpn.xucker.subtitle.spumux.Spu
org.jpn.xucker.subtitle.spumux.Spumux
org.jpn.xucker.subtitle.spumux.SpumuxParser
org.jpn.xucker.subtitle.spumux.Textsub
org.jpn.xucker.subtitle.srt
org.jpn.xucker.subtitle.srt.SRTList
org.jpn.xucker.subtitle.srt.SRTObject
org.jpn.xucker.subtitle.srt.SRTParser
org.jpn.xucker.subtitle.srt.TimeData
org.jpn.xucker.subtitle.sub
org.jpn.xucker.subtitle.sub.SUBList
org.jpn.xucker.subtitle.sub.SUBObject
org.jpn.xucker.subtitle.sub.SUBParser
org.jpn.xucker.subtitle.sub.TextObject
org.jpn.xucker.subtitle.sub2
org.jpn.xucker.subtitle.sub2.CommentObject
org.jpn.xucker.subtitle.sub2.SUBObject
org.jpn.xucker.subtitle.sub2.SUBParser
org.jpn.xucker.tab2tree
org.jpn.xucker.tab2tree.Main
org.jpn.xucker.tab2tree.StringTreeUtils
org.jpn.xucker.taiyaku
org.jpn.xucker.taiyaku.TaiyakuData
org.jpn.xucker.taiyaku.TaiyakuParser
org.jpn.xucker.treetext
org.jpn.xucker.treetext.main
org.jpn.xucker.treetext.TreeText
org.jpn.xucker.wavconvert
org.jpn.xucker.wavconvert.AudioFormat
org.jpn.xucker.wavconvert.SoxExecuter
org.jpn.xucker.wavconvert.SoxWrapper
org.jpn.xucker.wmatopcm
org.jpn.xucker.wmatopcm.WmaToPcmExecuter
org.jpn.xucker.wmatopcm.WmaToPcmWrapper
org.jpn.xucker.wordcounter
org.jpn.xucker.wordcounter.WordCountData
org.jpn.xucker.wordcounter.WordCountMain
org.jpn.xucker.wordcounter.WordCountMenu
org.jpn.xucker.xs.aegis
org.jpn.xucker.xs.aegis.Action
org.jpn.xucker.xs.aegis.Block
org.jpn.xucker.xs.aegis.Domain
org.jpn.xucker.xs.aegis.Query
org.jpn.xucker.xs.aegis.QueryList

LinkChecker.java
/*
 * Created on 2004/08/15
 * Author aki@www.xucker.jpn.org
 * License Apache2.0 or Common Public License
 */
package org.jpn.xucker.linkcheck;

import java.io.File;
import java.util.Arrays;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.jpn.xucker.commons.swt.series.ResultData;
import org.jpn.xucker.commons.swt.series.fls.FileListStandard;
import org.jpn.xucker.commons.swt.ui.FileDirChoicer;
import org.jpn.xucker.commons.swt.ui.FileStatusChangeEvent;
import org.jpn.xucker.commons.swt.ui.FileStatusChangeListener;
import org.jpn.xucker.commons.util.ApplicationUtil;
import org.jpn.xucker.commons.util.FileProperties;
import org.jpn.xucker.html.HtmlError;
import org.jpn.xucker.html.HtmlTester;

/**
 
 *  
 */
public class LinkChecker extends FileListStandard implements
        FileStatusChangeListener {

    /**
     @param shell
     */
    Button showNormalHtmlCheckButton;

    private Button absoluteCheckButton;

    private Button relativeCheckButton;

    private Button htmlCheckButton;

    private Button imageCheckButton;

    private Button otherCheckButton;

    private Button upperCheckButton;
    private Text ignoreText;

    private FileDirChoicer absoluteDirChoicer;

    private static final String FILE_LIST = "FILE_LIST";

    private static final String SHOW_NORMAL_HTML = "SHOW_NORMAL_HTML";

    private static final String SEARCH_ABSOLUTE_PATH = "SEARCH_ABSOLUTE_PATH";

    private static final String SEARCH_RELATIVE_PATH = "SEARCH_RELATIVE_PATH";

    private static final String ABSOLUTE_DIR = "ABSOLUTE_DIR";

    private static final String SEARCH_HTML_FILE = "SEARCH_HTML_FILE";

    private static final String SEARCH_IMAGE_FILE = "SEARCH_IMAGE_FILE";

    private static final String SEARCH_OTHER_FILE = "SEARCH_OTHER_FILE";

    private static final String OTHER_FILE = "OTHER_FILE";

    private boolean isInit;

    private FileProperties filePreference;

    private HtmlTester tester;

    private static final String SEARCH_UPPER_PATH="SEARCH_UPPER_PATH";

    public LinkChecker(Shell shell) {
        super(shell);
        // TODO Auto-generated constructor stub
        HtmlTester tester = new HtmlTester();
    }

    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display, SWT.CLOSE | SWT.MIN);

        try {
            LinkChecker main = new LinkChecker(shell);

            shell.open();

            while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) {
                    display.sleep();
                }
            }
            display.dispose();
        catch (Exception e) {
            e.printStackTrace();
        finally {
            if (!shell.isDisposed()) {
                shell.close();
            }

            display.dispose();
            //System.exit(0);
        }

    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.series.fls.FileListStandard#afterConstract()
     */
    protected void afterConstract() {
        // TODO Auto-generated method stub
        isInit = true;
    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.series.fls.FileListStandard#beforeConstract()
     */
    protected void beforeConstract() {
        // TODO Auto-generated method stub
        resultColumnText = new String[] { "結果""URL""ファイルパス" };
        resultColumnWidth = new int[] { 230120130 };

        HOMEPAGE_URL = "http://www.xucker.jpn.org/product/linkcheck.html";
        APP_NAME = "LinkChecker";
        ICON_RESOURCE = "org/jpn/xucker/linkcheck/resource/icon.png";
        EXEC_LABEL = "調べる";
        version = 0.2;
    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.series.fls.FileListStandard#execFile(java.io.File)
     */

    public void beforeExecute() {
        tester = new HtmlTester();
       // tester.setDebug(true);
        tester.setTestAbsolutePath(absoluteCheckButton.getSelection());
        tester.setTestHtmlFile(htmlCheckButton.getSelection());
        tester.setTestImageFile(imageCheckButton.getSelection());
        tester.setTestOtherFile(otherCheckButton.getSelection());
        tester.setTestRelativePath(relativeCheckButton.getSelection());
        tester.setTestUpperPath(upperCheckButton.getSelection());
        if (absoluteCheckButton.getSelection()
                && absoluteDirChoicer.getFile() != null) {
            tester.setRootDir(absoluteDirChoicer.getFile().getAbsolutePath());
        }
    }

    public void execFile(File file) {
        /*
        if (!absoluteCheckButton.getSelection()
                || absoluteDirChoicer.getFile() == null) {
            //System.out.println("file select");
            tester.setRootDir(file.getParent());
        }*/
        tester.doCheck(file);
    }

    public void afterExecute() {
        System.out.println("afterExecute");
        HtmlError error[] = tester.getErrors();
        for (int i = 0; i < error.length; i++) {
            ResultData data = new ResultData();
            File file = new File(error[i].getRootDir(), error[i].getBaseHref());
            data.setValue(resultColumnText[0]"ファイルがありません:"
                    + error[i].getLinkHref());
            data.setValue(resultColumnText[1], error[i].getBaseHref());
            data.setColor(new Color(shell.getDisplay()25500));

            data.setValue(resultColumnText[2], file.getAbsolutePath());
            addResult(data);
        }

        if (showNormalHtmlCheckButton.getSelection()) {
            String checkpaths[] = tester.getCheckedFiles();
            Arrays.sort(checkpaths);
            for (int i = 0; i < checkpaths.length; i++) {
                ResultData data = new ResultData();

                String url = checkpaths[i].substring(tester.getRootDir()
                        .length());
                url = url.replaceAll("\\\\""/");
                data.setValue(resultColumnText[1], url);
                data.setValue(resultColumnText[2], checkpaths[i]);
                data.setColor(new Color(shell.getDisplay()00255));
                addResult(data);
            }
        }
        System.out.println("error");

        if (error.length == 0) {
            MessageBox box = new MessageBox(shell, SWT.OK
                    | SWT.ICON_INFORMATION);
            box.setMessage("エラーはありませんでした");

            //int result=box.open();
            //never use result int,for PMD
            box.open();
        }
    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.series.fls.FileListStandard#createOptionUI(org.eclipse.swt.widgets.Group)
     */
    protected void createOptionUI(Group optionGroup) {
        shell.setSize(500510);
        fileListTableRowData.height = 70;
        fileListTable.addFileListChangeListener(this);
        fileListTable.setFileExtension(new String[] { "html""htm""shtml" });
        optionGroup.setText("");
        RowData data = new RowData();
        data.width = 480;
        optionGroup.setLayoutData(data);

        createOptionLabel(optionGroup, "結果");

        showNormalHtmlCheckButton = new Button(optionGroup, SWT.CHECK);
        showNormalHtmlCheckButton.addSelectionListener(this);
        showNormalHtmlCheckButton.setText("調べたファイルのURLも表示する");

        showNormalHtmlCheckButton.setSelection(true);//default
        RowData data2 = new RowData();
        data2.width = 450;
        showNormalHtmlCheckButton.setLayoutData(data2);

        createOptionLabel(optionGroup, "調べるパス");
        absoluteCheckButton = new Button(optionGroup, SWT.CHECK);
        absoluteCheckButton.addSelectionListener(this);
        absoluteCheckButton.setText("絶対パスを調べる (ルートDir)");
        absoluteDirChoicer = new FileDirChoicer(optionGroup, SWT.NULL,
                FileDirChoicer.DIR, null,true);
        absoluteDirChoicer.setPathWidth(150);
        absoluteDirChoicer.addFileListChangeListener(this);
        absoluteCheckButton
        .setToolTipText("ただしhttp://などから始まる外部パスは調べません。/から始まるパスを調べます");
        //add
        relativeCheckButton = new Button(optionGroup, SWT.CHECK);
        relativeCheckButton.addSelectionListener(this);
        relativeCheckButton.setText("相対パスを調べる");
        relativeCheckButton.setSelection(true);//default
        
        upperCheckButton=new Button(optionGroup,SWT.CHECK);
        upperCheckButton.addSelectionListener(this);
        upperCheckButton.setText("上の階層も調べる");
        upperCheckButton.setSelection(true);//default

        createOptionLabel(optionGroup, "調べるファイル形式");
        htmlCheckButton = new Button(optionGroup, SWT.CHECK);
        htmlCheckButton.addSelectionListener(this);
        htmlCheckButton.setText("htmlを調べる(html/htm/shtml)");
        htmlCheckButton.setSelection(true);//default
        imageCheckButton = new Button(optionGroup, SWT.CHECK);
        imageCheckButton.addSelectionListener(this);
        imageCheckButton.setText("画像を調べる(gif/png/jpg/jpeg)");
        imageCheckButton.setSelection(true);//default
        otherCheckButton = new Button(optionGroup, SWT.CHECK);
        otherCheckButton.addSelectionListener(this);
        otherCheckButton.setText("その他のファイルも調べる");
        otherCheckButton.setSelection(true);//default
        Label l3 = new Label(optionGroup, SWT.NULL);
        l3.setText("■無視するファイル拡張子");
        ignoreText = new Text(optionGroup, SWT.READ_ONLY);

        ignoreText.setText("(cgi php jsp)");

        RowData data3 = new RowData();
        data3.width = 200;
        ignoreText.setLayoutData(data3);

        loadPreference();

        statusChanged();

    }

    /**
     *  
     */
    private void loadPreference() {
        File filePath = ApplicationUtil.searchFileAroundClass("linkcheck.exe");
        if (filePath != null) {
            filePreference = new FileProperties(new File(filePath.getParent(),
                    "linkcheck.properties"));
            if (filePreference != null && filePreference.avaiable()) {
                setSetting();
            }
        }
    }

    /**
     @param filePreference
     */
    private void setSetting() {
        showNormalHtmlCheckButton.setSelection(filePreference
                .getBoolean(SHOW_NORMAL_HTML));
        this.absoluteCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_ABSOLUTE_PATH));
        this.relativeCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_RELATIVE_PATH));
        this.upperCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_UPPER_PATH));
        fileListTable.setFileListText(filePreference.get(FILE_LIST, ""));
        String path = filePreference.get(ABSOLUTE_DIR);
        if (path != null && !path.equals("")) {
            File file = new File(path);
            absoluteDirChoicer.setFile(file);
        }

        htmlCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_HTML_FILE));
        imageCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_IMAGE_FILE));
        otherCheckButton.setSelection(filePreference
                .getBoolean(SEARCH_OTHER_FILE));
        //this version not support;
        //ignoreText.setText(filePreference.get(OTHER_FILE,""));

    }

    /**
     @param optionGroup
     @param string
     */
    private void createOptionLabel(Group optionGroup, String label) {
        Label label1 = new Label(optionGroup, SWT.NULL);
        label1.setText("【 " + label + " 】");
        // label1.setForeground(new
        // Color(label1.getShell().getDisplay(),64,64,64));
        RowData data1 = new RowData();
        data1.width = 450;
        label1.setLayoutData(data1);
    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.ui.FileListChangeListener#removeList(org.jpn.xucker.commons.swt.ui.FileListChangeEvent)
     */
    public void removeList(FileStatusChangeEvent event) {
        // TODO Auto-generated method stub
        propertyUpdate();
    }

    /*
     * (non-Javadoc)
     
     * @see org.jpn.xucker.commons.swt.ui.FileListChangeListener#addList(org.jpn.xucker.commons.swt.ui.FileListChangeEvent)
     */
    public void addList(FileStatusChangeEvent event) {
        // TODO Auto-generated method stub
        propertyUpdate();
    }

    protected void otherWidgetSelected(SelectionEvent event) {
        // if it's needed,you should overwrite
        propertyUpdate();
    }

    /**
     *  
     */
    private synchronized void propertyUpdate() {
        // TODO Auto-generated method stub
        if (!isInit) {
            return;
        }
        if (filePreference != null) {

            filePreference.set(FILE_LIST, fileListTable.getFileListText());
            filePreference.setBoolean(SHOW_NORMAL_HTML,
                    showNormalHtmlCheckButton.getSelection());
            filePreference.setBoolean(SEARCH_ABSOLUTE_PATH, absoluteCheckButton
                    .getSelection());

            String path = "";
            if (absoluteDirChoicer.getFile() != null) {
                path = absoluteDirChoicer.getFile().getAbsolutePath();
                
            }
            filePreference.set(ABSOLUTE_DIR, path);

            filePreference.setBoolean(SEARCH_RELATIVE_PATH, relativeCheckButton
                    .getSelection());
            
            filePreference.setBoolean(SEARCH_UPPER_PATH, upperCheckButton
                    .getSelection());
            filePreference.setBoolean(SEARCH_HTML_FILE, htmlCheckButton
                    .getSelection());
            filePreference.setBoolean(SEARCH_IMAGE_FILE, imageCheckButton
                    .getSelection());
            filePreference.setBoolean(SEARCH_OTHER_FILE, otherCheckButton
                    .getSelection());
            filePreference.save();
        }
        statusChanged();
    }

    /**
     *  
     */
    private void statusChanged() {
        if (!absoluteCheckButton.getSelection()) {
            absoluteDirChoicer.setEnabled(false);
        else {
            absoluteDirChoicer.setEnabled(true);
        }
        
        //set exec button enable.
        if(absoluteCheckButton!=null && absoluteDirChoicer!=null && execButton!=null){
        if(absoluteCheckButton.getSelection() && absoluteDirChoicer.getFile()==null){
            execButton.setEnabled(false);
        }else{
            if(fileListTable.getFiles().length==0){
                execButton.setEnabled(false);
            }else{
                execButton.setEnabled(true);
            }
           
        }
        }
    }
}