Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/gendiapo/editor/document/CSSLabelView.java


1   package org.gendiapo.editor.document;
2   
3   import java.util.*;
4   import javax.swing.text.*;
5   import javax.swing.text.html.*;
6   
7   public class CSSLabelView extends javax.swing.text.html.InlineView {
8       
9       StyleSheet styleSheet;
10  
11      public CSSLabelView(Element elem) {
12    super(elem);    
13      }
14  
15      public AttributeSet getAttributes() {
16    return getElement().getAttributes();
17      }
18  
19      protected StyleSheet getStyleSheet() {
20    Element elem = getElement();
21    if (styleSheet == null) {
22        AttributeSet attr = elem.getAttributes();
23        Object o = attr.getAttribute(GenDiapoDocument.STYLESHEET);
24        if (o instanceof StyleSheet) {
25      styleSheet = (StyleSheet) o;
26        } else {
27      styleSheet = new StyleSheet();
28        }
29    }
30    return styleSheet;
31      }
32      
33  }