Package com.google.gdt.eclipse.designer.mobile.device.model

Examples of com.google.gdt.eclipse.designer.mobile.device.model.CategoryInfo


  /**
   * Test for {@link DeviceMoveCommand}.
   */
  public void test_DeviceMoveCommand_noSource() throws Exception {
    CategoryInfo category = DeviceManager.getCategories().get(0);
    List<DeviceInfo> devices = category.getDevices();
    // add Device
    addDevice(category, "dev", "device");
    DeviceInfo device = DeviceManager.getDevice("dev");
    // ignored - we remove device before executing
    {
View Full Code Here


  /**
   * Test for {@link DeviceRemoveCommand}.
   */
  public void test_DeviceRemoveCommand() throws Exception {
    CategoryInfo category = DeviceManager.getCategories().get(0);
    // add Device
    addDevice(category, "dev", "device");
    // remove Device
    {
      DeviceInfo device = DeviceManager.getDevice("dev");
View Full Code Here

  /**
   * Test for {@link DeviceEditCommand}.
   */
  public void test_DeviceEditCommand() throws Exception {
    CategoryInfo category = DeviceManager.getCategories().get(0);
    // add Device
    {
      String imagePath =
          TestUtils.createImagePNG(m_testProject, "imA.png", 1, 2).getLocation().toPortableString();
      addDevice(category, "dev", "name", imagePath, new Rectangle(1, 2, 10, 20));
View Full Code Here

   */
  public void test_CategoryAddCommand() throws Exception {
    DeviceManager.commandsAdd(new CategoryAddCommand("newCat", "New\r\ncategory"));
    // can use new Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNotNull(category);
      assertEquals("New\r\ncategory", category.getName());
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // still can use new Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNotNull(category);
      assertEquals("New\r\ncategory", category.getName());
    }
  }
View Full Code Here

   */
  public void test_CategoryAddCommand_specialCharacters() throws Exception {
    DeviceManager.commandsAdd(new CategoryAddCommand("newCat", "New\r\ncategory"));
    // can use new Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNotNull(category);
      assertEquals("New\r\ncategory", category.getName());
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // still can use new Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNotNull(category);
      assertEquals("New\r\ncategory", category.getName());
    }
  }
View Full Code Here

  public void test_CategoryNameCommand() throws Exception {
    // add Category
    DeviceManager.commandsAdd(new CategoryAddCommand("newCat", "foo"));
    // rename Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertEquals("foo", category.getName());
      DeviceManager.commandsAdd(new CategoryNameCommand(category, "bar"));
      assertEquals("bar", category.getName());
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // Category has new name
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertEquals("bar", category.getName());
    }
  }
View Full Code Here

  public void test_CategoryRemoveCommand() throws Exception {
    // add Category
    DeviceManager.commandsAdd(new CategoryAddCommand("newCat", "New category"));
    // remove Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNotNull(category);
      DeviceManager.commandsAdd(new CategoryRemoveCommand(category));
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // still no Category
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertNull(category);
    }
  }
View Full Code Here

    DeviceManager.commandsAdd(new CategoryAddCommand("catA", "a"));
    DeviceManager.commandsAdd(new CategoryAddCommand("catB", "b"));
    // original order
    {
      List<CategoryInfo> categories = DeviceManager.getCategories();
      CategoryInfo categoryA = DeviceManager.getCategory("catA");
      CategoryInfo categoryB = DeviceManager.getCategory("catB");
      assertEquals(categories.indexOf(categoryA), categories.indexOf(categoryB) - 1);
      // do move
      DeviceManager.commandsAdd(new CategoryMoveCommand(categoryB, categoryA));
    }
    // new order
    {
      List<CategoryInfo> categories = DeviceManager.getCategories();
      CategoryInfo categoryA = DeviceManager.getCategory("catA");
      CategoryInfo categoryB = DeviceManager.getCategory("catB");
      assertEquals(categories.indexOf(categoryB), categories.indexOf(categoryA) - 1);
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // still new order
    {
      List<CategoryInfo> categories = DeviceManager.getCategories();
      CategoryInfo categoryA = DeviceManager.getCategory("catA");
      CategoryInfo categoryB = DeviceManager.getCategory("catB");
      assertEquals(categories.indexOf(categoryB), categories.indexOf(categoryA) - 1);
    }
  }
View Full Code Here

   */
  public void test_CategoryMoveCommand_moveBeforeItself() throws Exception {
    // add Category
    DeviceManager.commandsAdd(new CategoryAddCommand("catA", "a"));
    DeviceManager.commandsAdd(new CategoryAddCommand("catB", "b"));
    CategoryInfo categoryA = DeviceManager.getCategory("catA");
    CategoryInfo categoryB = DeviceManager.getCategory("catB");
    // ignored - move before itself
    DeviceManager.commandsAdd(new CategoryMoveCommand(categoryA, categoryA));
    // original order
    {
      List<CategoryInfo> categories = DeviceManager.getCategories();
View Full Code Here

   */
  public void test_CategoryMoveCommand_moveToTheEnd() throws Exception {
    // add Category
    DeviceManager.commandsAdd(new CategoryAddCommand("catA", "a"));
    DeviceManager.commandsAdd(new CategoryAddCommand("catB", "b"));
    CategoryInfo categoryA = DeviceManager.getCategory("catA");
    // original order
    {
      List<CategoryInfo> categories = DeviceManager.getCategories();
      assertEquals(categories.size() - 2, categories.indexOf(categoryA));
    }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.mobile.device.model.CategoryInfo

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.