home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text.html;
-
- import com.sun.java.swing.JEditorPane;
- import com.sun.java.swing.text.MutableAttributeSet;
- import com.sun.java.swing.text.StyleConstants;
- import com.sun.java.swing.text.StyledEditorKit;
- import com.sun.java.swing.text.TextAction;
- import java.awt.event.ActionEvent;
-
- class HTMLEditorKit$ParagraphIndentAction extends HTMLEditorKit.HtmlAction {
- boolean bLeft = false;
-
- HTMLEditorKit$ParagraphIndentAction(String var1, boolean var2) {
- super(var1);
- this.bLeft = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- JEditorPane var2 = (JEditorPane)((TextAction)this).getFocusedComponent();
- if (var2 != null) {
- StyledEditorKit var3 = ((StyledEditorKit.StyledTextAction)this).getStyledEditorKit(var2);
- MutableAttributeSet var4 = var3.getInputAttributes();
- if (var4 != null) {
- int var5 = StyleConstants.getAlignment(var4);
- if (!this.bLeft) {
- if (var5 == 0) {
- var5 = 1;
- } else if (var5 == 1) {
- var5 = 2;
- }
- } else if (var5 == 1) {
- var5 = 0;
- } else if (var5 == 2) {
- var5 = 1;
- }
-
- StyleConstants.setAlignment(var4, var5);
- ((StyledEditorKit.StyledTextAction)this).setParagraphAttributes(var2, var4, false);
- }
- }
-
- }
- }
-