Examples of EnumLabel


Examples of net.homeip.mleclerc.omnilinkbbclient.util.EnumLabel

    Field[] unitFields = new Field[unitCount];
    for (int i = 0; i < unitCount; i++) {
      final int unitNumber = unitModel.getUnitNumber(i);
      String unitName = unitModel.getUnitName(i);
      UnitControl unitCondition = (unitModel.getUnitCondition(i) != UnitControl.OFF) ? UnitControl.ON : UnitControl.OFF;
      EnumLabel unitConditionLabel = EnumLabel.getEnumLabel(UNIT_CONDITIONS, unitCondition);
      Execution exec = new Execution() {
        public boolean execute(Object selection) {
          UnitControl selectedUnitCondition = (UnitControl) ((EnumLabel) selection).getEnumValue();
          return unitModel.setUnitControl(unitNumber, selectedUnitCondition);
        }
View Full Code Here

Examples of net.homeip.mleclerc.omnilinkbbclient.util.EnumLabel

      }
    };
    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);
      }
View Full Code Here

Examples of net.homeip.mleclerc.omnilinkbbclient.util.EnumLabel

   
    // 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);
      }
View Full Code Here

Examples of net.homeip.mleclerc.omnilinkbbclient.util.EnumLabel

    Field[] zoneFields = new Field[zoneCount];
    for (int i = 0; i < zoneCount; i++) {
      final int zoneNumber = zoneModel.getZoneNumber(i);
      String zoneName = zoneModel.getZoneName(i);
      ZoneCondition zoneCondition = zoneModel.getZoneCondition(i);
      EnumLabel zoneConditionLabel = EnumLabel.getEnumLabel(ZONES_CONDITIONS, zoneCondition);
      LatchedAlarmStatus latchedAlarmStatus = zoneModel.getLatchedAlarmStatus(i);
      EnumLabel latchedAlarmStatusLabel = EnumLabel.getEnumLabel(ZONE_LATCHED_ALARM_STATUSES, latchedAlarmStatus);
      final EnumLabel zoneStatusLabel = !latchedAlarmStatus.equals(LatchedAlarmStatus.SECURE)? latchedAlarmStatusLabel : zoneConditionLabel;
      boolean zoneBypassed = zoneModel.isZoneBypassed(i);     
      Execution zoneExec = new Execution() {       
        public boolean execute(Object selection) {
          Boolean selectedChecked = (Boolean) selection;
          return (selectedChecked.booleanValue()) ? zoneModel.bypassZone(zoneNumber) : zoneModel.restoreZone(zoneNumber);
        }
      };
      final Field zoneField = createCheckBoxAndTextField(MessageFormat.format(OmniLinkBBClient.getString(OmniLinkClientResource.ZONE_NAME), new Object[] {new Integer(zoneNumber), zoneName}), zoneBypassed, zoneExec, zoneStatusLabel.toString());
      zoneFields[i] = zoneField;
    }
   
    return zoneFields;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.