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

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


  // Execution
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    CategoryInfo category = DeviceManager.getCategory(m_id);
    if (category == null) {
      return;
    }
    // don't move before itself, this is no-op
    if (m_id.equals(m_nextCategoryId)) {
      return;
    }
    // remove source
    List<CategoryInfo> categories = DeviceManager.getCategories();
    categories.remove(category);
    // add to new location
    CategoryInfo nextCategory = DeviceManager.getCategory(m_nextCategoryId);
    if (nextCategory != null) {
      int index = categories.indexOf(nextCategory);
      categories.add(index, category);
    } else {
      categories.add(category);
View Full Code Here


  // Execute
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    CategoryInfo category = DeviceManager.getCategory(m_id);
    if (category != null) {
      category.setName(m_name);
    }
  }
View Full Code Here

  // Execute
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    CategoryInfo category = new CategoryInfo(m_id, m_name);
    DeviceManager.getCategories().add(category);
  }
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    DeviceInfo device = DeviceManager.getDevice(m_id);
    CategoryInfo category = DeviceManager.getCategory(m_categoryId);
    if (device == null || category == null) {
      return;
    }
    // don't move before itself, this is no-op
    if (m_id.equals(m_nextDeviceId)) {
      return;
    }
    // remove source entry
    device.getCategory().removeDevice(device);
    // add to new location
    DeviceInfo nextDevice = DeviceManager.getDevice(m_nextDeviceId);
    if (nextDevice != null) {
      int index = category.getDevices().indexOf(nextDevice);
      category.addDevice(index, device);
    } else {
      category.addDevice(device);
    }
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    // try category
    {
      CategoryInfo category = DeviceManager.getCategory(m_id);
      if (category != null) {
        category.setVisible(m_visible);
      }
    }
    // try device
    {
      DeviceInfo device = DeviceManager.getDevice(m_id);
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    ExecutionUtils.runIgnore(new RunnableEx() {
      public void run() throws Exception {
        CategoryInfo category = DeviceManager.getCategory(m_categoryId);
        if (category != null) {
          Image image = SwtResourceManager.getImage(m_imagePath);
          category.addDevice(new DeviceInfo(m_id, m_name, m_imagePath, image, m_displayBounds));
        }
      }
    });
  }
View Full Code Here

  // Execution
  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public void execute() {
    CategoryInfo category = DeviceManager.getCategory(m_id);
    if (category != null) {
      DeviceManager.getCategories().remove(category);
    }
  }
View Full Code Here

        public void run() throws Exception {
          // load from plugins
          List<IConfigurationElement> categoryElements =
              ExternalFactoriesHelper.getElements(POINT_DEVICES, "category");
          for (IConfigurationElement categoryElement : categoryElements) {
            CategoryInfo category = new CategoryInfo(categoryElement);
            // add this category
            m_caterogies.add(category);
            // add devices
            for (IConfigurationElement deviceElement : categoryElement.getChildren("device")) {
              category.addDevice(new DeviceInfo(deviceElement));
            }
          }
          // apply commands
          commandsApply();
        }
View Full Code Here

      }

      @Override
      public String getText(Object element) {
        if (element instanceof CategoryInfo) {
          CategoryInfo category = (CategoryInfo) element;
          return category.getName();
        } else if (element instanceof DeviceInfo) {
          DeviceInfo device = (DeviceInfo) element;
          return device.getName()
              + "     -     "
              + device.getDisplayBounds().width
View Full Code Here

   * 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

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.