Package com.substanceofcode.rssreader.businessentities

Examples of com.substanceofcode.rssreader.businessentities.RssReaderSettings


    updateForm();
    }
   
  /* Update form items that change per run. */
  public void updateForm() {
        RssReaderSettings settings = m_midlet.getSettings();
        int maxCount = settings.getMaximumItemCountInFeed();
        m_itemCountField.setString(String.valueOf(maxCount));
        boolean markUnreadItems = settings.getMarkUnreadItems();
    m_markUnreadItems.setSelectedFlags( new boolean[] {markUnreadItems,
        !markUnreadItems} );
    //#ifndef DSMALLMEM
        boolean useTextBox = settings.getUseTextBox();
    m_useTextBox.setSelectedFlags( new boolean[] {useTextBox, !useTextBox} );
    //#endif
        boolean useStdExit = settings.getUseStandardExit();
        prevStdExit = useStdExit;
    m_useStandardExit.setSelectedFlags( new boolean[] {useStdExit,
        !useStdExit} );
    //#ifdef DITUNES
        boolean itunesEnabled = settings.getItunesEnabled();
    m_itunesEnabled.setSelectedFlags( new boolean[] {!itunesEnabled,
        itunesEnabled} );
    //#endif
    //#ifdef DMIDP20
        boolean pageEnabled = settings.getPageEnabled();
        boolean htmlEnabled = settings.getHtmlEnabled();
    m_pageEnabled.setSelectedFlags( new boolean[] {!pageEnabled &&
        !htmlEnabled, pageEnabled, htmlEnabled} );
        int fontSize = settings.getFontSize();
    boolean [] boolfontSize = {false, false, false, false};
    m_fontSize.setSelectedFlags( new boolean[] {false, false, false,
        false} );
    m_fontSize.setSelectedIndex( fontSize, true );
    //#endif
        boolean feedListOpen = settings.getFeedListOpen();
    m_feedListOpen.setSelectedFlags( new boolean[] {feedListOpen,
        !feedListOpen} );

    long totalMem;
    long freeMem;
    System.gc();
    totalMem = Runtime.getRuntime().totalMemory();
    freeMem = Runtime.getRuntime().freeMemory();
    m_pgmMemUsedItem.setText(((totalMem - freeMem)/1024L) + "kb");
    m_pgmMemAvailItem.setText((freeMem/1024L) + "kb");
    Hashtable memInfo;
    try {
      memInfo = settings.getSettingMemInfo();
    } catch (Throwable e) {
      m_midlet.recordExcFormFinRsc("exc.int.err", e);
      memInfo = new Hashtable();
    }
        if (memInfo.size() == 0) {
View Full Code Here


      m_upd = false;
      /* Loading data... */
      m_midlet.initializeLoadingFormRsc("text.u.data", this);
            // Save settings
            try {
        RssReaderSettings settings = m_midlet.getSettings();
                int maxCount = Integer.parseInt( m_itemCountField.getString() );
                settings.setMaximumItemCountInFeed( maxCount );
        boolean markUnreadItems = m_markUnreadItems.isSelected(0);
                settings.setMarkUnreadItems( markUnreadItems );
        //#ifndef DSMALLMEM
        boolean useTextBox = m_useTextBox.isSelected(0);
        settings.setUseTextBox(useTextBox);
        //#endif
        boolean useStdExit = m_useStandardExit.isSelected(0);
        settings.setUseStandardExit(useStdExit);
        if (useStdExit != prevStdExit) {
          m_midlet.initExit();
        }
        //#ifdef DITUNES
        boolean itunesEnabled = !m_itunesEnabled.isSelected(0);
        settings.setItunesEnabled( itunesEnabled );
        //#else
        settings.setItunesEnabled( false );
        //#endif
        //#ifdef DMIDP20
        boolean pageEnabled = m_pageEnabled.isSelected(1);
        settings.setPageEnabled( pageEnabled );
        boolean htmlEnabled = m_pageEnabled.isSelected(2);
        settings.setHtmlEnabled( htmlEnabled );
        int fontSize = m_fontSize.getSelectedIndex();
        settings.setFontSize( fontSize );
        //#endif
        boolean feedListOpen = m_feedListOpen.isSelected(0);
        settings.setFeedListOpen( feedListOpen);
                int maxWordCount = Integer.parseInt( m_wordCountField.getString() );
                settings.setMaxWordCountInDesc( maxWordCount );
        //#ifdef DLOGGING
        try {
          String logLevel =
            m_logLevelField.getString().toUpperCase();
          logger.getParent().setLevel(Level.parse(logLevel));
          settings.setLogLevel( logLevel );
        } catch (IllegalArgumentException e) {
          Alert invalidData = new Alert("Invalid Log Level",
                  "Invalid Log Level " +
                  m_logLevelField.getString(),
                  null,
View Full Code Here

        this.addCommand( m_helpCommand );
    //#endif

        this.setCommandListener( this );
       
        RssReaderSettings settings = m_midlet.getSettings();
        int maxCount = settings.getMaximumItemCountInFeed();
       
        m_itemCountField = new TextField("Max item count in feed",
                String.valueOf(maxCount), 3, TextField.NUMERIC);
    //#ifdef DMIDP20
    m_itemCountField.setLayout(Item.LAYOUT_BOTTOM);
    //#endif
        super.append( m_itemCountField );

        m_markUnreadItems = UiUtil.getAddChoiceGroup(this,
        "Mark unread items", new String [] {"Mark", "No mark"});

    //#ifndef DSMALLMEM
        m_useTextBox = UiUtil.getAddChoiceGroup(this,
        "Text entry items", new String [] {"Text (large) box",
        "Text (line) field"});
    //#endif

        m_useStandardExit = UiUtil.getAddChoiceGroup(this,
        "Exit key type", new String [] {"Use standard exit key",
        "Use menu exit key"});

    //#ifdef DITUNES
//@        m_itunesEnabled = UiUtil.getAddChoiceGroup(this,
//@        "Choose to use Itunes data", new String []
//@        {"Don't show Itunes data", "Show Itunes data"});
    //#endif

    //#ifdef DMIDP20
        m_pageEnabled = UiUtil.getAddChoiceGroup(this,
        "Choose to use keypad and/get HTML emphasis for item screen",
        new String []
        {"Use commands to go back to previous screen",
        "Also use keypad to go back to previous screen",
        "Also use keypad (as previous) and emphasize HTML"});

        m_fontSize = UiUtil.getAddChoiceGroup(this,
        "Choose font size",
        new String[] {"Default font size", "Small",
        "Medium", "Large"});
    //#endif
        m_feedListOpen = UiUtil.getAddChoiceGroup(this,
        "Choose feed list menu first item", new String []
        {"Open item first", "Back first"});

        int maxWordCount = settings.getMaxWordCountInDesc();
        m_wordCountField = new TextField("Max word count desc abbrev",
                String.valueOf(maxCount), 3, TextField.NUMERIC);
    //#ifdef DMIDP20
    m_wordCountField.setLayout(Item.LAYOUT_BOTTOM);
    //#endif
View Full Code Here

    updateForm();
    }
   
  /* Update form items that change per run. */
  public void updateForm() {
        RssReaderSettings settings = m_midlet.getSettings();
        int maxCount = settings.getMaximumItemCountInFeed();
        m_itemCountField.setString(String.valueOf(maxCount));
        boolean markUnreadItems = settings.getMarkUnreadItems();
    m_markUnreadItems.setSelectedFlags( new boolean[] {markUnreadItems,
        !markUnreadItems} );
    //#ifndef DSMALLMEM
        boolean useTextBox = settings.getUseTextBox();
    m_useTextBox.setSelectedFlags( new boolean[] {useTextBox, !useTextBox} );
    //#endif
        boolean useStdExit = settings.getUseStandardExit();
        prevStdExit = useStdExit;
    m_useStandardExit.setSelectedFlags( new boolean[] {useStdExit,
        !useStdExit} );
    //#ifdef DITUNES
//@        boolean itunesEnabled = settings.getItunesEnabled();
//@    m_itunesEnabled.setSelectedFlags( new boolean[] {!itunesEnabled,
//@        itunesEnabled} );
    //#endif
    //#ifdef DMIDP20
        boolean pageEnabled = settings.getPageEnabled();
        boolean htmlEnabled = settings.getHtmlEnabled();
    m_pageEnabled.setSelectedFlags( new boolean[] {!pageEnabled &&
        !htmlEnabled, pageEnabled, htmlEnabled} );
        int fontSize = settings.getFontSize();
    boolean [] boolfontSize = {false, false, false, false};
    m_fontSize.setSelectedFlags( new boolean[] {false, false, false,
        false} );
    m_fontSize.setSelectedIndex( fontSize, true );
    //#endif
        boolean feedListOpen = settings.getFeedListOpen();
    m_feedListOpen.setSelectedFlags( new boolean[] {feedListOpen,
        !feedListOpen} );

    long totalMem;
    long freeMem;
    System.gc();
    totalMem = Runtime.getRuntime().totalMemory();
    freeMem = Runtime.getRuntime().freeMemory();
    m_pgmMemUsedItem.setText(((totalMem - freeMem)/1024L) + "kb");
    m_pgmMemAvailItem.setText((freeMem/1024L) + "kb");
    Hashtable memInfo;
    try {
      memInfo = settings.getSettingMemInfo();
    } catch (Throwable e) {
      m_midlet.recordExcFormFinRsc("exc.int.err", e);
      memInfo = new Hashtable();
    }
        if (memInfo.size() == 0) {
View Full Code Here

      m_upd = false;
      /* Loading data... */
      m_midlet.initializeLoadingFormRsc("text.u.data", this);
            // Save settings
            try {
        RssReaderSettings settings = m_midlet.getSettings();
                int maxCount = Integer.parseInt( m_itemCountField.getString() );
                settings.setMaximumItemCountInFeed( maxCount );
        boolean markUnreadItems = m_markUnreadItems.isSelected(0);
                settings.setMarkUnreadItems( markUnreadItems );
        //#ifndef DSMALLMEM
        boolean useTextBox = m_useTextBox.isSelected(0);
        settings.setUseTextBox(useTextBox);
        //#endif
        boolean useStdExit = m_useStandardExit.isSelected(0);
        settings.setUseStandardExit(useStdExit);
        if (useStdExit != prevStdExit) {
          m_midlet.initExit();
        }
        //#ifdef DITUNES
//@        boolean itunesEnabled = !m_itunesEnabled.isSelected(0);
//@        settings.setItunesEnabled( itunesEnabled );
        //#else
        settings.setItunesEnabled( false );
        //#endif
        //#ifdef DMIDP20
        boolean pageEnabled = m_pageEnabled.isSelected(1);
        settings.setPageEnabled( pageEnabled );
        boolean htmlEnabled = m_pageEnabled.isSelected(2);
        settings.setHtmlEnabled( htmlEnabled );
        int fontSize = m_fontSize.getSelectedIndex();
        settings.setFontSize( fontSize );
        //#endif
        boolean feedListOpen = m_feedListOpen.isSelected(0);
        settings.setFeedListOpen( feedListOpen);
                int maxWordCount = Integer.parseInt( m_wordCountField.getString() );
                settings.setMaxWordCountInDesc( maxWordCount );
        //#ifdef DLOGGING
//@        try {
//@          String logLevel =
//@            m_logLevelField.getString().toUpperCase();
//@          logger.getParent().setLevel(Level.parse(logLevel));
View Full Code Here

TOP

Related Classes of com.substanceofcode.rssreader.businessentities.RssReaderSettings

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.