Package org.eclipse.debug.core.sourcelookup

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


    }

    @Override
    public ISourceContainerType getType() {
        // FIXME implement this properly!
        return new ISourceContainerType() {

            @Override
            public String getMemento(final ISourceContainer container)
                    throws CoreException {
                return null;
View Full Code Here


      public ISourceContainerType getValue() {
        return elements.getContainerTypeCombo().getSelected();
      }
      {
        if (initialParams != null) {
          ISourceContainerType type = initialParams.getContainer().getType();
          elements.getContainerTypeCombo().setSelected(type);
        }
        final ValueSource<ISourceContainerType> updatableThis = this;
        SelectionListener listener = new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            updater.reportChanged(updatableThis);
            updater.update();
          }
        };
        elements.getContainerTypeCombo().addSelectionListener(listener);
      }
    };
    updater.addSource(rootScope, selectedTypeValue);

    // Represents "Configure" button that acts like a container factory.
    final ValueProcessor<ISourceContainer> containerFactoryButtonValue =
        new ValueProcessor<ISourceContainer>() {
      private ConfigureButtonAction preparedAction = null;
      {
        if (initialParams != null) {
          setCurrentValue(initialParams.getContainer());
        }
        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);
View Full Code Here

  };

  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);
        }
      }
View Full Code Here

        subContainerMemento = parser.nextComponent();
      } catch (MementoFormat.ParserException e) {
        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

      ISourceContainer[] common = getCommonSourceLookupDirector().getSourceContainers();
      ISourceContainer[] containers = new ISourceContainer[common.length];
     
      for (int i = 0; i < common.length; i++) {
        ISourceContainer container = common[i];
        ISourceContainerType type = container.getType();
        // Clone the container to make sure that the original can be safely disposed.
        container = type.createSourceContainer(type.getMemento(container));
        containers[i] = container;
      }
      return containers;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.sourcelookup.ISourceContainerType

Copyright © 2018 www.massapicom. 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.