public PropertySourceTableView(Class<?> beanType) {
   this(beanType.getName());
   try {
     this.exemplar = new BeanPropertySource(null, beanType);
   } catch (IntrospectionException e) {
     Activator.getLogger()
         .warning("Failed to create BeanPropertySource for " + beanType.getName() + ". " + e, e);
   }
 }
示例#2
0
 public IPropertySource getPropertySource() {
   if (propertySource == null) {
     try {
       propertySource = createPropertySource();
     } catch (IntrospectionException e) {
       Activator.getLogger().warning("Failed to create PropertySource for " + this + ". " + e, e);
     }
   }
   return propertySource;
 }
示例#3
0
 @Override
 public IPropertySource getPropertySource(Object object) {
   // avoid infinite recursion!
   if (object != null && object != this) {
     // System.out.println("====== warning getPropertySource() asked for: " + object + " of class:
     // "+ object.getClass());
     return null;
   }
   if (object == null) {
     return null;
   }
   if (propertySource == null) {
     try {
       propertySource = createPropertySource();
     } catch (Exception e) {
       Activator.getLogger().warning(e);
     }
   }
   return propertySource;
 }
  @Override
  public void setInput(IWorkbenchPart part, ISelection selection) {
    if (part == getPart() && selection == getSelection()) {
      return;
    }
    super.setInput(part, selection);
    if (page != null) {
      page.getControl().removeControlListener(controlListener);
      aboutToBeHidden();
      page.dispose();
      page.getControl().dispose();
      page = null;
    }
    Object first = Selections.getFirstSelection(selection);
    if (first == null) {
      return;
    }
    page = createPage(first);
    if (page != null) {
      if (page instanceof IPageBookViewPage) {
        try {
          ((IPageBookViewPage) page).init(parentPage.getSite());
        } catch (PartInitException e) {
          Activator.getDefault().getLog().log(e.getStatus());
        }
      }
      page.createControl(container);
      FormData data = new FormData();
      data.left = new FormAttachment(0, 0);
      data.right = new FormAttachment(100, 0);
      data.top = new FormAttachment(0, 0);
      data.bottom = new FormAttachment(100, 0);
      page.getControl().setLayoutData(data);

      page.getControl().addControlListener(controlListener);
    }

    container.layout(true, true);
    parentPage.resizeScrolledComposite();
  }