Examples of CLabel


Examples of org.eclipse.swt.custom.CLabel

  Color backYellow = new Color(composite.getDisplay(), 231, 231, 191);
  Color[] labelColors =new Color[] {backYellow, composite.getDisplay().getSystemColor(SWT.COLOR_WHITE) };

  //*-- add the index directory selector
  GridData indexGd = new GridData(); indexGd.grabExcessHorizontalSpace = false; indexGd.horizontalAlignment = GridData.FILL;
  CLabel indexLabel = new CLabel(composite, SWT.LEFT); indexLabel.setText("Lucene index dir.: ");
  indexLabel.setBackground( labelColors, new int[] {100} );
  indexLabel.setLayoutData(indexGd);

  final Text indexText = new Text(composite, SWT.SINGLE | SWT.BORDER);
  indexText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getIndexDir() );
  if (indexText.getText().length() == 0)
   indexText.setText(Constants.MUSTRU_HOME + Constants.fs + "data" + Constants.fs + "index");
  GridData indexTextGd = new GridData(); indexTextGd.horizontalAlignment = GridData.BEGINNING;
  indexTextGd.minimumWidth = 350; indexTextGd.grabExcessHorizontalSpace = true;
  indexText.setEditable(false);
  indexText.setLayoutData(indexTextGd);

  Button indexButton = new Button(composite, SWT.PUSH); indexButton.setText("Browse");
  GridData indexButtonGd = new GridData(); indexButtonGd.horizontalAlignment = GridData.BEGINNING;
  indexButtonGd.grabExcessHorizontalSpace = false;
  indexButton.setLayoutData(indexButtonGd);
  indexButton.addListener( SWT.Selection, new Listener() {
   public void handleEvent(Event e)
   {
    DirectoryDialog dd = new DirectoryDialog(composite.getShell());
    dd.setMessage("Please select the Lucene index directory");
    String dir = dd.open();
    if (dir != null)
      { indexText.setText(dir);( (CrawlConfigWizard) getWizard() ).crawlConfig.setIndexDir(dir); }
   }
  });

  //*-- description of the Lucene index dir.
  GridData indexDescrGd = new GridData(); indexDescrGd.grabExcessHorizontalSpace = true;
  indexDescrGd.horizontalAlignment = GridData.FILL; indexDescrGd.horizontalSpan = 3;
  indexDescrGd.widthHint = 350;
  Text indexDescrText = new Text(composite,  SWT.LEFT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
  indexDescrText.setEditable(false);
  indexDescrText.setText("The Lucene index directory is where one or more indexes will be stored. If there are " + Constants.NEWLINE +
    "sub-directories in this directory, a multisearcher will be created to scan all index. Otherwise, a " + Constants.NEWLINE +
  "single index reader will be used. The files in this directory can become quite large.");
  indexDescrText.setLayoutData(indexDescrGd);

  //*-- add the database directory selector
  GridData dbGd = new GridData(); dbGd.grabExcessHorizontalSpace = false; dbGd.horizontalAlignment = GridData.FILL;
  CLabel dbLabel = new CLabel(composite, SWT.LEFT); dbLabel.setText("Berkeley DB dir.: ");
  dbLabel.setBackground( labelColors, new int[] {100} );
  dbLabel.setLayoutData(dbGd);

  final Text dbText = new Text(composite, SWT.SINGLE | SWT.BORDER);
  dbText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getDbDir() );
  if (dbText.getText().length() == 0)
   dbText.setText(Constants.MUSTRU_HOME + Constants.fs + "data" + Constants.fs + "bdb");
  GridData dbTextGd = new GridData(); dbTextGd.horizontalAlignment = GridData.BEGINNING;
  dbTextGd.minimumWidth = 350; dbTextGd.grabExcessHorizontalSpace = true;
  dbText.setEditable(false);
  dbText.setLayoutData(dbTextGd);

  Button dbButton = new Button(composite, SWT.PUSH); dbButton.setText("Browse");
  GridData dbButtonGd = new GridData(); dbButtonGd.horizontalAlignment = GridData.BEGINNING;
  dbButtonGd.grabExcessHorizontalSpace = false;
  dbButton.setLayoutData(dbButtonGd);
  dbButton.addListener( SWT.Selection, new Listener() {
   public void handleEvent(Event e)
   {
    DirectoryDialog dd = new DirectoryDialog(composite.getShell());
    dd.setMessage("Please select the Berekeley DB directory");
    String dir = dd.open();
    if (dir != null
    { dbText.setText(dir); ( (CrawlConfigWizard) getWizard() ).crawlConfig.setDbDir(dir); }
   }
  });

  //*-- description of the Berkeley DB dir.
  GridData dbDescrGd = new GridData(); dbDescrGd.grabExcessHorizontalSpace = true;
  dbDescrGd.horizontalAlignment = GridData.FILL; dbDescrGd.horizontalSpan = 3;
  dbDescrGd.widthHint = 350;
  Text dbDescrText = new Text(composite,  SWT.LEFT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
  dbDescrText.setEditable(false);
  dbDescrText.setText("The Berkeley database directory contains the log and data files for the database. " + Constants.NEWLINE +
  "For a large database, there will be many files and sufficient space will be required in this directory.");
  dbDescrText.setLayoutData(dbDescrGd);

  //*-- add the web directory selector
  GridData webGd = new GridData(); webGd.grabExcessHorizontalSpace = false; webGd.horizontalAlignment = GridData.FILL;
  CLabel webLabel = new CLabel(composite, SWT.LEFT); webLabel.setText("Web Server Root dir.: ");
  webLabel.setBackground( labelColors, new int[] {100} );
  webLabel.setLayoutData(dbGd);

  final Text webText = new Text(composite, SWT.SINGLE | SWT.BORDER);
  webText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getWebDir() );
  GridData webTextGd = new GridData(); webTextGd.horizontalAlignment = GridData.BEGINNING;
  webTextGd.minimumWidth = 350; webTextGd.grabExcessHorizontalSpace = true;
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

  }

  private void renderItem(final NotificationItem item) {

    /* Image Label with Tooltip */
    final CLabel imageLabel = new CLabel(fInnerContentCircle, SWT.NONE);
    imageLabel.setBackground(fInnerContentCircle.getBackground());
    imageLabel.setCursor(imageLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    imageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    imageLabel.addMouseTrackListener(fMouseTrackListner);
    imageLabel.setImage(OwlUI.getImage(fResources, item.getImage()));
    imageLabel.setToolTipText(item.getOrigin());

    /* Use a CCLabel per Item */
    final CCLabel itemLabel = new CCLabel(fInnerContentCircle, SWT.NONE);
    itemLabel.setBackground(fInnerContentCircle.getBackground());
    itemLabel.setCursor(itemLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    itemLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    itemLabel.setText(item.getText());
    itemLabel.setFont(fBoldTextFont);
    itemLabel.addMouseTrackListener(fMouseTrackListner);

    /* Paint text blue on mouse-enter */
    MouseTrackAdapter mouseTrackListener = new MouseTrackAdapter() {

      @Override
      public void mouseEnter(MouseEvent e) {
        itemLabel.setForeground(itemLabel.getDisplay().getSystemColor(SWT.COLOR_BLUE));
      }

      @Override
      public void mouseExit(MouseEvent e) {
        itemLabel.setForeground(itemLabel.getDisplay().getSystemColor(SWT.COLOR_BLACK));
      }
    };

    itemLabel.addMouseTrackListener(mouseTrackListener);
    imageLabel.addMouseTrackListener(mouseTrackListener);

    /* Restore RSSOwl label is clicked */
    MouseAdapter mouseListener = new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {

        /* Open Item */
        item.open(e);

        /* Close Popup */
        doClose();
      }
    };

    itemLabel.addMouseListener(mouseListener);
    imageLabel.addMouseListener(mouseListener);

    /* Offer Label to mark item sticky */
    final CLabel markStickyLabel = new CLabel(fInnerContentCircle, SWT.NONE);
    markStickyLabel.setImage(item.supportsSticky() ? fItemNonStickyIcon : fItemNonStickyDisabledIcon);
    markStickyLabel.setBackground(fInnerContentCircle.getBackground());
    markStickyLabel.setEnabled(item.supportsSticky());
    markStickyLabel.addMouseTrackListener(fMouseTrackListner);
    markStickyLabel.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    markStickyLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseDown(MouseEvent e) {
        boolean newStateSticky = !item.isSticky();

        /* Update Background Color */
        itemLabel.setBackground(newStateSticky ? fStickyBgColor : fInnerContentCircle.getBackground());

        /* Update Image */
        markStickyLabel.setImage(newStateSticky ? fItemStickyIcon : fItemNonStickyIcon);

        /* Apply state */
        item.setSticky(newStateSticky);
      }
    });

    /* Show Sticky if required */
    if (item.supportsSticky() && item.isSticky()) {
      itemLabel.setBackground(fStickyBgColor);
      markStickyLabel.setImage(fItemStickyIcon);
    }

    /* Show excerpt of content if set */
    if (fGlobalScope.getBoolean(DefaultPreferences.SHOW_EXCERPT_IN_NOTIFIER)) {
      String description = item.getDescription();
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

        gc.drawPoint(clArea.width - 1, 3);
      }
    });

    /* Title Label displaying RSSOwl */
    fTitleCircleLabel = new CLabel(titleCircle, SWT.NO_FOCUS);
    fTitleCircleLabel.setImage(OwlUI.getImage(fResources, "icons/product/24x24.png"));
    fTitleCircleLabel.setText("RSSOwl");
    fTitleCircleLabel.setFont(fBoldTextFont);
    fTitleCircleLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    fTitleCircleLabel.addMouseTrackListener(fMouseTrackListner);
    fTitleCircleLabel.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fTitleCircleLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        IWorkbenchPage page = OwlUI.getPage();
        if (page != null) {

          /* Restore Window */
          restoreWindow(page);

          /* Close Notifier */
          doClose();
        }
      }
    });

    /* Nav to previous News */
    fPrevButton = new CLabel(titleCircle, SWT.NO_FOCUS);
    fPrevButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    fPrevButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fPrevButton.addMouseTrackListener(fMouseTrackListner);
    fPrevButton.setImage(fPrevImageDisabled);
    fPrevButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        onNavPrevious();
      }

      @Override
      public void mouseDown(MouseEvent e) {
        fPrevButton.setImage(fPrevImagePressed);
      }
    });

    /* Nav to next News */
    fNextButton = new CLabel(titleCircle, SWT.NO_FOCUS);
    fNextButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    fNextButton.addMouseTrackListener(fMouseTrackListner);
    fNextButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fNextButton.setImage(fNextImageDisabled);
    fNextButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        onNavNext();
      }

      @Override
      public void mouseDown(MouseEvent e) {
        fNextButton.setImage(fNextImagePressed);
      }
    });

    /* CLabel to display a cross to close the popup */
    final CLabel closeButton = new CLabel(titleCircle, SWT.NO_FOCUS);
    closeButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    closeButton.setImage(fCloseImageNormal);
    closeButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    closeButton.addMouseTrackListener(fMouseTrackListner);
    closeButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        doClose();
      }

      @Override
      public void mouseDown(MouseEvent e) {
        closeButton.setImage(fCloseImagePressed);
      }
    });

    /* Outer composite to hold content controlls */
    fOuterContentCircle = new Composite(outerCircle, SWT.NONE);
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

  }

  private void renderItem(final NotificationItem item) {

    /* Image Label with Tooltip */
    final CLabel imageLabel = new CLabel(fInnerContentCircle, SWT.NONE);
    imageLabel.setBackground(fInnerContentCircle.getBackground());
    imageLabel.setCursor(imageLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    imageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    imageLabel.addMouseTrackListener(fMouseTrackListner);
    imageLabel.setImage(OwlUI.getImage(fResources, item.getImage()));
    imageLabel.setToolTipText(item.getOrigin());

    /* Use a CCLabel per Item */
    final CCLabel itemLabel = new CCLabel(fInnerContentCircle, SWT.NONE);
    itemLabel.setBackground(fInnerContentCircle.getBackground());
    itemLabel.setCursor(itemLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    itemLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    itemLabel.setText(item.getText());
    itemLabel.setFont(item.isRead() ? fNormalTextFont : fBoldTextFont);
    updateItemColor(item, itemLabel);
    itemLabel.addMouseTrackListener(fMouseTrackListner);

    /* Paint text blue on mouse-enter */
    MouseTrackAdapter mouseTrackListener = new MouseTrackAdapter() {

      @Override
      public void mouseEnter(MouseEvent e) {
        if (!OwlUI.isHighContrast())
          itemLabel.setForeground(itemLabel.getDisplay().getSystemColor(SWT.COLOR_BLUE));
      }

      @Override
      public void mouseExit(MouseEvent e) {
        updateItemColor(item, itemLabel);
      }
    };

    itemLabel.addMouseTrackListener(mouseTrackListener);
    imageLabel.addMouseTrackListener(mouseTrackListener);

    /* Clicked on item to open it */
    MouseAdapter mouseListener = new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {

        /* Close Popup if required after opening */
        if (fGlobalScope.getBoolean(DefaultPreferences.CLOSE_NOTIFIER_ON_OPEN)) {
          item.open(e);
          doClose();
        }

        /* Indicate the item is marked as read now and open */
        else {
          item.setRead(true);
          itemLabel.setFont(fNormalTextFont);
          item.open(e);
        }
      }
    };

    itemLabel.addMouseListener(mouseListener);
    imageLabel.addMouseListener(mouseListener);

    /* Offer Label to mark item read */
    CLabel markReadLabel = new CLabel(fInnerContentCircle, SWT.NONE);
    markReadLabel.setImage(item.supportsMarkRead() ? fMarkReadIcon : fMarkReadDisabledIcon);
    markReadLabel.setBackground(fInnerContentCircle.getBackground());
    markReadLabel.addMouseTrackListener(fMouseTrackListner);
    markReadLabel.setEnabled(item.supportsMarkRead());
    markReadLabel.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    markReadLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseDown(MouseEvent e) {
        boolean newStateRead = !item.isRead();

        /* Update Font */
        itemLabel.setFont(newStateRead ? fNormalTextFont : fBoldTextFont);

        /* Apply state */
        item.setRead(newStateRead);
      }
    });

    /* Offer Label to mark item sticky */
    final CLabel markStickyLabel = new CLabel(fInnerContentCircle, SWT.NONE);
    markStickyLabel.setImage(item.supportsSticky() ? fItemNonStickyIcon : fItemNonStickyDisabledIcon);
    markStickyLabel.setBackground(fInnerContentCircle.getBackground());
    markStickyLabel.setEnabled(item.supportsSticky());
    markStickyLabel.addMouseTrackListener(fMouseTrackListner);
    markStickyLabel.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    markStickyLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseDown(MouseEvent e) {
        boolean newStateSticky = !item.isSticky();

        /* Update Background Color */
        if (!OwlUI.isHighContrast())
          itemLabel.setRoundRectangleBackground(newStateSticky ? fStickyBgColor : null);

        /* Update Image */
        markStickyLabel.setImage(newStateSticky ? fItemStickyIcon : fItemNonStickyIcon);

        /* Apply state */
        item.setSticky(newStateSticky);
      }
    });

    /* Show Sticky if required */
    if (item.supportsSticky() && item.isSticky()) {
      if (!OwlUI.isHighContrast())
        itemLabel.setRoundRectangleBackground(fStickyBgColor);
      markStickyLabel.setImage(fItemStickyIcon);
    }

    /* Show excerpt of content if set */
    if (fGlobalScope.getBoolean(DefaultPreferences.SHOW_EXCERPT_IN_NOTIFIER)) {
      String description = item.getDescription();
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

        gc.drawPoint(clArea.width - 1, 3);
      }
    });

    /* Title Label displaying RSSOwl */
    fTitleCircleLabel = new CLabel(titleCircle, SWT.NO_FOCUS);
    fTitleCircleLabel.setImage(OwlUI.getImage(fResources, "icons/product/24x24.png")); //$NON-NLS-1$
    fTitleCircleLabel.setText("RSSOwl"); //$NON-NLS-1$
    fTitleCircleLabel.setFont(fBoldTextFont);
    fTitleCircleLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    fTitleCircleLabel.addMouseTrackListener(fMouseTrackListner);
    fTitleCircleLabel.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fTitleCircleLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        doRestore();
      }
    });

    /* CLabel to display a cross to close the popup */
    final CLabel closeButton = new CLabel(titleCircle, SWT.NO_FOCUS);
    closeButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    closeButton.setImage(fCloseImageNormal);
    closeButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    closeButton.addMouseTrackListener(fMouseTrackListner);
    closeButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        doClose();
      }

      @Override
      public void mouseDown(MouseEvent e) {
        closeButton.setImage(fCloseImagePressed);
      }
    });

    closeButton.addMouseTrackListener(new MouseTrackAdapter() {
      @Override
      public void mouseEnter(MouseEvent e) {
        closeButton.setImage(fCloseImageHot);
      }

      @Override
      public void mouseExit(MouseEvent e) {
        closeButton.setImage(fCloseImageNormal);
      }
    });

    /* Outer composite to hold content controlls */
    fOuterContentCircle = new Composite(outerCircle, SWT.NONE);
    fOuterContentCircle.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    fOuterContentCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fOuterContentCircle.setBackground(outerCircle.getBackground());

    /* Middle composite to show a 1px black line around the content controlls */
    Composite middleContentCircle = new Composite(fOuterContentCircle, SWT.NO_FOCUS);
    middleContentCircle.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    ((GridLayout) middleContentCircle.getLayout()).marginTop = 1;
    ((GridLayout) middleContentCircle.getLayout()).marginBottom = 1;
    middleContentCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    middleContentCircle.setBackground(fNotifierColors.getBorder());

    /* Inner composite containing the content controlls */
    fInnerContentCircle = new Composite(middleContentCircle, SWT.NO_FOCUS);
    fInnerContentCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fInnerContentCircle.setLayout(LayoutUtils.createGridLayout(4, 0, 5, 0, 0, false));
    ((GridLayout) fInnerContentCircle.getLayout()).marginLeft = 5;
    ((GridLayout) fInnerContentCircle.getLayout()).marginRight = 2;
    fInnerContentCircle.addMouseTrackListener(fMouseTrackListner);
    fInnerContentCircle.setBackground(fShell.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    /* Footer Area containing navigational controls */
    final Composite footerCircle = new Composite(outerCircle, SWT.NO_FOCUS);
    footerCircle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    footerCircle.setBackgroundMode(SWT.INHERIT_FORCE);
    footerCircle.setLayout(LayoutUtils.createGridLayout(3, 3, 0, 5, 3, false));
    footerCircle.addMouseTrackListener(fMouseTrackListner);
    footerCircle.addControlListener(new ControlAdapter() {
      @Override
      public void controlResized(ControlEvent e) {
        Rectangle clArea = footerCircle.getClientArea();
        Image oldBgImage = fFooterBgImage;
        fFooterBgImage = new Image(footerCircle.getDisplay(), clArea.width, clArea.height);
        GC gc = new GC(fFooterBgImage);

        /* Gradient */
        drawGradient(gc, clArea);

        /* Fix Region Shape */
        fixRegion(gc, clArea);

        gc.dispose();

        footerCircle.setBackgroundImage(fFooterBgImage);

        if (oldBgImage != null)
          oldBgImage.dispose();
      }

      private void drawGradient(GC gc, Rectangle clArea) {
        gc.setBackground(fNotifierColors.getGradientBegin());
        gc.setForeground(fNotifierColors.getGradientEnd());
        gc.fillGradientRectangle(clArea.x, clArea.y, clArea.width, clArea.height, true);
      }

      private void fixRegion(GC gc, Rectangle clArea) {
        gc.setForeground(fNotifierColors.getBorder());

        /* Fill Bottom Left */
        gc.drawPoint(2, clArea.height - 0);
        gc.drawPoint(3, clArea.height - 0);
        gc.drawPoint(1, clArea.height - 1);
        gc.drawPoint(0, clArea.height - 2);
        gc.drawPoint(0, clArea.height - 3);

        /* Fill Bottom Right */
        gc.drawPoint(clArea.width - 4, clArea.height - 0);
        gc.drawPoint(clArea.width - 3, clArea.height - 0);
        gc.drawPoint(clArea.width - 2, clArea.height - 1);
        gc.drawPoint(clArea.width - 1, clArea.height - 2);
        gc.drawPoint(clArea.width - 1, clArea.height - 3);
      }
    });

    /* Title Label displaying RSSOwl */
    fFooterCircleLabel = new CLabel(footerCircle, SWT.NO_FOCUS);
    fFooterCircleLabel.setFont(fBoldTextFont);
    fFooterCircleLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));

    /* Nav to previous News */
    fPrevButton = new CLabel(footerCircle, SWT.NO_FOCUS);
    fPrevButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, true));
    fPrevButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fPrevButton.addMouseTrackListener(fMouseTrackListner);
    fPrevButton.setImage(fPrevImageDisabled);
    fPrevButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        onNavPrevious();
      }

      @Override
      public void mouseDown(MouseEvent e) {
        if (canNavPrevious())
          fPrevButton.setImage(fPrevImagePressed);
      }
    });

    /* Nav to next News */
    fNextButton = new CLabel(footerCircle, fMode == Mode.INCOMING_AUTOMATIC ? SWT.NO_FOCUS : SWT.NONE);
    fNextButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
    fNextButton.addMouseTrackListener(fMouseTrackListner);
    fNextButton.setCursor(fShell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    fNextButton.setImage(fNextImageDisabled);
    fNextButton.addMouseListener(new MouseAdapter() {
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

  final Button skipYesButton = new Button(composite, SWT.RADIO); skipYesButton.setText("Yes");
  final Button skipNoButton = new Button(composite, SWT.RADIO);  skipNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isSkipHidden() ) skipYesButton.setSelection(true);
  else skipNoButton.setSelection(true);

  CLabel skipDescr = new CLabel (composite, SWT.BORDER);
  GridData skiplGd = new GridData();
  skiplGd.horizontalSpan = 5; skiplGd.grabExcessHorizontalSpace = true;
  skiplGd.horizontalAlignment = GridData.FILL;
  skipDescr.setText("A hidden directory starts with a period and may contain files that you do not want to index");
  skipDescr.setBackground( labelColors, new int[] {100} );
  skipDescr.setLayoutData(skiplGd);

  //*-- build second row and description for extracting entities
  GridData extGd = new GridData(); extGd.grabExcessHorizontalSpace = true; extGd.horizontalAlignment = GridData.FILL;
  Label extLabel = new Label(composite, SWT.LEFT); extLabel.setText("Follow Symbolic Links: ");
  extLabel.setLayoutData(extGd);

  final Button folYesButton = new Button(composite, SWT.RADIO); folYesButton.setText("Yes");
  final Button folNoButton = new Button(composite, SWT.RADIO); folNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isFollowLinks() ) folYesButton.setSelection(true);
  else folNoButton.setSelection(true);

  CLabel folDescr = new CLabel (composite, SWT.BORDER);
  GridData folGd = new GridData();
  folGd.horizontalSpan = 5; folGd.grabExcessHorizontalSpace = true;
  folGd.horizontalAlignment = GridData.FILL;
  folDescr.setText("Following symbolic links may lead to an infinite loop");
  folDescr.setBackground( labelColors, new int[] {100} );
  folDescr.setLayoutData(folGd);

  //*-- build third row and description to skip duplicate files
  GridData keepGd = new GridData(); keepGd.grabExcessHorizontalSpace = true; keepGd.horizontalAlignment = GridData.FILL;
  Label keepLabel = new Label(composite, SWT.LEFT);
  keepLabel.setText("Keep Duplicate Files: ");
  keepLabel.setLayoutData(keepGd);

  final Button keepYesButton = new Button(composite, SWT.RADIO); keepYesButton.setText("Yes");
  final Button keepNoButton = new Button(composite, SWT.RADIO);  keepNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isKeepDups() ) keepYesButton.setSelection(true);
  else keepNoButton.setSelection(true);

  CLabel keepDescr = new CLabel (composite, SWT.BORDER);
  GridData keeplGd = new GridData();
  keeplGd.horizontalSpan = 5; keeplGd.grabExcessHorizontalSpace = true;
  keeplGd.horizontalAlignment = GridData.FILL;
  keepDescr.setText("Duplicate files have the same text content and will appear twice in hit lists");
  keepDescr.setBackground( labelColors, new int[] {100} );
  keepDescr.setLayoutData(keeplGd);

  //*-- build fourth row and description to handle a fresh crawl
  GridData freshGd = new GridData(); freshGd.grabExcessHorizontalSpace = true; freshGd.horizontalAlignment = GridData.FILL;
  Label freshLabel = new Label(composite, SWT.LEFT);
  freshLabel.setText("Fresh Crawl: ");
  freshLabel.setLayoutData(freshGd);

  final Button freshYesButton = new Button(composite, SWT.RADIO); freshYesButton.setText("Yes");
  final Button freshNoButton = new Button(composite, SWT.RADIO); freshNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isFreshCrawl() ) freshYesButton.setSelection(true);
  else freshNoButton.setSelection(true);

  CLabel freshDescr = new CLabel (composite, SWT.BORDER);
  GridData freshlGd = new GridData();
  freshlGd.horizontalSpan = 5; freshlGd.grabExcessHorizontalSpace = true;
  freshlGd.horizontalAlignment = GridData.FILL;
  freshDescr.setText("A fresh crawl starts indexing after wiping all earlier entries");
  freshDescr.setBackground( labelColors, new int[] {100} );
  freshDescr.setLayoutData(freshlGd);

  //*-- add the fifth row for the number of threads
  GridData numGd = new GridData(); numGd.grabExcessHorizontalSpace = true; numGd.horizontalAlignment = GridData.FILL;
  Label numLabel = new Label(composite, SWT.LEFT);
  numLabel.setText("Number of Threads: ");
  numLabel.setLayoutData(numGd);

  final Combo threadCombo = new Combo(composite, SWT.SINGLE |  SWT.BORDER );
  final String[] threads =  new String[] { "1", "2", "4", "8"};
  for (int i = 0; i < threads.length; i++) threadCombo.add(threads[i]);
  int numThreads = ( (CrawlConfigWizard) getWizard()).crawlConfig.getNumThreads();
  switch (numThreads)
  { case 1: threadCombo.select(0); break;
  case 2: threadCombo.select(1); break;
  case 4: threadCombo.select(2); break;
  case 8: threadCombo.select(3); break;
  }

  CLabel threadDescr = new CLabel (composite, SWT.BORDER);
  GridData threadlGd = new GridData();
  threadlGd.horizontalSpan = 5; threadlGd.grabExcessHorizontalSpace = true;
  threadlGd.horizontalAlignment = GridData.FILL;
  threadDescr.setText("More than one thread will be beneficial in a multi-processor machine");
  threadDescr.setBackground( labelColors, new int[] {100} );
  threadDescr.setLayoutData(freshlGd);

  //*-- build sizth row and description to handle the spell checker
  GridData spellGd = new GridData(); spellGd.grabExcessHorizontalSpace = true; spellGd.horizontalAlignment = GridData.FILL;
  Label spellLabel = new Label(composite, SWT.LEFT);
  spellLabel.setText("Use Spell Checker: ");
  spellLabel.setLayoutData(freshGd);

  final Button spellYesButton = new Button(composite, SWT.RADIO); spellYesButton.setText("Yes");
  final Button spellNoButton = new Button(composite, SWT.RADIO); spellNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isSpellCheck() ) spellYesButton.setSelection(true);
  else spellNoButton.setSelection(true);

  CLabel spellDescr = new CLabel (composite, SWT.BORDER);
  GridData spelllGd = new GridData();
  spelllGd.horizontalSpan = 5; spelllGd.grabExcessHorizontalSpace = true;
  spelllGd.horizontalAlignment = GridData.FILL;
  spellDescr.setText("A spell checker can provide alternative queries");
  spellDescr.setBackground( labelColors, new int[] {100} );
  spellDescr.setLayoutData(freshlGd);
  //*-- build the listener
  Listener selectionListener = new Listener()
  { public void handleEvent(Event event)
  {
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

    // between this code defining the creation and layout of the standard
    // widgets and the update method.

    setLayout(new StatusLineLayout());

    fMessageLabel = new CLabel(this, SWT.NONE);// SWT.SHADOW_IN);
   
    // this would need extra work to make this accessible
    // from the workbench command framework.
    Menu menu = new Menu(fMessageLabel);
    fMessageLabel.setMenu(menu);
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

    setLayoutData(new GridData(GridData.FILL_BOTH));

    ViewForm viewerPane = new ViewForm(this, SWT.BORDER | SWT.FLAT);
    viewerPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

        CLabel toolbarLabel = new CLabel(viewerPane, SWT.NONE) {
          public Point computeSize(int wHint, int hHint, boolean changed) {
            return super.computeSize(wHint, Math.max(24, hHint), changed);
          }
        };
 
      if (label != null) {
        toolbarLabel.setText(label);
      }
        viewerPane.setTopLeft(toolbarLabel);
   
      int buttonGroupColumns = 1;
      if (toolbarControlCreator != null) {
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

        setLayout(new GridLayout(2, false));
        setLayoutData(new GridData(GridData.FILL_BOTH));

        ViewForm viewerPane = new ViewForm(this, SWT.BORDER | SWT.FLAT);
        viewerPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
        CLabel toolbarLabel = new CLabel(viewerPane, SWT.NONE) {
            public Point computeSize(int wHint, int hHint, boolean changed) {
                return super.computeSize(wHint, Math.max(24, hHint), changed);
            }
        };
        if (label != null) {
            toolbarLabel.setText(label);
        }
        viewerPane.setTopLeft(toolbarLabel);

        int buttonGroupColumns = 1;
        if (toolbarControlCreator != null) {
View Full Code Here

Examples of org.eclipse.swt.custom.CLabel

  {
    // separator
    //new Label(parent, SWT.SEPARATOR);
   
    // count label
    countLabel = new CLabel(parent, SWT.SHADOW_NONE | SWT.RIGHT);
   
    if (widthHint < 0)
    {
      GC gc = new GC(parent);
      gc.setFont(parent.getFont());
      FontMetrics fm = gc.getFontMetrics();
     
      if (charWidth == -1)
        widthHint = fm.getAverageCharWidth() * text.length();
      else
        widthHint = fm.getAverageCharWidth() * charWidth;
     
      widthHint += image.getBounds().width + 10;
      gc.dispose();
    }
   
    countLabel.setLayoutData(createStatusLineLayoutData(widthHint, SWT.DEFAULT));
    countLabel.setText(text);
   
    if (tooltip != null)
      countLabel.setToolTipText(tooltip);
   
    // image label
    imageLabel = new CLabel(parent, SWT.SHADOW_NONE);
    imageLabel.setImage(image);
    imageLabel.setToolTipText("Halo 3 Status");
  }
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.