/** * @see IStructuredContentProvider#getElements(Object) */ public Object[] getElements(Object inputElement) { List list = new ArrayList(); IRuntime[] runtimes = ServerCore.getRuntimes(); if (runtimes != null) { int size = runtimes.length; for (int i = 0; i < size; i++) { if (!((Runtime)runtimes[i]).isPrivate()) list.add(runtimes[i]); } } return list.toArray(); }
/** * Returns an array of all known runtime instances of * the given runtime type. This convenience method filters the list of known * runtime ({@link ServerCore#getRuntimes()}) for ones with a matching * runtime type ({@link IRuntime#getRuntimeType()}). The array will not * contain any working copies. * <p> * A new array is returned on each call, so clients may store or modify the result. * </p> * * @param runtimeType the runtime type * @return a possibly-empty list of runtime instances {@link IRuntime} * of the given runtime type */ public static IRuntime[] getRuntimes(IRuntimeType runtimeType) { List list = new ArrayList(); IRuntime[] runtimes = ServerCore.getRuntimes(); if (runtimes != null) { int size = runtimes.length; for (int i = 0; i < size; i++) { if (runtimes[i].getRuntimeType() != null && runtimes[i].getRuntimeType().equals(runtimeType)) list.add(runtimes[i]); } } IRuntime[] r = new IRuntime[list.size()]; list.toArray(r); return r; }
public void fillTree() { clean(); List list = new ArrayList(); IRuntime[] runtimes = ServerCore.getRuntimes(); if (runtimes != null) { int size = runtimes.length; for (int i = 0; i < size; i++) { IRuntimeType runtimeType = runtimes[i].getRuntimeType(); try { TreeElement ele = getOrCreate(list, runtimeType.getVendor()); ele.contents.add(runtimes[i]); elementToParentMap.put(runtimes[i], ele); } catch (Exception e) { Trace.trace(Trace.WARNING, "Error in runtime content provider", e); } } } elements = list.toArray(); } }
org.eclipse.wst.server.core.IRuntime[] rts = ServerCore.getRuntimes();
IRuntime wc = (IRuntime) iterator2.next(); IRuntime[] runtimes = ServerCore.getRuntimes(); if (runtimes != null) { int size = runtimes.length;