home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / text / StyledEditorKit$ItalicAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.1 KB  |  23 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.JEditorPane;
  5.  
  6. public class StyledEditorKit$ItalicAction extends StyledEditorKit.StyledTextAction {
  7.    public StyledEditorKit$ItalicAction() {
  8.       super("font-italic");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent var1) {
  12.       JEditorPane var2 = ((StyledEditorKit.StyledTextAction)this).getEditor(var1);
  13.       if (var2 != null) {
  14.          StyledEditorKit var3 = ((StyledEditorKit.StyledTextAction)this).getStyledEditorKit(var2);
  15.          MutableAttributeSet var4 = var3.getInputAttributes();
  16.          boolean var5 = !StyleConstants.isItalic(var4);
  17.          StyleConstants.setItalic(var4, var5);
  18.          ((StyledEditorKit.StyledTextAction)this).setCharacterAttributes(var2, var4, false);
  19.       }
  20.  
  21.    }
  22. }
  23.