Examples of StyledText


Examples of org.eclipse.swt.custom.StyledText

    this.icon = icon;
    detailsShell = new Shell(display,SWT.BORDER | SWT.ON_TOP);
    Utils.setShellIcon(detailsShell);
   
    detailsShell.setLayout(new FillLayout());
    StyledText textDetails = new StyledText(detailsShell, SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER)
    textDetails.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    textDetails.setWordWrap( true );
    detailsShell.layout();   
    detailsShell.setSize(550,300);   
   

    int popupWidth = 280;
    int popupHeight = 170;

    shell = new Shell(display,SWT.ON_TOP);
    Utils.setShellIcon(shell);

    FormLayout layout = new FormLayout();
    layout.marginHeight = 0; layout.marginWidth = 0;
    try {
      layout.spacing = 0;
    } catch (NoSuchFieldError e) {
      /* Ignore for Pre 3.0 SWT.. */
    }
    shell.setLayout(layout);
   
    ImageLoader imageLoader = ImageLoader.getInstance();
    Image popup_image = imageLoader.getImage("popup");

    // this code is here to ensure that we can still show error messages even if images
    // are failing to load (e.g. coz there's a ! in AZ install dir... )

    GC gcImage = null;
    if (ImageLoader.isRealImage(popup_image)) {
      shellImg = new Image(display, popup_image, SWT.IMAGE_COPY);
      popupWidth = popup_image.getBounds().width;
      popupHeight = popup_image.getBounds().height;
    } else {
      shellImg = new Image(display,
          new Rectangle(0, 0, popupWidth, popupHeight));
    }
    imageLoader.releaseImage("popup");

    shell.setSize(popupWidth, popupHeight);

    gcImage = new GC(shellImg);

    Image imgIcon = imageLoader.getImage(icon);
    int iconWidth = 0;
    int iconHeight = 15;
    if (ImageLoader.isRealImage(imgIcon)) {
      gcImage.drawImage(imgIcon, 5, 5);
      iconWidth = imgIcon.getBounds().width;
      iconHeight = imgIcon.getBounds().height;
    }
    imageLoader.releaseImage(icon);
     

    Font tempFont = shell.getFont();
    FontData[] fontDataMain = tempFont.getFontData();
    for (int i = 0; i < fontDataMain.length; i++) {
      fontDataMain[i].setStyle(SWT.BOLD);
      fontDataMain[i].setHeight((int) (fontDataMain[i].getHeight() * 1.2));
    }

    Font fontTitle = new Font(display, fontDataMain);
    gcImage.setFont(fontTitle);

    Rectangle rect = new Rectangle(iconWidth + 10, 5, popupWidth - iconWidth
        - 15, iconHeight);
    GCStringPrinter.printString(gcImage, title, rect);

    gcImage.setFont(tempFont);
    fontTitle.dispose();

    rect = new Rectangle(5, iconHeight + 5, popupWidth - 10, popupHeight
        - iconHeight - 60);
    boolean bItFit = GCStringPrinter.printString(gcImage, errorMessage, rect);

    gcImage.dispose();
    if (!bItFit && details == null)
      details = errorMessage;
   
    if(details != null)
      textDetails.setText(details);

    final Button btnDetails = new Button(shell,SWT.TOGGLE);
    Messages.setLanguageText(btnDetails,"popup.error.details");   
    btnDetails.setEnabled(details != null);
   
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

          boolean bShow = btnDetails.getSelection();
          if (bShow) {
            Shell detailsShell = new Shell(display, SWT.BORDER | SWT.ON_TOP);
            Utils.setShellIcon(detailsShell);
            detailsShell.setLayout(new FillLayout());
            StyledText textDetails = new StyledText(detailsShell, SWT.READ_ONLY
                | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
            textDetails.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
            textDetails.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
            textDetails.setWordWrap(true);
            textDetails.setText(sDetails);
            detailsShell.layout();
            Rectangle shellBounds = shell.getBounds();
            detailsShell.setBounds(shellBounds.x + shellBounds.width
                - DETAILS_WIDTH, shellBounds.y - DETAILS_HEIGHT, DETAILS_WIDTH,
                DETAILS_HEIGHT);
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    copyright.setText("Copyright (C) 2007-2010 JMule Team");
    copyright.setFont(bold_font);
   
    new Label(container1,SWT.NONE);
   
    StyledText about_text = new StyledText(container1,SWT.LEFT | SWT.READ_ONLY);
    about_text.setText(_._("aboutwindow.tab.general.label.about"));
    about_text.setWordWrap(true);
    about_text.setBackground(shell.getBackground());
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    about_text.setLayoutData(layout_data);
   
    Composite links_container = new Composite(content,SWT.NONE);
    links_container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(2,false);
    layout.marginWidth = 15;
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

  public LogsTab(Composite shell) {
    super(shell);
   
    setLayout(new FillLayout());
   
    log_content = new StyledText(this,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.READ_ONLY);
    log_content.setEditable(false);
    log_content.setBackground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_WHITE));
   
    popup_menu = new Menu(log_content);
   
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    Group changelog_group = new Group(shell,SWT.NONE);
    changelog_group.setLayout(new FillLayout());
    changelog_group.setLayoutData(new GridData(GridData.FILL_BOTH));
    changelog_group.setText(_._("updaterwindow.group.changelog"));
   
    changelog_text = new StyledText(changelog_group,SWT.H_SCROLL | SWT.V_SCROLL);
    changelog_text.setEditable(false);
    Font font_changelog = new Font(SWTThread.getDisplay(),"Courier",10,SWT.NONE );
    changelog_text.setFont(font_changelog);
   
    Composite button_bar = new Composite(shell,SWT.NONE);
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    Composite updateInfoContainer = new Composite(composite, SWT.BORDER);
    updateInfoContainer.setLayout(LayoutUtils.createGridLayout(2, 5, 5, 0, 5, false));
    updateInfoContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    updateInfoContainer.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    fUpdateInfoTextLeft = new StyledText(updateInfoContainer, SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
    fUpdateInfoTextLeft.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
    fUpdateInfoTextLeft.setLineSpacing(5);
    fUpdateInfoTextLeft.setEnabled(false);
    fUpdateInfoTextLeft.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    fUpdateInfoTextRight = new StyledText(updateInfoContainer, SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
    fUpdateInfoTextRight.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    fUpdateInfoTextRight.setLineSpacing(5);
    fUpdateInfoTextRight.setEnabled(false);
    fUpdateInfoTextRight.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    fUpdateInfoTextBottom = new StyledText(updateInfoContainer, SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
    fUpdateInfoTextBottom.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    ((GridData) fUpdateInfoTextBottom.getLayoutData()).widthHint = 300;
    fUpdateInfoTextBottom.setLineSpacing(5);
    fUpdateInfoTextBottom.setEnabled(false);
    fUpdateInfoTextBottom.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

        break;
    }
  }

  private void createIntroPage(Composite container) {
    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_WELCOME_TEXT, text);
  }
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_WELCOME_TEXT, text);
  }

  private void createOverviewPage(Composite container) {
    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_LAYOUT_TEXT, text);
  }
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_LAYOUT_TEXT, text);
  }

  private void createNewsPage(Composite container) {
    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_NEWS_TEXT, text);
  }
View Full Code Here

Examples of org.eclipse.swt.custom.StyledText

    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_NEWS_TEXT, text);
  }

  private void createSavedSearchPage(Composite container) {
    StyledText text = createStyledText(container);
    applyRichText(Messages.TutorialPage_SAVED_SEARCHES_TEXT, text);
  }
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.