Examples of ISourceContainer


Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

  @Override
  public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
    //IProject project = XVRUtils.getActiveProject();
    String name = configuration.getAttribute(XVRConstants.XVR_LAUNCH_CONFIG_PROJECT_NAME_KEY, (String)null);
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
    ISourceContainer sourceContainer = null;
    if(project.exists()){
      sourceContainer = new ProjectSourceContainer(project, false);
    }else{
      sourceContainer = new WorkspaceSourceContainer();
    }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

      //add exsits source containers
      for (ISourceContainer container : existContainers) {
        realContainers.add(container);
      }
      //check default source container
      ISourceContainer defaultContainer = new DefaultSourceContainer();
      if (!contains(existContainers, defaultContainer)) {
        realContainers.add(defaultContainer);
      }

      for (IProject dependency : projs) {
        // handle projects in current workspace
        ISourceContainer newContainer = new JavaProjectSourceContainer(
            JavaCore.create((IProject) dependency));
        if (!contains(existContainers, newContainer)) {
          realContainers.add(newContainer);
        }
      }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

      //add exsits source containers
      for (ISourceContainer container : existContainers) {
        realContainers.add(container);
      }
      //check default source container
      ISourceContainer defaultContainer = new DefaultSourceContainer();
      if (!contains(existContainers, defaultContainer)) {
        realContainers.add(defaultContainer);
      }

      for (IProject dependency : projs) {
        // handle projects in current workspace
        ISourceContainer newContainer = new JavaProjectSourceContainer(
            JavaCore.create((IProject) dependency));
        if (!contains(existContainers, newContainer)) {
          realContainers.add(newContainer);
        }
      }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

      //add exsits source containers
      for (ISourceContainer container : existContainers) {
        realContainers.add(container);
      }
      //check default source container
      ISourceContainer defaultContainer = new DefaultSourceContainer();
      if (!contains(existContainers, defaultContainer)) {
        realContainers.add(defaultContainer);
      }

      for (IProject dependency : projs) {
        // handle projects in current workspace
        ISourceContainer newContainer = new JavaProjectSourceContainer(
            JavaCore.create((IProject) dependency));
        if (!contains(existContainers, newContainer)) {
          realContainers.add(newContainer);
        }
      }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

      //add exsits source containers
      for (ISourceContainer container : existContainers) {
        realContainers.add(container);
      }
      //check default source container
      ISourceContainer defaultContainer = new DefaultSourceContainer();
      if (!contains(existContainers, defaultContainer)) {
        realContainers.add(defaultContainer);
      }

      for (IProject dependency : projs) {
        // handle projects in current workspace
        ISourceContainer newContainer = new JavaProjectSourceContainer(
            JavaCore.create((IProject) dependency));
        if (!contains(existContainers, newContainer)) {
          realContainers.add(newContainer);
        }
      }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

        final ValueSource<ISourceContainer> valueSourceThis = this;
        elements.getConfigureButton().addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (preparedAction != null) {
              ISourceContainer value = preparedAction.run(elements.getShell());
              if (value != null) {
                setCurrentValue(value);
              }
              updater.reportChanged(valueSourceThis);
              updater.update();
              updateAction();
            }
          }
        });
      }
      public void update(Updater updater) {
        if (getValue() != null && !getValue().getType().equals(selectedTypeValue.getValue())) {
          setCurrentValue(null);
          updater.reportChanged(this);
        }
        updateAction();
      }
      private void updateAction() {
        preparedAction = SourceNameMapperContainerDialog.prepareConfigureAction(
            selectedTypeValue.getValue(), getValue(), director);
        elements.getConfigureButton().setEnabled(preparedAction != null);
      }
    };
    updater.addSource(rootScope, containerFactoryButtonValue);
    updater.addConsumer(rootScope, containerFactoryButtonValue);
    updater.addDependency(containerFactoryButtonValue, selectedTypeValue);

    // Represents printer that shows type and name of the created container.
    ValueConsumer showContainerTypeValue = new ValueConsumer() {
      public void update(Updater updater) {
        ISourceContainer container = containerFactoryButtonValue.getValue();
        String status;
        Image image;
        String name;
        boolean enabled;
        if (container == null) {
          status = Messages.SourceNameMapperContainerDialog_NOTHING_CONFIGURED;
          name = ""; //$NON-NLS-1$
          image = null;
          enabled = false;
        } else {
          status = Messages.SourceNameMapperContainerDialog_CONFIGURED_CONTAINER;
          ISourceContainerType type = container.getType();
          name = container.getName();
          image = DebugUITools.getSourceContainerImage(type.getId());
          enabled = true;
        }
        ContainerStatusGroup group = elements.getContainerStatusGroup();
        group.getStatusLabel().setText(status);
        group.getTypeImageLabel().setImage(image);
        group.getContainerNameLabel().setText(name);
        group.setEnabled(enabled);
        group.layout();
      }
    };
    updater.addConsumer(rootScope, showContainerTypeValue);
    updater.addDependency(showContainerTypeValue, containerFactoryButtonValue);

    // Represents possible warning about unsupported container.
    ValueProcessor<String> unsupportedContainerWarning = createProcessor(new Gettable<String>() {
      @Override
      public String getValue() {
        ISourceContainer container = containerFactoryButtonValue.getValue();
        if (container == null) {
          return null;
        }
        if (ReverseSourceLookup.isGoodTargetContainer(container)) {
          return null;
        }
        return Messages.SourceNameMapperContainerDialogLogic_TARGET_CONTAINER_NOT_SUPPORTED0;
      }
    });
    updater.addSource(rootScope, unsupportedContainerWarning);
    updater.addConsumer(rootScope, unsupportedContainerWarning);
    updater.addDependency(unsupportedContainerWarning, containerFactoryButtonValue);
    warningSources.add(unsupportedContainerWarning);

    // Represents expression that constructs dialog window result.
    final ValueProcessor<? extends Optional<Result>> resultValue =
        new ExpressionProcessor<Result>(
            Arrays.<ValueSource<? extends Optional<?>>>asList(prefixValue) ) {
          @Override
          protected Optional<Result> calculateNormal() {
            final String prefix = prefixValue.getValue().getNormal();
            final ISourceContainer container = containerFactoryButtonValue.getValue();
            if (container == null) {
              return createErrorOptional(
                  new Message(Messages.SourceNameMapperContainerDialog_CONFIGURE_TARGET_CONTAINER,
                      MessagePriority.BLOCKING_INFO));
            }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

    dialog.open();
    SourceNameMapperContainerDialog.Result dialogResult = dialog.getResult();
    if (dialogResult == null) {
      return new ISourceContainer[0];
    }
    ISourceContainer result = new SourceNameMapperContainer(dialogResult.getResultPrefix(),
        dialogResult.getResultContainer());
    return new ISourceContainer[] { result };
  }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

        throw new CoreException(new Status(IStatus.ERROR,
            ChromiumDebugPlugin.PLUGIN_ID, "Failed to parse memento", e)); //$NON-NLS-1$
      }
      ISourceContainerType subContainerType =
          DebugPlugin.getDefault().getLaunchManager().getSourceContainerType(typeId);
      ISourceContainer subContainer = subContainerType.createSourceContainer(subContainerMemento);
      return new SourceNameMapperContainer(prefix, subContainer);
    }
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

    IFile file = (IFile)input.getAdapter(IFile.class);
   
    // we store the context file to run in the ATTR_FILE
//    IFile file = CamelDebugRegistry.getInstance().getEntry(configuration).getEditorInput().getFile();
       
    ISourceContainer sourceContainer = null;
    if (file != null) {
      sourceContainer = new DirectorySourceContainer(file.getLocation().toFile().getParentFile(), true);
    }
   
    if (sourceContainer == null) {
      sourceContainer = new WorkspaceSourceContainer();
    }
   
    // Compute the source path for any java-based debug targets.
    ISourceContainer javaSourceContainers[] = computeJavaSourceContainers(configuration, monitor);
    ISourceContainer wsSourceContainers[] = computeWorkspaceSourceContainers(configuration, monitor);   
    ISourceContainer sourceContainers[] = new ISourceContainer[javaSourceContainers.length + wsSourceContainers.length + 1];
   
    System.arraycopy(javaSourceContainers, 0, sourceContainers, 0, javaSourceContainers.length);
    System.arraycopy(wsSourceContainers, 0, sourceContainers, javaSourceContainers.length, wsSourceContainers.length);
   
    sourceContainers[sourceContainers.length-1] = sourceContainer; 
View Full Code Here

Examples of org.eclipse.debug.core.sourcelookup.ISourceContainer

  private ISourceContainer[] computeWorkspaceSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
    IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    ISourceContainer[] containers = new ISourceContainer[projects.length];
   
    for (int i = 0; i < projects.length; i++) {
      ISourceContainer container = new ProjectSourceContainer(projects[i], false);
      containers[i] = container;
    }
    return containers;   
  }
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.