Package org.springframework.ide.eclipse.beans.ui.model.metadata

Examples of org.springframework.ide.eclipse.beans.ui.model.metadata.IBeanMetadataLabelProvider


  public void saveState(IMemento memento) {
  }

  public String getDescription(Object element) {
    if (element instanceof IBeanMetadata) {
      IBeanMetadataLabelProvider labelProvider = BeanMetadataUtils.getLabelProvider((IBeanMetadata) element);
      if (labelProvider != null) {
        labelProvider.getDescription(element);
      }
    }

    if (element instanceof IBeansProject) {
      return "Beans" // TODO Externalize string
View Full Code Here


  @Override
  protected Image getImage(Object element, Object parentElement) {
    Image image = null;
    if (element instanceof IBeanMetadata) {
      IBeanMetadataLabelProvider labelProvider = BeanMetadataUtils.getLabelProvider((IBeanMetadata) element);
      if (labelProvider != null) {
        image = labelProvider.getImage(element);
      }
    }

    if (element instanceof BeanMetadataNode) {
      return ((BeanMetadataNode) element).getImage();
View Full Code Here

  }

  @Override
  protected String getText(Object element, Object parentElement) {
    if (element instanceof IBeanMetadata) {
      IBeanMetadataLabelProvider labelProvider = BeanMetadataUtils.getLabelProvider((IBeanMetadata) element);
      if (labelProvider != null) {
        return labelProvider.getText(element);
      }
    }
    if (element instanceof BeanMetadataNode) {
      return ((BeanMetadataNode) element).getLabel();
    }
    else if (element instanceof ISourceModelElement) {
      INamespaceLabelProvider provider = NamespaceUtils.getLabelProvider((ISourceModelElement) element);
      IModelElement context = (parentElement instanceof IModelElement ? (IModelElement) parentElement : null);
      if (provider != null) {
        return provider.getText((ISourceModelElement) element, context, isDecorating());
      }
      else {
        return DEFAULT_NAMESPACE_LABEL_PROVIDER.getText((ISourceModelElement) element, context, isDecorating());
      }
    }
    else if (element instanceof IModelElement) {
      return BeansModelLabels.getElementLabel((IModelElement) element, 0);
    }
    else if (element instanceof ZipEntryStorage) {
      // create zip entry label right here as it is not a core model
      // element
      ZipEntryStorage storage = (ZipEntryStorage) element;
      StringBuilder builder = new StringBuilder();
      builder.append(storage.getFullPath().lastSegment());
      builder.append(" - ");
      builder.append(storage.getFile().getProjectRelativePath().toString());
      builder.append("!");
      builder.append(storage.getFullPath().removeLastSegments(1).toString());
      return builder.toString();
    }
    else if (element instanceof BeanClassReferences) {
      return BeansUIPlugin.getResourceString("BeanClassReferences.label");
    }
    else if (element instanceof BeanMetadataReference) {
      IBeanMetadataLabelProvider labelProvider = BeanMetadataUtils.getLabelProvider((BeanMetadataReference) element);
      if (labelProvider != null) {
        return labelProvider.getText(element);
      }
    }
    return super.getText(element, parentElement);
  }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.ui.model.metadata.IBeanMetadataLabelProvider

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.