Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.Field


           
          }
            BarcodeScanner bcScanner = new BarcodeScanner(decoder, decoderListener);
            this.setBarcodeScanner(bcScanner);
            this.setCameraPlayer(bcScanner.getPlayer());
             Field scannerField = bcScanner.getViewfinder();
           

             bcScanner.getVideoControl().setDisplayFullScreen(true);
      // Create and add our key listener to the screen
      this.addKeyListener(new KeyPadListener());
View Full Code Here


    protected boolean touchEvent( TouchEvent message ) {
        switch( message.getEvent() ) {
            case TouchEvent.GESTURE:
                if( _allowMultiple && message.getGesture().getEvent() == TouchGesture.NAVIGATION_SWIPE ) {
                    int swipeDirection = message.getGesture().getSwipeDirection();
                    Field field = getLeafFieldWithFocus();
                    if( field instanceof ListField ) {
                        switch( swipeDirection ) {
                            case TouchGesture.SWIPE_EAST:
                                _doneButton.setFocus();
                                return true;
View Full Code Here

    /* @Override */
    protected boolean keyChar( char c, int status, int time ) {
        switch( c ) {
            case Characters.ENTER:
                Field field = getLeafFieldWithFocus();
                if( field == _doneButton ) {
                    fieldChanged( _doneButton, -1 );
                } else {
                    _list.invokeAction( Field.ACTION_INVOKE );
                }
View Full Code Here

  private void displayCategory(final Category category) {
    selectedCategory = category;
    category.reset();
   
    for (int i = 0; i < this.fields.length; i++) {
      Field field = this.fields[i];
      delete(field);
    }

    // Execute in a separate thread to avoid blocking the event thread for too long
    Runnable exec = new Runnable() {     
      public void run() {
        // Get the fields to display
        final Field[] fields = category.getFields();
        OmniLinkBBClientScreen.this.fields = fields;

        // Add UI elements to the event thread
        Runnable exec = new Runnable() {         
          public void run() {
            // Add all the fields to this screen
            for (int i = 0; i < fields.length; i++) {
              Field field = fields[i];
              add(field);
            }
          }
        };
        OmniLinkBBClient.getUiApplication().invokeLater(exec);
View Full Code Here

  protected interface Execution {
    boolean execute(Object selection);
  }
 
  protected Field createDateField(String label, long date, int format) {
    Field dateField = new DateField(label, date, DateFormat.getInstance(format), DateField.DATE_TIME | DateField.READONLY | DateField.NON_FOCUSABLE);
    dateField.setPadding(5, 0, 5, 0);
    return dateField;
  }
View Full Code Here

        public boolean execute(Object selection) {
          UnitControl selectedUnitCondition = (UnitControl) ((EnumLabel) selection).getEnumValue();
          return unitModel.setUnitControl(unitNumber, selectedUnitCondition);
        }
      };
      Field unitField = createLabelAndChoiceField(MessageFormat.format(OmniLinkBBClient.getString(OmniLinkClientResource.UNIT_NAME), new Object[] {new Integer(unitNumber), unitName}), UNIT_CONDITIONS, unitConditionLabel, exec);
      unitFields[i] = unitField;
    }
   
    return unitFields;
  }
View Full Code Here

          } else {         
            return false;
          }
        }
      };
      final Field messageField = createLabelAndChoiceField(MessageFormat.format(OmniLinkBBClient.getString(OmniLinkClientResource.MESSAGE_NAME), new Object[] {new Integer(messageNumber), messageName}), messageChoices, messageChoice, exec);
      messageFields[i] = messageField;
    }
   
    return messageFields;
  }
View Full Code Here

    return OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE);
  }

  public Field[] getFields() {
    // Current Temperature
    Field currentTemperatureField = createLabelAndTextField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_CURRENT), String.valueOf(thermostatModel.getCurrentTemperature()));

    // Min temperature
    Double minTemperature = new Double(thermostatModel.getMinTemperature());
    Execution exec = new Execution() {
      public boolean execute(Object selection) {
        Double selectedMinTemp = (Double) selection;
        return thermostatModel.setMinTemperature(selectedMinTemp.doubleValue());
      }
    };
    Field minTempChoiceField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_MIN), TEMPERATURES, minTemperature, exec);

    // Max temperature
    Double maxTemperature = new Double(thermostatModel.getMaxTemperature());
    exec = new Execution() {
      public boolean execute(Object selection) {
        Double selectedMaxTemp = (Double) selection;
        return thermostatModel.setMaxTemperature(selectedMaxTemp.doubleValue());
      }
    };
    Field maxTempChoiceField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_MAX), TEMPERATURES, maxTemperature, exec);

    // Fan mode
    EnumLabel fanModeLabel = EnumLabel.getEnumLabel(FAN_MODES, thermostatModel.getFanMode());
    exec = new Execution() {
      public boolean execute(Object selection) {
        FanMode selectedFanMode = (FanMode) ((EnumLabel) selection).getEnumValue();
        return thermostatModel.setFanMode(selectedFanMode);
      }
    };
    Field fanModeField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_FAN_MODE), FAN_MODES, fanModeLabel, exec);

    // Hold mode
    EnumLabel holdModeLabel = EnumLabel.getEnumLabel(HOLD_MODES, thermostatModel.getHoldMode());
    exec = new Execution() {
      public boolean execute(Object selection) {
        HoldMode selectedHoldMode = (HoldMode) ((EnumLabel) selection).getEnumValue();
        return thermostatModel.setHoldMode(selectedHoldMode);
      }
    };
    Field holdModeField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_HOLD_MODE), HOLD_MODES, holdModeLabel, exec);

    // System mode
    EnumLabel systemModeLabel = EnumLabel.getEnumLabel(SYSTEM_MODES, thermostatModel.getSystemMode());
    exec = new Execution() {
      public boolean execute(Object selection) {
        SystemMode selectedSystemMode = (SystemMode) ((EnumLabel) selection).getEnumValue();
        return thermostatModel.setSystemMode(selectedSystemMode);
      }
    };
    Field systemModeField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_SYSTEM_MODE), SYSTEM_MODES, systemModeLabel, exec);

    return new Field[] {currentTemperatureField, minTempChoiceField, maxTempChoiceField, fanModeField, holdModeField, systemModeField};
  }
View Full Code Here

    return OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM);
  }

  public Field[] getFields() {
    // System date & time
    Field systemTimeField = createDateField(OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM_TIME), systemModel.getDate(), DateFormat.DATE_LONG | DateFormat.TIME_LONG);

    // System status
    Field systemStatusField = createLabelAndTextField(OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM_STATUS), EnumLabel.getEnumLabelString(SYSTEM_STATUSES, systemModel.getSystemStatus()));
   
    // Phone line status
    Field phoneLineStatusField = createLabelAndTextField(OmniLinkBBClient.getString(OmniLinkClientResource.PHONE_LINE_STATUS), EnumLabel.getEnumLabelString(PHONE_LINE_STATUSES, systemModel.getPhoneLineStatus()));
   
    // Security mode
    EnumLabel securityModeLabel = EnumLabel.getEnumLabel(SECURITY_MODES, systemModel.getSecurityMode());
    Execution securityExec = new Execution() {
      public boolean execute(Object selection) {
        SecurityMode selectedSecurityMode = (SecurityMode) ((EnumLabel) selection).getEnumValue();
        return systemModel.setSecurityMode(selectedSecurityMode);
      }
    };
    Field securityField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.SECURITY_MODE), SECURITY_MODES, securityModeLabel, securityExec);
   
    // All Units On/Off
    Execution allUnitsOnExec = new Execution() {     
      public boolean execute(Object selection) {
        return systemModel.setAllUnitsControl(BasicUnitControl.ON);
      }
    };
    Execution allUnitsOffExec = new Execution() {     
      public boolean execute(Object selection) {
        return systemModel.setAllUnitsControl(BasicUnitControl.OFF);
      }
    };
    Field allUnitsField = createLabelAndTwoButtonsField(OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM_ALL_UNITS), OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM_ALL_UNITS_ON), allUnitsOnExec, OmniLinkBBClient.getString(OmniLinkClientResource.SYSTEM_ALL_UNITS_OFF), allUnitsOffExec);
       
    return new Field[] {systemTimeField, systemStatusField, phoneLineStatusField, securityField, allUnitsField};
  }
View Full Code Here

    return OmniLinkBBClient.getString(OmniLinkClientResource.INFORMATION);
  }

  public Field[] getFields() {
    // System type
    Field systemTypeField = createLabelAndTextField(OmniLinkBBClient
        .getString(OmniLinkClientResource.SYSTEM_TYPE), EnumLabel.getEnumLabelString(SYSTEM_TYPES, infoModel.getSystemType()));

    // System version
    Field systemVersionField = createLabelAndTextField(OmniLinkBBClient
        .getString(OmniLinkClientResource.SYSTEM_VERSION), infoModel
        .getVersion());

    // Local phone number
    Field localPhoneNumberField = createLabelAndTextField(OmniLinkBBClient
        .getString(OmniLinkClientResource.LOCAL_PHONE_NUMBER),
        infoModel.getLocalPhoneNumber());

    // Sunrise
    Field sunriseField = createDateField(OmniLinkBBClient
        .getString(OmniLinkClientResource.SUNRISE_TIME), systemModel
        .getSunrise(), DateFormat.TIME_LONG);

    // Sunset
    Field sunsetField = createDateField(OmniLinkBBClient
        .getString(OmniLinkClientResource.SUNSET_TIME), systemModel
        .getSunset(), DateFormat.TIME_LONG);

    // Event Log
    Execution viewEventLogExec = new Execution() {
      public boolean execute(Object selection) {
        getEventLog(false);
        return true;
      }
    };
    Execution downloadEventLogExec = new Execution() {
      public boolean execute(Object selection) {
        getEventLog(true);
        return true;
      }
    };
    Field eventLogField = createLabelAndTwoButtonsField(OmniLinkBBClient
        .getString(OmniLinkClientResource.EVENTLOG), OmniLinkBBClient
        .getString(OmniLinkClientResource.EVENTLOG_VIEW),
        viewEventLogExec, OmniLinkBBClient
            .getString(OmniLinkClientResource.EVENTLOG_LOAD),
        downloadEventLogExec);
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.Field

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.