Package org.chromium.debug.ui.DialogUtils

Examples of org.chromium.debug.ui.DialogUtils.ValueConsumer


    updater.addSource(scope, checkerResultSource.getWarningSource());
    updater.addDependency(checkerResultSource, evaluatorValue);
    updater.addDependency(checkerResultSource, parsedPropertyNameValue);

    // Consumes diagnostic from above and sets it into a label.
    ValueConsumer checkerResultConsumer = new ValueConsumer() {
      @Override
      public void update(Updater updater) {
        elements.getPreviewDisplay().setText(checkerResultSource.getValue());
      }
    };
View Full Code Here


    updater.addSource(scope, previewValue);
    updater.addDependency(previewValue, previewRawResultValue);
    updater.addDependency(previewValue, singlePlanValue);

    // A simple consumer that sets preview data to the viewer.
    ValueConsumer v8PreviewInputSetter = new ValueConsumer() {
      public void update(Updater updater) {
        Optional<? extends LiveEditDiffViewer.Input> previewOptional = previewValue.getValue();
        LiveEditDiffViewer.Input viewerInput;
        if (previewOptional.isNormal()) {
          viewerInput = previewOptional.getNormal();
View Full Code Here

    updater.addSource(scope, checkerResultSource.getWarningSource());
    updater.addDependency(checkerResultSource, evaluatorValue);
    updater.addDependency(checkerResultSource, parsedPropertyNameValue);

    // Consumes diagnostic from above and sets it into a label.
    ValueConsumer checkerResultConsumer = new ValueConsumer() {
      @Override
      public void update(Updater updater) {
        elements.getPreviewDisplay().setText(checkerResultSource.getValue());
      }
    };
View Full Code Here

      // Defines button logic.
      protected abstract int getNewValue(int currentValue);
    }

    ValueConsumer lessController = new ButtonController(elements.getLessButton()) {
      @Override
      protected boolean isEnabled(int visiblePartSize) {
        return visiblePartSize > 1;
      }

      @Override
      protected int getNewValue(int currentValue) {
        return currentValue - 1;
      }
    };

    updater.addConsumer(updater.rootScope(), lessController);
    updater.addDependency(lessController, visiblePartSource);

    final int size = elements.getPathLabel().size();
    ValueConsumer moreController = new ButtonController(elements.getMoreButton()) {
      @Override
      protected boolean isEnabled(int visiblePartSize) {
        return visiblePartSize < size;
      }
View Full Code Here

    updater.addSource(scope, previewValue);
    updater.addDependency(previewValue, previewRawResultValue);
    updater.addDependency(previewValue, singlePlanValue);

    // A simple consumer that sets preview data to the viewer.
    ValueConsumer v8PreviewInputSetter = new ValueConsumer() {
      public void update(Updater updater) {
        Optional<? extends LiveEditDiffViewer.Input> previewOptional = previewValue.getValue();
        LiveEditDiffViewer.Input viewerInput;
        if (previewOptional.isNormal()) {
          viewerInput = previewOptional.getNormal();
View Full Code Here

    updater.addConsumer(rootScope, noSlashWarning);
    updater.addDependency(noSlashWarning, prefixValue);
    warningSources.add(noSlashWarning);

    // Represents prefix rule example printer.
    ValueConsumer prefixExample = new ValueConsumer() {
      public void update(Updater updater) {
        Optional<String> prefix = prefixValue.getValue();
        String line1;
        String line2;
        if (prefix.isNormal()) {
          String sampleFileName = Messages.SourceNameMapperContainerDialog_SAMPLE_FILE_NAME;
          line1 = NLS.bind(Messages.SourceNameMapperContainerDialog_EXAMPLE_1,
              prefix.getNormal() + sampleFileName);
          line2 = NLS.bind(Messages.SourceNameMapperContainerDialog_EXAMPLE_2, sampleFileName);
        } else {
          line1 = ""; //$NON-NLS-1$
          line2 = ""; //$NON-NLS-1$
        }
        elements.getPrefixExampleLine1Label().setText(line1);
        elements.getPrefixExampleLine2Label().setText(line2);
      }
    };
    updater.addConsumer(rootScope, prefixExample);
    updater.addDependency(prefixExample, prefixValue);

    // Represents container type combo box.
    final ValueSource<ISourceContainerType> selectedTypeValue =
        new ValueSource<ISourceContainerType>() {
      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;
View Full Code Here

TOP

Related Classes of org.chromium.debug.ui.DialogUtils.ValueConsumer

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.