Examples of UrlInfo


Examples of org.apache.wicket.request.mapper.AbstractBookmarkableMapper.UrlInfo

    PageParameters parameters = new PageParameters();
    parameters.add(WebRequest.PARAM_AJAX, "true");
    parameters.add(WebRequest.PARAM_AJAX_BASE_URL, "base/url");
    parameters.add(WebRequest.PARAM_AJAX_REQUEST_ANTI_CACHE, "12345.6879");

    AbstractBookmarkableMapper.UrlInfo info = new UrlInfo(null, MockPage.class, parameters);
    assertNull(info.getPageParameters());
  }
View Full Code Here

Examples of org.apache.wicket.request.mapper.AbstractBookmarkableMapper.UrlInfo

    PageParameters parameters = new PageParameters();
    parameters.add(WebRequest.PARAM_AJAX, "true");
    parameters.add(WebRequest.PARAM_AJAX_BASE_URL, "base/url");
    parameters.add(WebRequest.PARAM_AJAX_REQUEST_ANTI_CACHE, "12345.6879");

    AbstractBookmarkableMapper.UrlInfo info = new UrlInfo(null, MockPage.class, parameters);
    assertTrue(info.getPageParameters().isEmpty());
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

      public void mouseMove(MouseEvent e) {
        if (shell == null || shell.isDisposed()) {
          return;
        }
        URLInfo hitUrl = spText.getHitUrl(e.x, e.y);

        int cursor = (rectX.contains(e.x, e.y)) || hitUrl != null
            ? SWT.CURSOR_HAND : SWT.CURSOR_ARROW;
        if (cursor != lastCursor) {
          lastCursor = cursor;
          shell.setCursor(e.display.getSystemCursor(cursor));
        }
      }
    });

    shell.addMouseListener(new MouseListener() {
      public void mouseUp(MouseEvent e) {
        if (shell == null || shell.isDisposed()) {
          return;
        }
        if (rectX.contains(e.x, e.y)) {
          shell.dispose();
        }
        URLInfo hitUrl = spText.getHitUrl(e.x, e.y);
        if (hitUrl != null) {
          if (hitUrl.url.equals("details")) {
            MessageBoxShell mb = new MessageBoxShell(Constants.APP_NAME,
                logAlert.details, new String[] {
                  MessageText.getString("Button.ok")
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

      private String lastDownURL;

      public void mouseUp(MouseEvent e) {
        mouseDown = false;
        if (lastStringPrinter != null) {
          URLInfo hitUrl = lastStringPrinter.getHitUrl(e.x, e.y);
          if (hitUrl != null) {

            SWTSkinObjectText_UrlClickedListener[] listeners = listUrlClickedListeners.toArray(new SWTSkinObjectText_UrlClickedListener[0]);
            for (SWTSkinObjectText_UrlClickedListener l : listeners) {
              if (l.urlClicked(hitUrl)) {
                return;
              }
            }

            String url = hitUrl.url;
            try {
              if (url.startsWith("/")) {
                url = ConstantsVuze.getDefaultContentNetwork().getExternalSiteRelativeURL(
                    url, true);
              }

              if (url.contains("?")) {
                url += "&";
              } else {
                url += "?";
              }
              url += "fromWeb=false&os.version="
                  + UrlUtils.encode(System.getProperty("os.version"))
                  + "&java.version=" + UrlUtils.encode(Constants.JAVA_VERSION);
            } catch (Throwable t) {
              // ignore
            }
            Utils.launch(url);
          }
        }
      }

      public void mouseDown(MouseEvent e) {
        mouseDown = true;
        if (lastStringPrinter != null) {
          URLInfo hitUrl = lastStringPrinter.getHitUrl(e.x, e.y);
          String curURL = hitUrl == null ? "" : hitUrl.url;
         
          if (curURL.equals(lastDownURL)) {
            lastDownURL = curURL;
            canvas.redraw();
          }
        }
      }

      public void mouseDoubleClick(MouseEvent e) {
      }
    });

    canvas.addMouseMoveListener(new MouseMoveListener() {
      public void mouseMove(MouseEvent e) {
        if (lastStringPrinter != null && lastStringPrinter.hasHitUrl()) {
          URLInfo hitUrl = lastStringPrinter.getHitUrl(e.x, e.y);
          canvas.setCursor(hitUrl == null ? null
              : canvas.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
        }
      }
    });
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

    }
    if (colorUrl2 != null && mouseDown) {
      lastStringPrinter.calculateMetrics();
      Display display = Display.getCurrent();
      Point cursorLocation = canvas.toControl(display.getCursorLocation());
      URLInfo hitUrl = lastStringPrinter.getHitUrl(cursorLocation.x, cursorLocation.y);
      if (hitUrl != null) {
        hitUrl.urlColor = colorUrl2;
      }
    }
   
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

      sp.calculateMetrics();

      if (sp.hasHitUrl()) {
        URLInfo[] hitUrlInfo = sp.getHitUrlInfo();
        for (int i = 0; i < hitUrlInfo.length; i++) {
          URLInfo info = hitUrlInfo[i];
            // handle fake row when showing in column editor
         
          info.urlUnderline = cell.getTableRow() == null || cell.getTableRow().isSelected();
          if (info.urlUnderline) {
            info.urlColor = null;
          } else {
            info.urlColor = colorLinkNormal;
          }
        }
        int[] mouseOfs = cell.getMouseOffset();
        if (mouseOfs != null) {
          Rectangle realBounds = cell.getBounds();
          URLInfo hitUrl = sp.getHitUrl(mouseOfs[0] + realBounds.x, mouseOfs[1]
              + realBounds.y);
          if (hitUrl != null) {
            hitUrl.urlColor = colorLinkHover;
          }
        }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

    } finally {
      gc.dispose();
    }

    if (sp != null) {
      URLInfo hitUrl = sp.getHitUrl(event.x + bounds.x, event.y + bounds.y);
      int newCursor;
      if (hitUrl != null) {
        if (event.eventType == TableCellMouseEvent.EVENT_MOUSEUP) {
          if (hitUrl.url.equals("download")) {
            String referal = null;
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

    GCStringPrinter sp = setupStringPrinter(gc, cell);

    if (sp.hasHitUrl()) {
      URLInfo[] hitUrlInfo = sp.getHitUrlInfo();
      for (int i = 0; i < hitUrlInfo.length; i++) {
        URLInfo info = hitUrlInfo[i];
        info.urlUnderline = cell.getTableRow().isSelected();
        if (info.urlUnderline) {
          info.urlColor = null;
        } else {
          info.urlColor = colorLinkNormal;
        }
      }
      int[] mouseOfs = cell.getMouseOffset();
      if (mouseOfs != null) {
        Rectangle realBounds = cell.getBounds();
        URLInfo hitUrl = sp.getHitUrl(mouseOfs[0] + realBounds.x, mouseOfs[1]
            + realBounds.y);
        if (hitUrl != null) {
          hitUrl.urlColor = colorLinkHover;
        }
      }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

    } finally {
      gc.dispose();
    }

    if (sp != null) {
      URLInfo hitUrl = sp.getHitUrl(event.x + bounds.x, event.y + bounds.y);
      int newCursor;
      if (hitUrl != null) {
        boolean ourUrl = UrlFilter.getInstance().urlCanRPC(hitUrl.url)
            || hitUrl.url.startsWith("/") || hitUrl.url.startsWith("#");
        if (event.eventType == TableCellMouseEvent.EVENT_MOUSEDOWN) {
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.URLInfo

            e.gc.setForeground(colorFG);
          }
          sp.printString();
        } else if (e.type == SWT.MouseMove) {
          if (sp != null) {
            URLInfo hitUrl = sp.getHitUrl(e.x, e.y);
            if (hitUrl != null) {
              canvas.setCursor(canvas.getDisplay().getSystemCursor(
                  SWT.CURSOR_HAND));
              canvas.setToolTipText(hitUrl.url);
            } else {
              canvas.setCursor(canvas.getDisplay().getSystemCursor(
                  SWT.CURSOR_ARROW));
              canvas.setToolTipText(null);
            }
          }
        } else if (e.type == SWT.MouseUp) {
          if (sp != null) {
            URLInfo hitUrl = sp.getHitUrl(e.x, e.y);
            if (hitUrl != null && !hitUrl.url.startsWith(":")) {
              Utils.launch(hitUrl.url);
            }
          }
        }
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.