Package rabbit.ui.internal.util

Examples of rabbit.ui.internal.util.PageDescriptor


    contentProvider = new PageDescriptorContentProvider();
  }

  @Test
  public void testHashChildren() throws Exception {
    PageDescriptor des = new PageDescriptor("", "", page, "", null, null);
    assertFalse(contentProvider.hasChildren(des));
   
    des.getChildren().add(des);
    assertTrue(contentProvider.hasChildren(des));
   
    assertFalse(contentProvider.hasChildren(new Object()));
  }
View Full Code Here


    assertFalse(contentProvider.hasChildren(new Object()));
  }
 
  @Test
  public void testGetElements() throws Exception {
    PageDescriptor des = new PageDescriptor("", "", page, "", null, null);
    Object[] elements = contentProvider.getElements(Arrays.asList(des));
    assertEquals(1, elements.length);
    assertEquals(des, elements[0]);
  }
View Full Code Here

    assertEquals(des, elements[0]);
  }
 
  @Test
  public void testGetChildren() throws Exception {
    PageDescriptor des = new PageDescriptor("", "", page, "", null, null);
    assertNotNull(contentProvider.getChildren(des));
    assertEquals(0, contentProvider.getChildren(des).length);
   
    des.getChildren().add(des);
    assertEquals(1, contentProvider.getChildren(des).length);
    assertEquals(des, contentProvider.getChildren(des)[0]);
  }
View Full Code Here

    labelProvider = new PageDescriptorLabelProvider();
  }
 
  @Test
  public void testGetImage() throws Exception {
    PageDescriptor des = new PageDescriptor("", "", page, "", null, null);
    assertNull(labelProvider.getImage(des));
   
    // A page with image:
    des = new PageDescriptor("", "", page, "", SharedImages.CALENDAR, null);
    assertNotNull(labelProvider.getImage(des));
  }
View Full Code Here

    assertNotNull(labelProvider.getImage(des));
  }
 
  @Test
  public void testGetText() throws Exception {
    PageDescriptor des = new PageDescriptor("", "name", page, "", null, null);
    assertEquals(des.getName(), labelProvider.getText(des));
  }
View Full Code Here

    assertEquals(des.getName(), labelProvider.getText(des));
  }
 
  @Test
  public void testGetToolTipText() throws Exception {
    PageDescriptor des = new PageDescriptor("", "", page, "toolTipText", null, null);
    assertEquals(des.getDescription(), labelProvider.getToolTipText(des));
  }
View Full Code Here

  public Image getImage(Object element) {
    if (!(element instanceof PageDescriptor)) {
      return null;
    }
   
    PageDescriptor page = (PageDescriptor) element;
    if (page.getImage() == null) {
      return null;
    }
    Image image = images.get(page.getName());
    if (image == null) {
      image = page.getImage().createImage();
      images.put(page.getName(), image);
    }
    return image;
  }
View Full Code Here

          if (image == null) {
            image = PlatformUI.getWorkbench().getSharedImages()
                .getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT);
          }
          IPage page = (IPage) o;
          pages.add(new PageDescriptor(id, name, page, desc, image, parent));
        }
      });

    }
View Full Code Here

TOP

Related Classes of rabbit.ui.internal.util.PageDescriptor

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.