Package org.rssowl.ui.internal.dialogs.properties

Examples of org.rssowl.ui.internal.dialogs.properties.EntityPropertyPageWrapper


      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(3, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page2Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage2"))
          page2Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page2Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.compareTo(page2Wrapper) == -1);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page2Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 2: Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(2, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 3 : Mixed Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);
      entities.add(entity3);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(1, pages.size());

      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page3Wrapper);

      assertEquals(true, page3Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page3Wrapper.getTargetEntities().contains(IFeed.class));
    }
  }
View Full Code Here


      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(3, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page2Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage2"))
          page2Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page2Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.compareTo(page2Wrapper) == -1);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page2Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 2: Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(2, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 3 : Mixed Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);
      entities.add(entity3);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(1, pages.size());

      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page3Wrapper);

      assertEquals(true, page3Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page3Wrapper.getTargetEntities().contains(IFeed.class));
    }
  }
View Full Code Here

        List<Class<?>> targetEntities = new ArrayList<Class<?>>();
        IConfigurationElement[] entityTargets = element.getChildren("targetEntity");
        for (IConfigurationElement entityTarget : entityTargets)
          targetEntities.add(Class.forName(entityTarget.getAttribute("class")));

        pages.add(new EntityPropertyPageWrapper(id, element, targetEntities, name, order, handlesMultipleEntities));
      } catch (ClassNotFoundException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
    }
View Full Code Here

        List<Class<?>> targetEntities = new ArrayList<Class<?>>();
        IConfigurationElement[] entityTargets = element.getChildren("targetEntity");
        for (IConfigurationElement entityTarget : entityTargets)
          targetEntities.add(Class.forName(entityTarget.getAttribute("class")));

        pages.add(new EntityPropertyPageWrapper(id, element, targetEntities, name, order, handlesMultipleEntities));
      } catch (ClassNotFoundException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
    }
View Full Code Here

        List<Class<?>> targetEntities = new ArrayList<Class<?>>();
        IConfigurationElement[] entityTargets = element.getChildren("targetEntity"); //$NON-NLS-1$
        for (IConfigurationElement entityTarget : entityTargets)
          targetEntities.add(Class.forName(entityTarget.getAttribute("class"))); //$NON-NLS-1$

        pages.add(new EntityPropertyPageWrapper(id, element, targetEntities, name, order, handlesMultipleEntities));
      } catch (ClassNotFoundException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
    }
View Full Code Here

        List<Class<?>> targetEntities = new ArrayList<Class<?>>();
        IConfigurationElement[] entityTargets = element.getChildren("targetEntity"); //$NON-NLS-1$
        for (IConfigurationElement entityTarget : entityTargets)
          targetEntities.add(Class.forName(entityTarget.getAttribute("class"))); //$NON-NLS-1$

        pages.add(new EntityPropertyPageWrapper(id, element, targetEntities, name, order, handlesMultipleEntities));
      } catch (ClassNotFoundException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
    }
View Full Code Here

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(3, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page2Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage2"))
          page2Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page2Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.compareTo(page2Wrapper) == -1);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page2Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 2: Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(2, pages.size());

      EntityPropertyPageWrapper page1Wrapper = null;
      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage1"))
          page1Wrapper = page;
        else if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page1Wrapper);
      assertNotNull(page3Wrapper);

      assertEquals(true, page1Wrapper.getTargetEntities().contains(ILabel.class));
    }

    /* Case 3 : Mixed Multi Selection */
    {
      List<IEntity> entities = new ArrayList<IEntity>();
      entities.add(entity1);
      entities.add(entity2);
      entities.add(entity3);

      Set<EntityPropertyPageWrapper> pages = Controller.getDefault().getEntityPropertyPagesFor(entities);

      assertNotNull(pages);
      assertEquals(1, pages.size());

      EntityPropertyPageWrapper page3Wrapper = null;
      for (EntityPropertyPageWrapper page : pages) {
        if (page.getName().equals("TestPage3"))
          page3Wrapper = page;
      }

      assertNotNull(page3Wrapper);

      assertEquals(true, page3Wrapper.getTargetEntities().contains(ILabel.class));
      assertEquals(true, page3Wrapper.getTargetEntities().contains(IFeed.class));
    }
  }
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.dialogs.properties.EntityPropertyPageWrapper

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.