org.eclipse.core.internal.runtime.AdapterManager.getAdapter()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中org.eclipse.core.internal.runtime.AdapterManager.getAdapter()方法的一些代码示例,展示了AdapterManager.getAdapter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AdapterManager.getAdapter()方法的具体详情如下:
包路径:org.eclipse.core.internal.runtime.AdapterManager
类名称:AdapterManager
方法名:getAdapter

AdapterManager.getAdapter介绍

[英]Returns an adapter of the given type for the provided adapter.
[中]为提供的适配器返回给定类型的适配器。

代码示例

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public Object loadAdapter(Object adaptable, String adapterTypeName) {
  return getAdapter(adaptable, adapterTypeName, true);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public Object loadAdapter(Object adaptable, String adapterTypeName) {
  return getAdapter(adaptable, adapterTypeName, true);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public Object loadAdapter(Object adaptable, String adapterTypeName) {
  return getAdapter(adaptable, adapterTypeName, true);
}

代码示例来源:origin: org.eclipse.equinox/common

public Object loadAdapter(Object adaptable, String adapterTypeName) {
  return getAdapter(adaptable, adapterTypeName, true);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public Object getAdapter(Object adaptable, String adapterType) {
  Assert.isNotNull(adaptable);
  Assert.isNotNull(adapterType);
  return getAdapter(adaptable, adapterType, false);
}

代码示例来源:origin: org.eclipse.equinox/common

public Object getAdapter(Object adaptable, String adapterType) {
  Assert.isNotNull(adaptable);
  Assert.isNotNull(adapterType);
  return getAdapter(adaptable, adapterType, false);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public Object getAdapter(Object adaptable, String adapterType) {
  Assert.isNotNull(adaptable);
  Assert.isNotNull(adapterType);
  return getAdapter(adaptable, adapterType, false);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public Object getAdapter(Object adaptable, String adapterType) {
  Assert.isNotNull(adaptable);
  Assert.isNotNull(adapterType);
  return getAdapter(adaptable, adapterType, false);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

/**
   * Returns an object which is an instance of the given class
   * associated with this object. Returns <code>null</code> if
   * no such object can be found.
   * <p>
   * This implementation of the method declared by <code>IAdaptable</code>
   * passes the request along to the platform's adapter manager; roughly
   * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
   * Subclasses may override this method (however, if they do so, they
   * should invoke the method on their superclass to ensure that the
   * Platform's adapter manager is consulted).
   * </p>
   *
   * @param adapter the class to adapt to
   * @return the adapted object or <code>null</code>
   * @see IAdaptable#getAdapter(Class)
   */
  @Override
  public <T> T getAdapter(Class<T> adapter) {
    return AdapterManager.getDefault().getAdapter(this, adapter);
  }
}

代码示例来源:origin: org.eclipse.equinox/common

/**
   * Returns an object which is an instance of the given class
   * associated with this object. Returns <code>null</code> if
   * no such object can be found.
   * <p>
   * This implementation of the method declared by <code>IAdaptable</code>
   * passes the request along to the platform's adapter manager; roughly
   * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
   * Subclasses may override this method (however, if they do so, they
   * should invoke the method on their superclass to ensure that the
   * Platform's adapter manager is consulted).
   * </p>
   *
   * @param adapter the class to adapt to
   * @return the adapted object or <code>null</code>
   * @see IAdaptable#getAdapter(Class)
   */
  public Object getAdapter(Class adapter) {
    return AdapterManager.getDefault().getAdapter(this, adapter);
  }
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

/**
   * Returns an object which is an instance of the given class
   * associated with this object. Returns <code>null</code> if
   * no such object can be found.
   * <p>
   * This implementation of the method declared by <code>IAdaptable</code>
   * passes the request along to the platform's adapter manager; roughly
   * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
   * Subclasses may override this method (however, if they do so, they
   * should invoke the method on their superclass to ensure that the
   * Platform's adapter manager is consulted).
   * </p>
   *
   * @param adapter the class to adapt to
   * @return the adapted object or <code>null</code>
   * @see IAdaptable#getAdapter(Class)
   */
  public Object getAdapter(Class adapter) {
    return AdapterManager.getDefault().getAdapter(this, adapter);
  }
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

/**
   * Returns an object which is an instance of the given class
   * associated with this object. Returns <code>null</code> if
   * no such object can be found.
   * <p>
   * This implementation of the method declared by <code>IAdaptable</code>
   * passes the request along to the platform's adapter manager; roughly
   * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
   * Subclasses may override this method (however, if they do so, they
   * should invoke the method on their superclass to ensure that the
   * Platform's adapter manager is consulted).
   * </p>
   *
   * @param adapter the class to adapt to
   * @return the adapted object or <code>null</code>
   * @see IAdaptable#getAdapter(Class)
   */
  @Override
  public <T> T getAdapter(Class<T> adapter) {
    return AdapterManager.getDefault().getAdapter(this, adapter);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

private static Object queryAdapterManager(Object sourceObject, String adapterId, boolean allowActivation) {
    Object result;
    if (allowActivation) {
      result = AdapterManager.getDefault().loadAdapter(sourceObject, adapterId);
    } else {
      result = AdapterManager.getDefault().getAdapter(sourceObject, adapterId);
    }
    return result;
  }
}

相关文章