コード例 #1
0
ファイル: PropertyTest.java プロジェクト: klemens/openolat
  /** testListProperties */
  @Test
  public void testListProperties() {
    // create resource, identity and group
    OLATResource ores = JunitTestHelper.createRandomResource();
    Identity identity =
        JunitTestHelper.createAndPersistIdentityAsUser("prop-4-" + UUID.randomUUID().toString());
    BusinessGroup group =
        businessGroupService.createBusinessGroup(
            identity, "a buddygroup", "a desc", -1, -1, false, false, null);
    dbInstance.commitAndCloseSession();

    Property p =
        pm.createPropertyInstance(
            identity,
            group,
            ores,
            "cat",
            "TestProperty",
            new Float(1.1),
            new Long(123456),
            "stringValue",
            "textValue");
    pm.saveProperty(p);

    List<Property> entries =
        PropertyManager.getInstance()
            .listProperties(
                identity,
                group,
                ores.getResourceableTypeName(),
                ores.getResourceableId(),
                "cat",
                "TestProperty");
    Assert.assertNotNull(entries);
    Assert.assertEquals(1, entries.size());

    Property prop = entries.get(0);
    assertEquals(ores.getResourceableTypeName(), prop.getResourceTypeName());
    assertEquals(ores.getResourceableId(), prop.getResourceTypeId());

    int numOfEntries =
        PropertyManager.getInstance()
            .countProperties(
                identity,
                group,
                ores.getResourceableTypeName(),
                ores.getResourceableId(),
                "cat",
                "TestProperty",
                null,
                null);
    Assert.assertEquals(entries.size(), numOfEntries);
  }
コード例 #2
0
ファイル: MainActivity.java プロジェクト: dongja94/ExampleGCM
 private void setUpIfNeeded() {
   if (checkPlayServices()) {
     String regId = PropertyManager.getInstance().getRegistrationId();
     if (!regId.equals("")) {
       doRealStart();
     } else {
       registerInBackground();
     }
   }
 }
コード例 #3
0
ファイル: MenuActivity.java プロジェクト: galmaegi/alibaba
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu_view);
    boolean alarm = PropertyManager.getInstance().getIsAlram();

    streambtn = (Button) findViewById(R.id.streambtn);
    storagebtn = (Button) findViewById(R.id.storagebtn);
    alarmbtn = (ToggleButton) findViewById(R.id.alrambtn);

    streambtn.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(MenuActivity.this, WebViewActivity.class);
            startActivity(intent);
          }
        });

    storagebtn.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(MenuActivity.this, LogListActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
          }
        });

    alarmbtn.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {

          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // �븣�엺 �꽭�똿 媛� 蹂�寃�
            PropertyManager.getInstance().setIsAlram(isChecked);
          }
        });
    alarmbtn.setChecked(alarm);
  }
コード例 #4
0
ファイル: ResourceConfiguration.java プロジェクト: zhaog/cdt
  /**
   * Create a <code>ResourceConfiguration</code> based on the specification stored in the project
   * file (.cdtbuild).
   *
   * @param parent The <code>IConfiguration</code> the resource configuration will be added to.
   * @param element The XML element that contains the resource configuration settings.
   */
  public ResourceConfiguration(
      IConfiguration parent, ICStorageElement element, String managedBuildRevision) {
    super(parent, element, true);
    isExtensionResourceConfig = false;
    setResourceData(new BuildFileData(this));

    setManagedBuildRevision(managedBuildRevision);
    // Initialize from the XML attributes
    loadFromProject(element);

    // Load children
    ICStorageElement configElements[] = element.getChildren();
    for (int i = 0; i < configElements.length; ++i) {
      ICStorageElement configElement = configElements[i];
      if (configElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
        Tool tool = new Tool(this, configElement, getManagedBuildRevision());
        addTool(tool);
      }
    }

    String rebuild = PropertyManager.getInstance().getProperty(this, REBUILD_STATE);
    if (rebuild == null || Boolean.valueOf(rebuild).booleanValue()) setRebuildState(true);
    setDirty(false);
  }
コード例 #5
0
ファイル: ResourceConfiguration.java プロジェクト: zhaog/cdt
 private void saveRebuildState() {
   PropertyManager.getInstance()
       .setProperty(this, REBUILD_STATE, Boolean.toString(needsRebuild()));
 }