Examples of ISourceContainerBrowser


Examples of org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser

      ISourceContainer alreadyCreatedContainer,
      final ISourceLookupDirector director) {
    if (type == null) {
      return null;
    }
    final ISourceContainerBrowser browser = DebugUITools.getSourceContainerBrowser(type.getId());
    if (browser == null) {
      return null;
    }
    abstract class ActionBase implements ConfigureButtonAction {
      public ISourceContainer run(Shell shell) {
        ISourceContainer[] containers = runImpl(shell);
        if (containers.length != 1) {
          return null;
        }
        return containers[0];
      }
      abstract ISourceContainer[] runImpl(Shell shell);
    }
    ISourceContainer[] containers;
    if (alreadyCreatedContainer != null && alreadyCreatedContainer.getType().equals(type)) {
      // Edit existing.
      final ISourceContainer[] alreadyCreatedContainerArray = { alreadyCreatedContainer };
      if (browser.canEditSourceContainers(director, alreadyCreatedContainerArray)) {
        return new ActionBase() {
          @Override ISourceContainer[] runImpl(Shell shell) {
            return browser.editSourceContainers(shell, director, alreadyCreatedContainerArray);
          }
        };
      }
    }
    // Add new.
    if (browser.canAddSourceContainers(director)) {
      return new ActionBase() {
        @Override ISourceContainer[] runImpl(Shell shell) {
          return browser.addSourceContainers(shell, director);
        }
      };
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser

  private List<ISourceContainerType> filterTypes(ISourceContainerType[] types){
    ArrayList<ISourceContainerType> result = new ArrayList<ISourceContainerType>();
    for (int i = 0; i< types.length; i++) {
      ISourceContainerType type = types[i];
      if (director.supportsSourceContainerType(type)) {
        ISourceContainerBrowser sourceContainerBrowser =
            DebugUITools.getSourceContainerBrowser(type.getId());
        if(sourceContainerBrowser != null &&
            sourceContainerBrowser.canAddSourceContainers(director)) {
          result.add(type);
        }
      }
    }
    return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.