Examples of ButtonListenerAdapter


Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

        });
      }
    }

    if (soButton != null) {
      soButton.addSelectionListener(new ButtonListenerAdapter() {
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          closeDialog.close();
        }
      });
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

          public void widgetDefaultSelected(SelectionEvent e) {
          }
        };

        SWTSkinButtonUtility btnDropDown = new SWTSkinButtonUtility(soDropDown);
        btnDropDown.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            Control c = buttonUtility.getSkinObject().getControl();
            menuDropDown.setLocation(c.getDisplay().getCursorLocation());
            menuDropDown.setVisible(!menuDropDown.getVisible());
          }
        });
      }

      SWTSkinObject soExpand = skin.getSkinObject("sidebar-expand");
      if (soExpand != null) {
        SWTSkinButtonUtility btnExpand = new SWTSkinButtonUtility(soExpand);
        btnExpand.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            flipSideBarVisibility();
          }
        });
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

      soCodeArea = skin.getSkinObject("code-area");
      control = soCodeArea.getControl();

      soEnablePairing = (SWTSkinObjectButton) skin.getSkinObject("enable-pairing");
      soEnablePairing.addSelectionListener(new ButtonListenerAdapter() {
        // @see com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter#pressed(com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility, com.aelitis.azureus.ui.swt.skin.SWTSkinObject, int)
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          skinObject.getControl().setEnabled(false);

          if (!pairingManager.isEnabled()) {
            // enabling will automatically get access code and trigger
            // somethingChanged
            pairingManager.setEnabled(true);
            if (SHOW_SPEW) {
              System.out.println("PAIR] SetEnabled");
            }
          } else {
            // fire something changed ourselves, so that accesscode gets
            // picked up
            if (SHOW_SPEW) {
              System.out.println("PAIR] AlreadyEnabled");
            }
            somethingChanged(pairingManager);
          }

          if (getWebUI() == null) {
            installWebUI();
          } else {
            switchToCode();
          }
        }
      });

      soFTUX = skin.getSkinObject("pairing-ftux");
      soCode = skin.getSkinObject("pairing-code");

      soStatusText = (SWTSkinObjectText) skin.getSkinObject("status-text");
      soStatusText.addUrlClickedListener(new SWTSkinObjectText_UrlClickedListener() {
        public boolean urlClicked(URLInfo urlInfo) {
          if (urlInfo.url.equals("retry")) {
            if (DEBUG) {
              testPairingClass.inc();
            }
            alreadyTested = false;
            testPairing(false);
            return true;
          }
          return false;
        }
      });

      pairingManager.addListener(this);

      Font font = control.getFont();
      GC gc = new GC(control);
      fontCode = FontUtils.getFontWithHeight(font, gc, Constants.isWindows ? 20
          : 18, SWT.BOLD);
      gc.dispose();
      control.setFont(fontCode);

      control.addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent e) {
          Color oldColor = e.gc.getForeground();

          Rectangle printArea = ((Composite) e.widget).getClientArea();
          int fullWidth = printArea.width;
          int fullHeight = printArea.height;
          GCStringPrinter sp = new GCStringPrinter(e.gc,
              MessageText.getString("remote.pairing.accesscode"), printArea,
              false, false, SWT.NONE);
          sp.calculateMetrics();
          Point sizeAccess = sp.getCalculatedSize();

          String drawAccessCode = accessCode == null ? "      " : accessCode;

          int numBoxes = drawAccessCode == null ? 0 : drawAccessCode.length();
          int boxSize = 25;
          int boxSizeAndPadding = 30;
          int allBoxesWidth = numBoxes * boxSizeAndPadding;
          int textPadding = 15;
          printArea.x = (fullWidth - (allBoxesWidth + sizeAccess.x + textPadding)) / 2;
          printArea.width = sizeAccess.x;

          sp.printString(e.gc, printArea, 0);
          e.gc.setBackground(Colors.white);
          e.gc.setForeground(Colors.blue);

          int xStart = printArea.x + sizeAccess.x + textPadding;
          int yStart = (fullHeight - boxSize) / 2;
          for (int i = 0; i < numBoxes; i++) {
            Rectangle r = new Rectangle(xStart + (i * boxSizeAndPadding),
                yStart, boxSize, boxSize);
            e.gc.fillRectangle(r);
            e.gc.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
            e.gc.drawRectangle(r);
            if (!hideCode) {
              e.gc.setForeground(oldColor);
              GCStringPrinter.printString(e.gc, "" + drawAccessCode.charAt(i),
                  r, false, false, SWT.CENTER);
            }
          }
        }
      });

      soToClipboard = (SWTSkinObjectText) skin.getSkinObject("pair-clipboard");

      soToClipboard.addUrlClickedListener(new SWTSkinObjectText_UrlClickedListener() {
        public boolean urlClicked(URLInfo urlInfo) {
          if (urlInfo.url.equals("new")) {
            try {
              accessCode = pairingManager.getReplacementAccessCode();
            } catch (PairingException e) {
              // ignore.. if error, lastErrorUpdates will trigger
            }
            control.redraw();
            String s = soToClipboard.getText();
            int i = s.indexOf("|");
            if (i > 0) {
              soToClipboard.setText(s.substring(0, i - 1));
            }
          } else if (urlInfo.url.equals("clip")) {
            ClipboardCopy.copyToClipBoard(accessCode);
          }
          return true;
        }
      });
      SWTSkinButtonUtility btnToClipboard = new SWTSkinButtonUtility(
          soToClipboard);
      btnToClipboard.addSelectionListener(new ButtonListenerAdapter() {
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
        }
      });

View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

   *
   * @since 4.1.0.5
   */
  private void initAdvInfo(SWTSkinObject soAdvInfo) {
    SWTSkinButtonUtility btnAdvInfo = new SWTSkinButtonUtility(soAdvInfo);
    btnAdvInfo.addSelectionListener(new ButtonListenerAdapter() {
      public void pressed(SWTSkinButtonUtility buttonUtility,
          SWTSkinObject skinObject, int stateMask) {
        SWTSkinObject soArea = getSkinObject("advinfo-area");
        if (soArea != null) {
          boolean newVisibility = !soArea.isVisible();
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

      });

      SWTSkinObject soPrev = skin.getSkinObject("topbar-plugin-prev");
      if (soPrev != null) {
        SWTSkinButtonUtility btnPrev = new SWTSkinButtonUtility(soPrev);
        btnPrev.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            //System.out.println("prev click " + activeTopBar + " ; "
            //    + topbarViews.size());
            if (activeTopBar == null || topbarViews.size() <= 1) {
              return;
            }
            int i = topbarViews.indexOf(activeTopBar) - 1;
            if (i < 0) {
              i = topbarViews.size() - 1;
            }
            activateTopBar((IView) topbarViews.get(i));
          }
        });
      }

      SWTSkinObject soNext = skin.getSkinObject("topbar-plugin-next");
      if (soNext != null) {
        SWTSkinButtonUtility btnNext = new SWTSkinButtonUtility(soNext);
        btnNext.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            //System.out.println("next click");
            if (activeTopBar == null || topbarViews.size() <= 1) {
              return;
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

   
    button.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        Object[] listeners = buttonListeners.toArray();
        for (int i = 0; i < listeners.length; i++) {
          ButtonListenerAdapter l = (ButtonListenerAdapter) listeners[i];
          l.pressed(null);
          l.pressed(null, SWTSkinObjectButton.this, e.stateMask);
        }
      }
   
      public void widgetDefaultSelected(SelectionEvent e) {
      }
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

    ((SWTSkinObjectContainer) parent).getComposite().layout(true);

    SWTSkinObject soClose = skin.getSkinObject("close", parent);
    if (soClose != null) {
      SWTSkinButtonUtility btnClose = new SWTSkinButtonUtility(soClose);
      btnClose.addSelectionListener(new ButtonListenerAdapter() {
        // @see com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter#pressed(com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility, com.aelitis.azureus.ui.swt.skin.SWTSkinObject, int)
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          soInfoBar.setVisible(false);
          RememberedDecisionsManager.setRemembered(stateConfigID, 0);
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

    //text.selectAll();

    SWTSkinObject searchGo = skin.getSkinObject("search-go");
    if (searchGo != null) {
      SWTSkinButtonUtility btnGo = new SWTSkinButtonUtility(searchGo);
      btnGo.addSelectionListener(new ButtonListenerAdapter() {
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          String sSearchText = text.getText().trim();
          doSearch(sSearchText);
        }
      });
    }

    SWTSkinObject so = skin.getSkinObject("sidebar-list");
    if (so != null
        && so.getProperties().getBooleanValue(
            so.getConfigID() + ".resizeSearch", false)) {
      Listener l = new Listener() {
        public void handleEvent(Event event) {
          SWTSkinObject soSearchArea = skin.getSkinObject("topbar-area-search");
          if (soSearchArea != null) {
            Control c = soSearchArea.getControl();
            Rectangle bounds = ((Control) event.widget).getBounds();
            FormData fd = (FormData) c.getLayoutData();
            int newWidth = bounds.width - 1 - c.getBounds().x;
            if (bounds.width < 125) {
              return;
            }
            fd.width = newWidth;
            Utils.relayout(c);
          }
        }
      };
      so.getControl().addListener(SWT.Resize, l);
    }

    so = skin.getSkinObject("search-dropdown");
    if (so != null) {
      SWTSkinButtonUtility btnSearchDD = new SWTSkinButtonUtility(so);
      btnSearchDD.addSelectionListener(new ButtonListenerAdapter() {
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          String sSearchText = text.getText().trim();
          doSearch(sSearchText);
        }
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter

      soButtonBottomArea.setVisible(true);

      SWTSkinObjectButton soOk = (SWTSkinObjectButton) skin.getSkinObject("ok");
      if (soOk != null) {
        shell.setDefaultButton(soOk.getButton());
        soOk.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            transcodeProfiles = selectedTranscodeTarget.getTranscodeProfiles();
            createProfileList(soList, "chooser");
          }
        });
      }

      SWTSkinObjectButton soCancel = (SWTSkinObjectButton) skin.getSkinObject("cancel");
      if (soCancel != null) {
        soCancel.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            shell.close();
          }
        });
View Full Code Here

Examples of com.gwtext.client.widgets.event.ButtonListenerAdapter

        .format(
            "bpeleditor/BPELEditor.html?uuid={0}&fileName={1}&dirName={2}&servletName={3}&isNew={4}",
            new String[] { uuid, fileName, dirName, servletName,
                isNew });

    viewSource.addListener(new ButtonListenerAdapter() {
      public void onClick(com.gwtext.client.widgets.Button button,
          EventObject e) {

        Window.open(url, "_" + fileName, null);
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.