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

Examples of com.google.gdt.eclipse.designer.mobile.device.command.CategoryAddCommand


   */
  private void onAddCategory() {
    InputDialog inputDialog =
        new InputDialog(getShell(), "New category", "Enter new category name:", "", null);
    if (inputDialog.open() == Window.OK) {
      commands_add(new CategoryAddCommand("category_" + System.currentTimeMillis(),
          inputDialog.getValue()));
    }
  }
View Full Code Here


  /**
   * Test for {@link ElementVisibilityCommand}.
   */
  public void test_ElementVisibilityCommand_Category() throws Exception {
    // add Category
    DeviceManager.commandsAdd(new CategoryAddCommand("newCat", "New category"));
    // visible initially
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertTrue(category.isVisible());
      // show (will be removed by second command)
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link CategoryAddCommand}.
   */
  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());
View Full Code Here

  /**
   * Test for {@link CategoryAddCommand}.
   */
  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());
View Full Code Here

  /**
   * Test for {@link CategoryNameCommand}.
   */
  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"));
View Full Code Here

  /**
   * Test for {@link CategoryRemoveCommand}.
   */
  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));
View Full Code Here

  /**
   * Test for {@link CategoryMoveCommand}.
   */
  public void test_CategoryMoveCommand() throws Exception {
    // add Category
    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");
View Full Code Here

  /**
   * Test for {@link CategoryMoveCommand}.
   */
  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
View Full Code Here

  /**
   * Test for {@link CategoryMoveCommand}.
   */
  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

  /**
   * Test for {@link CategoryMoveCommand}.
   */
  public void test_CategoryMoveCommand_noSource() 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 - we delete "categoryB" before executing command
    {
      CategoryMoveCommand command = new CategoryMoveCommand(categoryB, categoryA);
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.mobile.device.command.CategoryAddCommand

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.