org.mailster.gui
Class StyledLabel

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by org.eclipse.swt.custom.StyledText
                          extended by org.mailster.gui.StyledLabel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class StyledLabel
extends org.eclipse.swt.custom.StyledText

---
Mailster (C) 2007-2009 De Oliveira Edouard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

See  Mailster Web Site
---

StyledLabel.java - An improved SWT Label that handles automatic styling of the label text. Currently only supports :
\...\<\/a\> : show a text as a fake hyperlink
\...\<\/b\> : set bold font

Version:
$Revision: 1.8 $, $Date: 2009/03/22 21:58:56 $
Author:
Edouard De Oliveira

Field Summary
static org.eclipse.swt.graphics.Color LINK_COLOR
           
static org.eclipse.swt.graphics.Color SUBJECT_COLOR
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
StyledLabel(org.eclipse.swt.widgets.Composite c, int flags)
           
 
Method Summary
protected  void checkSubclass()
           
private  void setBold(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges, int start, int length)
           
private  void setLink(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges, int start, int length)
           
private  void setSubject(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges, int start, int length)
           
 void setText(java.lang.String s)
           
 
Methods inherited from class org.eclipse.swt.custom.StyledText
addBidiSegmentListener, addExtendedModifyListener, addLineBackgroundListener, addLineStyleListener, addModifyListener, addPaintObjectListener, addSelectionListener, addVerifyKeyListener, addVerifyListener, addWordMovementListener, append, computeSize, copy, copy, cut, getAlignment, getBackground, getBaseline, getBaseline, getBidiColoring, getCaretOffset, getCharCount, getContent, getDoubleClickEnabled, getDragDetect, getEditable, getForeground, getHorizontalIndex, getHorizontalPixel, getIndent, getJustify, getKeyBinding, getLine, getLineAlignment, getLineAtOffset, getLineBackground, getLineBullet, getLineCount, getLineDelimiter, getLineHeight, getLineHeight, getLineIndent, getLineIndex, getLineJustify, getLinePixel, getLineSpacing, getLocationAtOffset, getOffsetAtLine, getOffsetAtLocation, getOrientation, getRanges, getRanges, getSelection, getSelectionBackground, getSelectionCount, getSelectionForeground, getSelectionRange, getSelectionText, getStyle, getStyleRangeAtOffset, getStyleRanges, getStyleRanges, getStyleRanges, getStyleRanges, getTabs, getText, getText, getTextBounds, getTextLimit, getTextRange, getTopIndex, getTopPixel, getWordWrap, insert, invokeAction, paste, print, print, print, redraw, redraw, redrawRange, removeBidiSegmentListener, removeExtendedModifyListener, removeLineBackgroundListener, removeLineStyleListener, removeModifyListener, removePaintObjectListener, removeSelectionListener, removeVerifyKeyListener, removeVerifyListener, removeWordMovementListener, replaceStyleRanges, replaceTextRange, scroll, selectAll, setAlignment, setBackground, setBidiColoring, setCaret, setCaretOffset, setContent, setCursor, setDoubleClickEnabled, setDragDetect, setEditable, setFont, setForeground, setHorizontalIndex, setHorizontalPixel, setIndent, setJustify, setKeyBinding, setLineAlignment, setLineBackground, setLineBullet, setLineIndent, setLineJustify, setLineSpacing, setOrientation, setSelection, setSelection, setSelection, setSelectionBackground, setSelectionForeground, setSelectionRange, setStyleRange, setStyleRanges, setStyleRanges, setStyleRanges, setTabs, setTextLimit, setTopIndex, setTopPixel, setWordWrap, showSelection
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, setIME
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINK_COLOR

public static final org.eclipse.swt.graphics.Color LINK_COLOR

SUBJECT_COLOR

public static final org.eclipse.swt.graphics.Color SUBJECT_COLOR
Constructor Detail

StyledLabel

public StyledLabel(org.eclipse.swt.widgets.Composite c,
                   int flags)
Method Detail

setLink

private void setLink(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges,
                     int start,
                     int length)

setBold

private void setBold(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges,
                     int start,
                     int length)

setSubject

private void setSubject(java.util.ArrayList<org.eclipse.swt.custom.StyleRange> ranges,
                        int start,
                        int length)

setText

public void setText(java.lang.String s)
Overrides:
setText in class org.eclipse.swt.custom.StyledText

checkSubclass

protected void checkSubclass()
Overrides:
checkSubclass in class org.eclipse.swt.widgets.Composite