home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / StyledEditorKit$ItalicAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  1.7 KB  |  23 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import com.sun.java.swing.JEditorPane;
  4. import java.awt.event.ActionEvent;
  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.