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

Main.java
/*
 * Created on 2004/07/03 Author aki@www.xucker.jpn.org License Apache2.0 or
 * Common Public License
 */
package org.jpn.xucker.tab2tree;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

import org.apache.commons.io.FileUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.jpn.xucker.commons.property.StatusChangeListener;
import org.jpn.xucker.commons.property.StatusChangeMonitor;
import org.jpn.xucker.commons.swt.ui.SWTBasicFileApplication;
import org.jpn.xucker.commons.swt.ui.SWTStatusChangedMonitor;
import org.jpn.xucker.commons.util.ApplicationProperties;
import org.jpn.xucker.commons.util.ApplicationUtil;
import org.jpn.xucker.commons.util.FileProperties;
import org.jpn.xucker.freemind.FreeMindUtils;
import org.jpn.xucker.freemind.Map;
import org.jpn.xucker.tree.StringTree;
import org.jpn.xucker.tree.StringTreeBuilder;
import org.jpn.xucker.tree.view.TabToTreeView;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.Parameter;
import org.picocontainer.defaults.ConstantParameter;
import org.picocontainer.defaults.DefaultPicoContainer;

public class Main extends SWTBasicFileApplication implements SelectionListener, ModifyListener, ShellListener,StatusChangeListener {
    private float version = (float0.5;

  

   

  



    private Properties properties;

    private Combo splitWordText;

    private Button isParseLinkButton;

    private static final String FileEncoding = System
            .getProperty("file.encoding");

  

    StatusChangeMonitor statusChangeMonitor;
    public static void main(String[] args) {
        Display display=null;
        try{
         display= new Display();
        Shell shell = new Shell(display);
        Image t2tImage = new Image(display, Main.class.getClassLoader()
                .getResourceAsStream("org/jpn/xucker/tab2tree/resource/t2t.png"));
        shell.setImage(t2tImage);
        //main not use.
        Main main = new Main(shell);
        main.init();
        shell.open();

        if (args.length > 0) {
            main.readText(new File(args[0]));
        }

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

    private Text textText;

    private Text treeText;

    private TabFolder tab;

    private Combo list;

    private String appName="Tab2Tree テキスト";



    private String LINE_SEPARATOR="lineSeparator";
private String ISLINK="isLink";


    private String SPLIT_WORD="splitWord";



    private Button updateButton;
    /**
     @param shell
     */
    
    private static String EXE_NAME="tab2tree.exe";



    private MutablePicoContainer picoContainer;



    private ApplicationProperties applicationProperties;
    
    public Main(Shell shell) {
        this.shell = shell;
    }
    public void init(){
        picoContainer = loadContainer();
        loadProperties();
        
        
        this.setFileExtension("txt");
        shell.addShellListener(this);
        
        
        
        updateTitle();
        Rectangle rect = Display.getCurrent().getPrimaryMonitor().getBounds();
        int w = 400;
        int h = 400;

        Menu menuBar = new Menu(shell, SWT.BAR);

        shell.setMenuBar(menuBar);

        MenuItem mitem = new MenuItem(menuBar, SWT.CASCADE);

        Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
        mitem.setText("ファイル");
        mitem.setMenu(fileMenu);

        MenuItem newItem = new MenuItem(fileMenu, SWT.PUSH);
        newItem.setText("新規");
        newItem.addSelectionListener(this);

        MenuItem openItem = new MenuItem(fileMenu, SWT.PUSH);
        openItem.setText("開く");
        openItem.addSelectionListener(this);

        MenuItem saveItem = new MenuItem(fileMenu, SWT.PUSH);
        saveItem.setText("保存");
        saveItem.addSelectionListener(this);

        MenuItem saveAsItem = new MenuItem(fileMenu, SWT.PUSH);
        saveAsItem.setText("別名で保存");
        saveAsItem.addSelectionListener(this);

        MenuItem sepalator = new MenuItem(fileMenu, SWT.SEPARATOR);
        sepalator.getData();//for PMD

        MenuItem exitItem = new MenuItem(fileMenu, SWT.PUSH);
        exitItem.setText("終了");
        exitItem.addSelectionListener(this);

        MenuItem mitem2 = new MenuItem(menuBar, SWT.CASCADE);
        Menu treeMenu = new Menu(shell, SWT.DROP_DOWN);
        mitem2.setText("ツリー");
        mitem2.setMenu(treeMenu);

        MenuItem copyItem = new MenuItem(treeMenu, SWT.PUSH);
        copyItem.setText("クリップボードへコピー");
        copyItem.addSelectionListener(this);
        MenuItem tmpItem = new MenuItem(treeMenu, SWT.SEPARATOR);
        tmpItem.getEnabled();
        
        MenuItem writeFileItem = new MenuItem(treeMenu, SWT.PUSH);
        writeFileItem.setText("ファイルへ保存");
        writeFileItem.addSelectionListener(this);
        
        MenuItem freemindFileItem = new MenuItem(treeMenu, SWT.PUSH);
        freemindFileItem.setText("FreeMind 形式で出力");
        freemindFileItem.addSelectionListener(this);

        MenuItem mitem3 = new MenuItem(menuBar, SWT.CASCADE);
        Menu helpMenu = new Menu(shell, SWT.DROP_DOWN);
        mitem3.setText("ヘルプ");
        mitem3.setMenu(helpMenu);

        MenuItem versionItem = new MenuItem(helpMenu, SWT.PUSH);
        versionItem.setText("バージョン情報");
        versionItem.addSelectionListener(this);

        shell.setLayout(new FillLayout());
        shell.setBounds((rect.width - w2(rect.height - h2, w, h);
        tab = new TabFolder(shell, SWT.NULL);
        tab.addSelectionListener(this);
        TabItem textItem = new TabItem(tab, SWT.NULL);
        textItem.setToolTipText("ここにテキストをTabで段落をつけて入力します。\r\nそしてツリーTextタブに切り替えます。");
        textItem.setText("テキスト");

        textItem.setImage(new Image(Display.getCurrent(), Main.class
                .getClassLoader().getResourceAsStream(
                        "org/jpn/xucker/tab2tree/resource/abc.png")));

        textText = new Text(tab, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
        textText.addModifyListener(this);
        textItem.setControl(textText);

        TabItem tabItem = new TabItem(tab, SWT.MULTI);
        
        StringBuffer tabItem_tooltip=new StringBuffer();
        tabItem_tooltip.append("ここにはテキストタブで入力したテキストがツリー形式に変換されたものが出力されます。"+System.getProperty("line.separator"));
        tabItem_tooltip.append("改行を変更するには設定タブで"+System.getProperty("line.separator"));
        tabItem_tooltip.append(""+System.getProperty("line.separator"));
        tabItem_tooltip.append("HTMLのリンク形式にするにはデフォルトですと,で区切った文字をテキストタブに入力します。"+System.getProperty("line.separator"));
        tabItem.setToolTipText(tabItem_tooltip.toString());

        tabItem.setText("ツリーText");
        tabItem.setImage(new Image(Display.getCurrent(), Main.class
                .getClassLoader().getResourceAsStream(
                        "org/jpn/xucker/tab2tree/resource/tree.png")));

        treeText = new Text(tab, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);

        tabItem.setControl(treeText);

        TabItem settingItem = new TabItem(tab, SWT.MULTI);
        StringBuffer text=new StringBuffer();
        text.append("ここで設定内容を変更します。"+System.getProperty("line.separator"));
        text.append("変更できる内容は、"+System.getProperty("line.separator"));
        text.append("■linkを作成するか"+System.getProperty("line.separator"));
        text.append("■link作成時の分割文字"+System.getProperty("line.separator"));
        text.append("■クリップボードへコピーやファイル出力時の改行コード"+System.getProperty("line.separator"));
        text.append("です。"+System.getProperty("line.separator"));
        settingItem.setToolTipText(text.toString());
        settingItem.setText("設定");
        settingItem.setImage(new Image(Display.getCurrent(), Main.class
                .getClassLoader().getResourceAsStream(
                        "org/jpn/xucker/tab2tree/resource/set.png")));

        Composite panel = new Composite(tab, SWT.NONE);
        //panel.setBackground(new Color(Display.getCurrent(),255,255,0));

        panel.setLayout(new GridLayout(2true));
        isParseLinkButton = new Button(panel, SWT.CHECK);
        
        GridData gdata1 = new GridData();
        gdata1.horizontalSpan = 2;
        isParseLinkButton.setLayoutData(gdata1);

        isParseLinkButton.setText("link作成");
        //isParseLinkButton.addSelectionListener(this);
        settingItem.setControl(panel);

        //Composite splitPanel=new Composite(panel,SWT.NULL);
        //splitPanel.setLayout(new FillLayout(SWT.HORIZONTAL));
        Label splitLabel = new Label(panel, SWT.NULL);
        splitLabel.setText("分割文字");
        splitWordText = new Combo(panel, SWT.BORDER);
        splitWordText.add(",");
        //splitWordText.addModifyListener(this);
        
        GridData gdata2 = new GridData();
        gdata2.horizontalAlignment = GridData.FILL;
        splitWordText.setLayoutData(gdata2);

        Label returnLabel = new Label(panel, SWT.NULL);
        returnLabel.setText("改行");

        list = new Combo(panel, SWT.READ_ONLY);
        
        list.add("OS デフォルト ");
        list.add("Unix(\\n)");
        list.add("Win(\\r\\n)");
        list.add("Mac(\\r)");
        
        //list.addSelectionListener(this);

        
        
        updateButton = new Button(panel,SWT.NULL);
        updateButton.setText("更新");
        //updateButton.addSelectionListener(this);
        
        
        
        
        statusChangeMonitor=(StatusChangeMonitorpicoContainer.getComponentInstanceOfType(StatusChangeMonitor.class);
        statusChangeMonitor.addSelectableItem(list);
        statusChangeMonitor.addSelectableItem(isParseLinkButton);
        //statusChangeMonitor.addSelectableItem(splitWordText);
        statusChangeMonitor.addModifiableItem(splitWordText);
        
        statusChangeMonitor.addUpdateControlItem(updateButton);
        statusChangeMonitor.addEnableControlItem(updateButton);
        statusChangeMonitor.setStatusChangeListener(this);
        statusChangeMonitor.setChanged(false);
    }
  
    public void updateUi(){
        if(isParseLinkButton!=null && splitWordText!=null && list!=null){
        if (applicationProperties.getBoolean(ISLINK)) {
            isParseLinkButton.setSelection(true);
        }else{
            isParseLinkButton.setSelection(false);
        }
        
        splitWordText.setText(applicationProperties.get(SPLIT_WORD));
        
        if (applicationProperties.get(LINE_SEPARATOR).equals("n")) {
            list.select(1);
        else if (applicationProperties.get(LINE_SEPARATOR).equals("rn")) {
            list.select(2);
        else if (applicationProperties.get(LINE_SEPARATOR).equals("r")) {
            list.select(3);
        else {
            list.select(0);
        }
        
        statusChangeMonitor.setChanged(false);
        }
    }

    public String getLineSeparator() {
        if (list.getSelectionIndex() == 1) {
            return "\n";
        else if (list.getSelectionIndex() == 2) {
            return "\r\n";
        else if (list.getSelectionIndex() == 3) {
            return "\r";
        else {
            return System.getProperty("line.separator");
        }
    }


    public MutablePicoContainer loadContainer(){
        
        MutablePicoContainer container=new DefaultPicoContainer();
        File propertyFile=new File(ApplicationUtil.searchFileAroundClass(EXE_NAME).getParent(),"tab2tree.priperties");
        
        container.registerComponentImplementation(FileProperties.class,FileProperties.class,new Parameter[]{new ConstantParameter(propertyFile)});
        
        
        container.registerComponentImplementation(SWTStatusChangedMonitor.class);
        
        return container;
    }
    /**
     *  
     */
    private void loadProperties() {
        applicationProperties = (ApplicationProperties)picoContainer.getComponentInstanceOfType(ApplicationProperties.class);
        
        String defaultSplitWord=",";
        boolean defaultIsLink=true;
        String defaultLineSeparator="os";
//      init
        applicationProperties.set(SPLIT_WORD,defaultSplitWord);
        applicationProperties.setBoolean(ISLINK,defaultIsLink);
        applicationProperties.set(LINE_SEPARATOR,defaultLineSeparator);
        applicationProperties.load();
        
       
           
           
           
       
    }

    private void saveProperties() {
        applicationProperties.save();
    }



    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
     */
    public void widgetSelected(SelectionEvent item) {
        if (item.getSource() instanceof MenuItem) {
            MenuItem menuItem = (MenuItemitem.getSource();
            //System.out.println(menuItem.getText());
            if ("終了".equals(menuItem.getText())) {
                exit();
            else if ("新規".equals(menuItem.getText())) {
                newFile();
            else if ("開く".equals(menuItem.getText())) {
                openFile();
            else if ("保存".equals(menuItem.getText())) {
                saveFile();
            else if ("別名で保存".equals(menuItem.getText())) {
                saveAsFile();
            else if ("ファイルへ保存".equals(menuItem.getText())) {
                doWriteFile();
            else if ("クリップボードへコピー".equals(menuItem.getText())) {
                doCopy();
            else if ("ホームページ表示".equals(menuItem.getText())) {
                doHomepage();
            else if ("バージョン情報".equals(menuItem.getText())) {
                doVersion();
            }else if("FreeMind 形式で出力".equals(menuItem.getText())){
                doFreeMind();
                
            }

        else if (item.getSource() instanceof TabFolder) {
        
            int index = tab.getSelectionIndex();
            if (index == 1) {
                
                execTab2Tree();
            }else{
                updateUi();
            }
        }else if (item.getSource() ==isParseLinkButton || item.getSource() ==list) {
            statusChanged();
        }
    }

    /**
     
     */
    private void doFreeMind() {
        
        StringTreeBuilder builder = new StringTreeBuilder();
        StringTree stringTree = builder.create(textText.getText());
        //stirng tree to map.
        Map map=StringTreeUtils.toFreeMind(stringTree);
        //write map.
        FileDialog dialog=new FileDialog(shell,SWT.SAVE);
        dialog.setFilterExtensions(new String[]{"*.mm"});
        String path=dialog.open();
        if(path!=null){
            try {
                File tmp=new File(path);
                /*
                if(tmp.getName().toLowerCase().indexOf(".mm")==-1){
                    tmp=new File(tmp.getParentFile(),tmp.getName()+".mm");
                }*/
                FileWriter writer=new FileWriter(tmp);
                FreeMindUtils.writeMap(writer,map);
                writer.close();
            catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
       
    }
    /**
     *  
     */
    private void execTab2Tree() {
        // TODO Auto-generated method stub
        StringTreeBuilder builder = new StringTreeBuilder();
        StringTree stringTree = builder.create(textText.getText());
        TabToTreeView view = new TabToTreeView();

        view.setSplitWord(splitWordText.getText());
        view.setLink(isParseLinkButton.getSelection());
        //view.setLineSeparator(getLineSeparator());

        String treeText = view.view(stringTree);
        this.treeText.setText(treeText);
    }

    /**
     *  
     */
    /*
    private void checkSave() {
        if (splitWordText != null) {
            if (splitWordText.getText().equals("")) {
                splitWordText.setText(","); //default value
            }

            if (!ap.equals(splitWordText.getText())
                    || isParseLinkButton.getSelection() != isLink
                    || getLineSeparatorKey() != lineSeparator) {
                
                applicationProperties.set(SPLIT_WORD,splitWordText.getText());
                applicationProperties.setBoolean(SPLIT_WORD,isParseLinkButton.getSelection());
                applicationProperties.set(LINE_SEPARATOR,getLineSeparatorKey());

                saveProperties();
            }
        }
    }*/

    /**
     @return
     */
    private String getLineSeparatorKey() {
        String lineSeparator = "os";
        if (list.getSelectionIndex() == 1) {
            lineSeparator = "n";
        else if (list.getSelectionIndex() == 2) {
            lineSeparator = "rn";
        else if (list.getSelectionIndex() == 3) {
            lineSeparator = "r";
        }
        return lineSeparator;
    }

    /**
     *  
     */
    private void doVersion() {
        MessageBox box = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
        box.setMessage("Tab2Tree テキスト " + version + "\r\n\r\n"
                "License CPL or Apache2.0\r\n (c)アッキー  2004\r\n"
                "http://www.xucker.jpn.org/product/tab2tree.html");

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

    /**
     *  
     */
    private void doHomepage() {
        // TODO Auto-generated method stub

    }

   

    /**
     *  
     */
    private void doCopy() {
        execTab2Tree();
        String result = treeText.getText();
        //System.out.println((int)Text.DELIMITER.charAt(0));
        //System.out.println((int)getLineSeparator().charAt(0));
        result = result.replaceAll(System.getProperty("line.separator"),
                getLineSeparator());
        Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
        cp.setContents(new StringSelection(result)null);
    }

    /**
     *  
     */
    private void doWriteFile() {
        execTab2Tree();
        String result = treeText.getText();
        result = result.replaceAll(System.getProperty("line.separator"),
                getLineSeparator());

        FileDialog dialog = new FileDialog(shell, SWT.SAVE);
        String select = dialog.open();
        if (select != null) {
            try {
                FileUtils.writeStringToFile(new File(select), result,
                        FileEncoding);
            catch (IOException e) {

                e.printStackTrace();
            }
        }

    }

   



    public void readText(File openFile) {
        if (openFile.exists()) {
            try {
                String text = FileUtils
                        .readFileToString(openFile, FileEncoding);
                textText.setText(text);
                
            catch (IOException e) {
                e.printStackTrace();
            }
        }

    }

    public void execOpen() {
        if (getFile() != null) {

            readText(getFile());
        }
        
       
    }

    

    /**
     *  
     */
    protected void execSave() {
        try {
            FileUtils.writeStringToFile(getFile(), textText.getText(),
                    FileEncoding);
            
        catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }

   

    

 

    /**
     *  
     */

    protected void execNew() {
        textText.setText("");
        
      
    }

    

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
     */
    public void widgetDefaultSelected(SelectionEvent arg0) {
        // TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
     */
    public void modifyText(ModifyEvent event) {
        if(event.getSource()==updateButton){
        statusChanged();
        }else{
        setNeedSave(true);
        updateTitle();
        }
    }

    /**
     
     */
    private void statusChanged() {
        updateButton.setEnabled(true);
    }
    /**
     
     */
    protected void updateTitle() {
        // TODO Auto-generated method stub
        String mark=" - ";
        if(isNeedSave()){
            mark+="*";
        }
        shell.setText(appName+mark+getFileName());
    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ShellListener#shellActivated(org.eclipse.swt.events.ShellEvent)
     */
    public void shellActivated(ShellEvent arg0) {
        // TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ShellListener#shellClosed(org.eclipse.swt.events.ShellEvent)
     
     
     */
    public void shellClosed(ShellEvent event) {
       
        if (isNeedSave()) {
            if(isNeedSave()){
                int result=askSave();
                if(result==YES){
                if(!saveFile()){
                    event.doit=false;
                    return//cancel
                }
                }else if(result==CANCEL){
                    event.doit=false;
                    return;
                }
            }
        
        event.doit=true;
    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ShellListener#shellDeactivated(org.eclipse.swt.events.ShellEvent)
     */
    public void shellDeactivated(ShellEvent arg0) {
        // TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ShellListener#shellDeiconified(org.eclipse.swt.events.ShellEvent)
     */
    public void shellDeiconified(ShellEvent arg0) {
        // TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.ShellListener#shellIconified(org.eclipse.swt.events.ShellEvent)
     */
    public void shellIconified(ShellEvent arg0) {
        // TODO Auto-generated method stub

    }

    

  
    public void exit(){
        
        execExit();
    }

    /* (non-Javadoc)
     * @see org.jpn.xucker.commons.util.AbstractBasicFileApplication#execExit()
     */
    protected void execExit() {
        //System.out.println("execExit");
        shell.close();
    }
    /* (non-Javadoc)
     * @see org.jpn.xucker.commons.util.StatusChangeListener#statusChanged(boolean)
     */
    public void statusChanged(boolean changed) {
        System.out.println(""+changed);
        if(changed){
        applicationProperties.setBoolean(ISLINK,isParseLinkButton.getSelection());
        applicationProperties.set(LINE_SEPARATOR,getLineSeparatorKey());
        applicationProperties.set(SPLIT_WORD,splitWordText.getText());
        applicationProperties.save();
        }
    }


   
   

}