Package edu.harvard.wcfia.yoshikoder.util

Examples of edu.harvard.wcfia.yoshikoder.util.CharsetWrapper


       
        encodingModel = new DefaultComboBoxModel();
        for (CharsetWrapper wrapper : FileUtil.getCharsetList())
      encodingModel.addElement(wrapper);
        encodingList = new JComboBox(encodingModel);
        encodingList.setSelectedItem(new CharsetWrapper(yoshikoder.getDefaultEncoding()));
        // set to locale picker width since that'll be the longest
        encodingList.setPreferredSize( new Dimension(
                localeList.getPreferredSize().width,
                encodingList.getPreferredSize().height) );
        encodingList.addActionListener(new ActionListener(){
View Full Code Here


            text.setText(ns);
            text.setCaretPosition(0);
        } catch (UnsupportedEncodingException uee){
            log.warning("couldn't decode bytes as system encoding");
        }
        encodings.setSelectedItem(new CharsetWrapper(cs));
        encodings.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
                TaskWorker tworker = new TaskWorker(PreviewPanel.this.getTopLevelAncestor()){
                    String ns;
                    protected void doWork() throws Exception {
View Full Code Here

        super();
        yoshikoder = yk;
              
        charsetModel = new DefaultComboBoxModel();
        for (Iterator<CharsetWrapper> iterator = FileUtil.getCharsetList().iterator(); iterator.hasNext();) {
      CharsetWrapper wrapper = iterator.next();
      charsetModel.addElement(wrapper);
    }
        charsetCombo = new JComboBox(charsetModel);
        CharsetWrapper thisone = new CharsetWrapper(yoshikoder.getDefaultEncoding());
        charsetCombo.setSelectedItem(thisone);
       
        localeCombo = new JComboBox(FileUtil.getLocaleList().toArray(new LocaleWrapper[]{}));
        localeCombo.setSelectedItem(new LocaleWrapper(yoshikoder.getDefaultLocale()));
       
View Full Code Here

     
      public void setDocumentState(DocumentState ds){
        state = ds;
        YKDocument doc = state.getDocument();
        localeBox.setSelectedItem(new LocaleWrapper(doc.getLocale()));
        encodingBox.setSelectedItem(new CharsetWrapper(Charset.forName(doc.getCharsetName())));
        titleField.setText(doc.getTitle());
      }
View Full Code Here

      }
     
      public DocumentEditPanel(DocumentState s) {
        super(new GridBagLayout());
        state = s;
        encodingBox.setSelectedItem(new CharsetWrapper(Charset.forName(s.getDocument().getCharsetName())));
        //System.err.println(s.getDocument().getTitle() + " has locale " + s.getDocument().getLocale());
        localeBox.setSelectedItem(new LocaleWrapper(s.getDocument().getLocale()));
        titleField.setText(s.getDocument().getTitle());
       
        GridBagConstraints c = new GridBagConstraints();
View Full Code Here

TOP

Related Classes of edu.harvard.wcfia.yoshikoder.util.CharsetWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.