コード例 #1
0
  /**
   * This returns NonPlayerCharacter.gif.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated not
   */
  @Override
  public Object getImage(Object object) {
    ManagedCharacter pc = (ManagedCharacter) object;

    ComposeableAdapterFactory factory =
        ((Shr5managementItemProviderAdapterFactory) this.adapterFactory).getRootAdapterFactory();
    if (factory != null && pc.getPersona() != null) {
      IItemLabelProvider labelprovider =
          (IItemLabelProvider) factory.adapt(pc.getPersona(), IItemLabelProvider.class);
      if (labelprovider != null) return labelprovider.getImage(pc.getPersona());
    }

    return overlayImage(object, getResourceLocator().getImage("full/obj16/NonPlayerCharacter"));
  }
コード例 #2
0
  /**
   * This returns the label text for the adapted class.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated not
   */
  @Override
  public String getText(Object object) {
    ManagedCharacter pc = (ManagedCharacter) object;
    if (pc.getPersona() != null) {
      ComposeableAdapterFactory factory =
          ((Shr5managementItemProviderAdapterFactory) this.adapterFactory).getRootAdapterFactory();
      IItemLabelProvider labelprovider =
          (IItemLabelProvider) factory.adapt(pc.getPersona(), IItemLabelProvider.class);

      if (labelprovider != null)
        return getString("_UI_NonPlayerCharacter_type")
            + " "
            + labelprovider.getText(pc.getPersona());
    }

    return getString("_UI_NonPlayerCharacter_type");
  }