Package org.vietspider.ui.widget.action

Examples of org.vietspider.ui.widget.action.HyperlinkAdapter


    add = new ImageHyperlink(popup, SWT.CENTER);
    ImageLoader imageLoader = new ImageLoader();
    addNormal = imageLoader.load(popup.getDisplay(), "add2.png");
    addDown = imageLoader.load(popup.getDisplay(), "add3.png");
    add.setImage(addNormal);
    add.addHyperlinkListener(new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        add.setImage(addNormal);
        add.redraw();
      }
View Full Code Here


    add = new ImageHyperlink(popup, SWT.CENTER);
    ImageLoader imageLoader = new ImageLoader();
    addNormal = imageLoader.load(popup.getDisplay(), "add2.png");
    addDown = imageLoader.load(popup.getDisplay(), "add3.png");
    add.setImage(addNormal);
    add.addHyperlinkListener(new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        add.setImage(addNormal);
        add.redraw();
      }
View Full Code Here

    setLayout(gridLayout);
   
    GridData gridData = new GridData();
    final ToolbarResource resources = ToolbarResource.getInstance();
    butBack = resources.createIcon(this,
        resources.getImageBack(), resources.getTextBack(), new HyperlinkAdapter(){ 
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butBack.setImage(resources.getImageBack());
      }
      @SuppressWarnings("unused")
      public void linkExited(HyperlinkEvent e) {
        butBack.setImage(resources.getImageBack());
      }
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        butBack.setImage(resources.getImageBack());
      }
    });
   
    butBack.addMouseListener(new MouseAdapter() {
      @SuppressWarnings("unused")
      public void mouseUp(MouseEvent e) {
        viewer.getBrowser().back();
      }

      @SuppressWarnings("unused")
      public void mouseDown(MouseEvent e) {
        butBack.setImage(resources.getImageBack1());
        butBack.redraw();
      }
    });

    gridData = new GridData();
    butForward = resources.createIcon(this,
        resources.getImageForward(), resources.getTextForward(), new HyperlinkAdapter(){ 
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butForward.setImage(resources.getImageForward());
      }
      @SuppressWarnings("unused")
      public void linkExited(HyperlinkEvent e) {
        butForward.setImage(resources.getImageForward());
      }
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        butForward.setImage(resources.getImageForward());
      }
    });
    butForward.addMouseListener(new MouseAdapter() {
      @SuppressWarnings("unused")
      public void mouseUp(MouseEvent e) {
        viewer.getBrowser().forward();
      }

      @SuppressWarnings("unused")
      public void mouseDown(MouseEvent e) {
        butForward.setImage(resources.getImageForward1());
        butForward.redraw();
      }
    });
    butForward.setLayoutData(gridData);
   
    liveSash = new LiveSashForm(this, SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    if(UIDATA.isMacOS) {
      gridData.heightHint = 30;
    } else {
      gridData.heightHint = 20;
    }
    liveSash.setLayoutData(gridData);
    factory.setComposite(liveSash);
   
    cboAddress = new CCombo(liveSash, SWT.BORDER | SWT.DROP_DOWN | SWT.V_SCROLL | SWT.H_SCROLL);  
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    cboAddress.setForeground(UIDATA.FCOLOR);
    cboAddress.setFont(UIDATA.FONT_10);
    cboAddress.setBackground(UIDATA.ADDRESS_BCOLOR);
    if(UIDATA.isMacOS) {
      gridData.heightHint = 30;
      cboAddress.setFont(UIDATA.FONT_11);
    }
    cboAddress.setLayoutData(gridData);
    cboAddress.setVisibleItemCount(15);
   
    cboAddress.addKeyListener( new KeyAdapter(){
      public void keyReleased(KeyEvent e){
        if(e.keyCode != 13) return;
        viewer.goAddress();
      }
    });  
   
    cboAddress.addSelectionListener(new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent e){
        viewer.goAddress();
      }     
    });   
  
    progressBar = new ProgressBar(liveSash, SWT.NONE);
   
    liveSash.setMaximizedControl(cboAddress);
   
    butRefresh = resources.createIcon(this,
        resources.getImageRefesh(), resources.getTextRefesh(), new HyperlinkAdapter(){   
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butRefresh.setImage(resources.getImageRefesh());
      }
      @SuppressWarnings("unused")
      public void linkExited(HyperlinkEvent e) {
        butRefresh.setImage(resources.getImageRefesh());
      }
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        butRefresh.setImage(resources.getImageRefesh());
      }
    });
    butRefresh.addMouseListener(new MouseAdapter() {
      @SuppressWarnings("unused")
      public void mouseUp(MouseEvent e) {
        viewer.getBrowser().setUrl(cboAddress.getText());
      }

      @SuppressWarnings("unused")
      public void mouseDown(MouseEvent e) {
        butRefresh.setImage(resources.getImageRefesh1());
        butRefresh.redraw();
      }
    });
    gridData = new GridData();
    butRefresh.setLayoutData(gridData)

    butStop = resources.createIcon(this,
        resources.getImageStop(), resources.getTextStop(), new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butStop.setImage(resources.getImageStop());
      }
      @SuppressWarnings("unused")
      public void linkExited(HyperlinkEvent e) {
        butStop.setImage(resources.getImageStop());
      }
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        butStop.setImage(resources.getImageStop());
      }
    });
    butStop.addMouseListener(new MouseAdapter() {
      @SuppressWarnings("unused")
      public void mouseUp(MouseEvent e) {
        viewer.getBrowser().stop();
      }

      @SuppressWarnings("unused")
      public void mouseDown(MouseEvent e) {
        butStop.setImage(resources.getImageStop1());
        butStop.redraw();
      }
    });
    gridData = new GridData();
    butStop.setLayoutData(gridData);
   
    Label lblSeparator = new Label(this, SWT.NONE);
    lblSeparator.setText("   ");
   

    final CoolButton toggleButton = new CoolButton(this,
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_NORMAL),
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_HOVER),
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_PRESSED),
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_NORMAL_TOGGLED),
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_HOVER_TOGGLED),
        ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_PRESSED_TOGGLED));
   
    toggleButton.setHotRegionMask(ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_CHECKBOX_HOT_SPOT));
    toggleButton.setHotToggledRegionMask(ToolBoxImageRegistry.getImage(ToolBoxImageRegistry.IMG_BUTTON_HOT_SPOT_TOGGLED));
    gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
    toggleButton.setLayoutData(gridData);
    toggleButton.setToolTipText(factory.getLabel("butComplete"));
    toggleButton.addSelectionListener(new CoolButtonSelectionListener(){
      @SuppressWarnings("unused")
      public void selectionOnPress(CoolButtonSelectionEvent e) {
        showAll = !showAll;
        Preferences prefs = Preferences.userNodeForPackage(HTMLExplorerViewer.class);
        prefs.put("showAll", String.valueOf(showAll));
      }
      @SuppressWarnings("unused")
      public void selectionOnRelease(CoolButtonSelectionEvent e) {
      }
    })
   
    Preferences prefs = Preferences.userNodeForPackage(getClass());
    String prefValue = prefs.get( "showAll", "");
    if(prefValue != null && prefValue.trim().length() > 0){
      showAll = Boolean.valueOf(prefValue).booleanValue();
    } else {
      showAll = true;
    }
    toggleButton.setSelection(showAll);
   
    butGo = resources.createIcon(this,
        resources.getImageGo(), resources.getTextGo(), new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butGo.setImage(resources.getImageGo());
      }
      @SuppressWarnings("unused")
View Full Code Here

    lbl.setLayoutData(gridData);

    String tip = factory.getLabel("butOk");
    final ToolbarResource resources = ToolbarResource.getInstance();
    butOk = resources.createIcon(factory.getComposite(),
        resources.getImageGo(), tip, new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butOk.setImage(resources.getImageGo());
      }
      @SuppressWarnings("unused")
      public void linkExited(HyperlinkEvent e) {
        butOk.setImage(resources.getImageGo());
      }
      @SuppressWarnings("unused")
      public void linkEntered(HyperlinkEvent e) {
        butOk.setImage(resources.getImageGo());
      }
    });
    butOk.addMouseListener(new MouseAdapter() {
      @SuppressWarnings("unused")
      public void mouseUp(MouseEvent e) {
        invisibleComponent();
        clickOk();   
      }

      @SuppressWarnings("unused")
      public void mouseDown(MouseEvent e) {
        butOk.setImage(resources.getImageGo1());
        butOk.redraw();
      }
    });

    tip = factory.getLabel("butCancel");
    butCancel = resources.createIcon(factory.getComposite(),
        resources.getImageCancel(), tip, new HyperlinkAdapter(){
      @SuppressWarnings("unused")
      public void linkActivated(HyperlinkEvent e) {
        butCancel.setImage(resources.getImageCancel());
      }
      @SuppressWarnings("unused")
View Full Code Here

    gridLayout.horizontalSpacing = 8;
    gridLayout.verticalSpacing = 10;
    gridLayout.marginWidth = 5;
    composite.setLayout(gridLayout)
    Hyperlink lbl;   
    HyperlinkAdapter listener = new HyperlinkAdapter(){
      public void linkActivated(HyperlinkEvent e){
        String txtElement = e.getLabel().trim();         
        Hyperlink  h = (Hyperlink)e.getSource();
        Composite comp = h.getParent();         
        for(int i = 0; i < bar.getItemCount(); i++){
View Full Code Here

TOP

Related Classes of org.vietspider.ui.widget.action.HyperlinkAdapter

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.