Examples of CategoryInfo


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

   * Edits device element.
   */
  private void onEdit() {
    Object element = getSelectedElements().get(0);
    if (element instanceof CategoryInfo) {
      CategoryInfo category = (CategoryInfo) element;
      InputDialog inputDialog =
          new InputDialog(getShell(),
              "Category",
              "Enter new category name:",
              category.getName(),
              null);
      // execute dialog
      if (inputDialog.open() == Window.OK) {
        commands_add(new CategoryNameCommand(category, inputDialog.getValue()));
      }
View Full Code Here

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

  /**
   * Adds new {@link DeviceInfo}.
   */
  private void onAddDevice() {
    final CategoryInfo targetCategory;
    {
      Object element = getSelectedElements().get(0);
      if (element instanceof CategoryInfo) {
        targetCategory = (CategoryInfo) element;
      } else if (element instanceof DeviceInfo) {
View Full Code Here

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

  private void onMove(int delta) {
    m_viewer.getTree().setRedraw(false);
    try {
      for (Object element : getSelectedElements()) {
        if (element instanceof CategoryInfo) {
          CategoryInfo category = (CategoryInfo) element;
          List<CategoryInfo> categories = DeviceManager.getCategories();
          int index = categories.indexOf(element);
          int targetIndex = index + delta;
          CategoryInfo nextCategory =
              targetIndex < categories.size() ? (CategoryInfo) categories.get(targetIndex) : null;
          commands_add(new CategoryMoveCommand(category, nextCategory));
        } else if (element instanceof DeviceInfo) {
          DeviceInfo device = (DeviceInfo) element;
          CategoryInfo category = device.getCategory();
          List<DeviceInfo> devices = category.getDevices();
          int index = devices.indexOf(device);
          if (index + delta < devices.size()) {
            commands_add(new DeviceMoveCommand(device, category, devices.get(index + delta)));
          } else {
            commands_add(new DeviceMoveCommand(device, category, null));
View Full Code Here

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

        int location = getCurrentLocation();
        if (m_dragCategory) {
          Assert.instanceOf(CategoryInfo.class, target);
          Assert.isTrue(location == LOCATION_BEFORE || location == LOCATION_AFTER);
          // prepare next category
          CategoryInfo nextCategory;
          {
            List<CategoryInfo> categories = DeviceManager.getCategories();
            int index = categories.indexOf(target);
            if (location == LOCATION_BEFORE) {
              nextCategory = categories.get(index);
            } else {
              nextCategory = GenericsUtils.getNextOrNull(categories, index);
            }
          }
          // add commands
          for (Object element : m_dragElements) {
            CategoryInfo category = (CategoryInfo) element;
            commands_add(new CategoryMoveCommand(category, nextCategory));
          }
        } else if (target instanceof CategoryInfo) {
          Assert.isTrue(location == LOCATION_ON);
          CategoryInfo targetCategory = (CategoryInfo) target;
          for (Object element : m_dragElements) {
            DeviceInfo device = (DeviceInfo) element;
            commands_add(new DeviceMoveCommand(device, targetCategory, null));
          }
        } else {
          DeviceInfo targetDevice = (DeviceInfo) target;
          CategoryInfo targetCategory = targetDevice.getCategory();
          // prepare next device
          DeviceInfo nextDevice;
          {
            List<DeviceInfo> entries = targetCategory.getDevices();
            int index = entries.indexOf(targetDevice);
            if (location == LOCATION_BEFORE) {
              nextDevice = entries.get(index);
            } else {
              nextDevice = GenericsUtils.getNextOrNull(entries, index);
View Full Code Here

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

      // work with Bundle
      {
        List<CategoryInfo> categories = DeviceManager.getCategories();
        assertThat(categories.size()).isGreaterThan(1);
        {
          CategoryInfo category = DeviceManager.getCategory("catA");
          assertEquals("catA", category.getId());
          assertEquals("Category A", category.getName());
          {
            List<DeviceInfo> devices = category.getDevices();
            assertThat(devices).hasSize(2);
            // devA
            {
              DeviceInfo device = devices.get(0);
              assertTrue(device.isContributed());
View Full Code Here

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

  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)
      DeviceManager.commandsAdd(new ElementVisibilityCommand(category, true));
      // hide
      DeviceManager.commandsAdd(new ElementVisibilityCommand(category, false));
      assertFalse(category.isVisible());
    }
    // reload
    DeviceManager.commandsWrite();
    DeviceManager.forceReload();
    // still hidden
    {
      CategoryInfo category = DeviceManager.getCategory("newCat");
      assertFalse(category.isVisible());
    }
  }
View Full Code Here

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

      assertFalse(category.isVisible());
    }
  }

  public void test_ElementVisibilityCommand_Device() throws Exception {
    CategoryInfo category = DeviceManager.getCategories().get(0);
    // add Device
    addDevice(category, "dev", "device");
    // visible initially
    {
      DeviceInfo device = DeviceManager.getDevice("dev");
View Full Code Here

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

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

Examples of com.jada.content.data.CategoryInfo

    if (sortBy == null) {
      sortBy = "";
    }
    ContentFilterBean contentFilterBeans[] = getContentFilterBeans(request);

    CategoryInfo categoryInfo = api.getCategory(catNaturalKey, topCatNaturalKey, pageSize, Constants.PAGE_NAV_COUNT, pageNum, sortBy, contentFilterBeans);
    return categoryInfo;
  }
View Full Code Here

Examples of com.jada.content.data.CategoryInfo

 
  public CategoryInfo[] getCategoryTitles() throws Exception {
    String topCatNaturalKey = getCategoryParameter(request, 2);
    String catNaturalKey = getCategoryParameter(request, 3);
   
    CategoryInfo categoryInfos[] = api.getCategoryTitles(catNaturalKey, topCatNaturalKey);
    return categoryInfos;
  }
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.