Example #1
0
  public Object execute(ExecutionEvent event) throws ExecutionException {
    final StringBuilder sb = new StringBuilder();

    // Header
    final String[] headers = settings.getColumnHeaders();
    sb.append(headers[CoverageView.COLUMN_ELEMENT]).append(SWT.TAB);
    sb.append(headers[CoverageView.COLUMN_RATIO]).append(SWT.TAB);
    sb.append(headers[CoverageView.COLUMN_COVERED]).append(SWT.TAB);
    sb.append(headers[CoverageView.COLUMN_MISSED]).append(SWT.TAB);
    sb.append(headers[CoverageView.COLUMN_TOTAL]).append(Text.DELIMITER);

    // Rows:
    final IStructuredSelection selection = (IStructuredSelection) selectionSource.getSelection();
    for (final Object element : selection.toList()) {
      sb.append(converter.getElementName(element)).append(SWT.TAB);
      sb.append(converter.getRatio(element)).append(SWT.TAB);
      sb.append(converter.getCovered(element)).append(SWT.TAB);
      sb.append(converter.getMissed(element)).append(SWT.TAB);
      sb.append(converter.getTotal(element)).append(Text.DELIMITER);
    }

    copy(sb.toString());
    return null;
  }
 /**
  * Sets the margins of the attribution view.
  *
  * @param left The left margin in pixels.
  * @param top The top margin in pixels.
  * @param right The right margin in pixels.
  * @param bottom The bottom margin in pixels.
  */
 public void setAttributionMargins(int left, int top, int right, int bottom) {
   attributionSettings.setMargins(new int[] {left, top, right, bottom});
   mapView.setAttributionMargins(left, top, right, bottom);
 }
 /**
  * Returns the gravity value of the logo
  *
  * @return The gravity
  */
 public int getAttributionGravity() {
   return attributionSettings.getGravity();
 }
 /**
  * Sets the gravity of the attribution. By default, the attribution is in the bottom left corner
  * next to the Mapbox logo.
  *
  * @param gravity One of the values from {@link Gravity}.
  * @see Gravity
  */
 public void setAttributionGravity(int gravity) {
   attributionSettings.setGravity(gravity);
   mapView.setAttributionGravity(gravity);
 }
 /**
  * Returns whether the attribution is enabled.
  *
  * @return True if the attribution is enabled; false if the attribution is disabled.
  */
 public boolean isAttributionEnabled() {
   return attributionSettings.isEnabled();
 }
 /**
  * Enables or disables the Mapbox logo. By default, the compass is enabled.
  *
  * @param enabled True to enable the logo; false to disable the logo.
  */
 public void setLogoEnabled(boolean enabled) {
   logoSettings.setEnabled(enabled);
   mapView.setLogoEnabled(enabled);
 }
 /**
  * Returns the right side margin of the attribution view.
  *
  * @return The right margin in pixels
  */
 public int getAttributionMarginRight() {
   return attributionSettings.getMargins()[2];
 }
 /**
  * Returns the left side margin of the attribution view.
  *
  * @return The left margin in pixels
  */
 public int getAttributionMarginLeft() {
   return attributionSettings.getMargins()[0];
 }
 /**
  * Returns the top side margin of the logo
  *
  * @return The top margin in pixels
  */
 public int getLogoMarginTop() {
   return logoSettings.getMargins()[1];
 }
Example #10
0
 /**
  * Returns the left side margin of the logo
  *
  * @return The left margin in pixels
  */
 public int getLogoMarginLeft() {
   return logoSettings.getMargins()[0];
 }
Example #11
0
 /**
  * Sets the margins of the logo view. Use this to change the distance of the Mapbox logo from the
  * map view edge.
  *
  * @param left The left margin in pixels.
  * @param top The top margin in pixels.
  * @param right The right margin in pixels.
  * @param bottom The bottom margin in pixels.
  */
 public void setLogoMargins(int left, int top, int right, int bottom) {
   logoSettings.setMargins(new int[] {left, top, right, bottom});
   mapView.setLogoMargins(left, top, right, bottom);
 }
Example #12
0
 /**
  * Returns the gravity value of the logo
  *
  * @return The gravity
  */
 public int getLogoGravity() {
   return logoSettings.getGravity();
 }
Example #13
0
 /**
  * Sets the gravity of the logo view. Use this to change the corner of the map view that the
  * Mapbox logo is displayed in. By default, the logo is in the bottom left corner.
  *
  * @param gravity One of the values from {@link Gravity}.
  * @see Gravity
  */
 public void setLogoGravity(int gravity) {
   logoSettings.setGravity(gravity);
   mapView.setLogoGravity(gravity);
 }
Example #14
0
 /**
  * Returns whether the logo is enabled.
  *
  * @return True if the logo is enabled; false if the logo is disabled.
  */
 public boolean isLogoEnabled() {
   return logoSettings.isEnabled();
 }
Example #15
0
 /**
  * Sets the tint of the attribution view. Use this to change the color of the attribution. By
  * default, the logo is tinted with the primary color of your theme.
  *
  * @param tintColor Color to tint the attribution.
  */
 public void setAttributionTintColor(@ColorInt int tintColor) {
   attributionSettings.setTintColor(tintColor);
   mapView.setAtttibutionTintColor(tintColor);
 }
Example #16
0
 /**
  * Returns the tint color value of the attribution view.
  *
  * @return The tint color
  */
 public int getAttributionTintColor() {
   return attributionSettings.getTintColor();
 }
Example #17
0
 /**
  * Returns the right side margin of the logo
  *
  * @return The right margin in pixels
  */
 public int getLogoMarginRight() {
   return logoSettings.getMargins()[2];
 }
Example #18
0
 /**
  * Returns the top side margin of the attribution view.
  *
  * @return The top margin in pixels
  */
 public int getAttributionMarginTop() {
   return attributionSettings.getMargins()[1];
 }
Example #19
0
 /**
  * Returns the bottom side margin of the logo
  *
  * @return The bottom margin in pixels
  */
 public int getLogoMarginBottom() {
   return logoSettings.getMargins()[3];
 }
Example #20
0
 /**
  * Returns the bottom side margin of the logo
  *
  * @return The bottom margin in pixels
  */
 public int getAttributionMarginBottom() {
   return attributionSettings.getMargins()[3];
 }
Example #21
0
 /**
  * Enables or disables the attribution. By default, the attribution is enabled.
  *
  * @param enabled True to enable the attribution; false to disable the attribution.
  */
 public void setAttributionEnabled(boolean enabled) {
   attributionSettings.setEnabled(enabled);
   mapView.setAttributionEnabled(enabled ? View.VISIBLE : View.GONE);
 }