summaryrefslogtreecommitdiff
path: root/javax/swing/text/StyledEditorKit.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/text/StyledEditorKit.java')
-rw-r--r--javax/swing/text/StyledEditorKit.java33
1 files changed, 25 insertions, 8 deletions
diff --git a/javax/swing/text/StyledEditorKit.java b/javax/swing/text/StyledEditorKit.java
index e71f992b5..c4eef4463 100644
--- a/javax/swing/text/StyledEditorKit.java
+++ b/javax/swing/text/StyledEditorKit.java
@@ -67,7 +67,7 @@ public class StyledEditorKit extends DefaultEditorKit
*/
public UnderlineAction()
{
- super("TODO"); // TODO: Figure out name for this action.
+ super("font-underline");
}
/**
@@ -97,7 +97,7 @@ public class StyledEditorKit extends DefaultEditorKit
*/
public ItalicAction()
{
- super("TODO"); // TODO: Figure out correct name of this Action.
+ super("font-italic");
}
/**
@@ -127,7 +127,7 @@ public class StyledEditorKit extends DefaultEditorKit
*/
public BoldAction()
{
- super("TODO"); // TODO: Figure out correct name of this Action.
+ super("font-bold");
}
/**
@@ -585,8 +585,26 @@ public class StyledEditorKit extends DefaultEditorKit
public Action[] getActions()
{
Action[] actions1 = super.getActions();
- Action[] myActions = new Action[] { new BoldAction(), new ItalicAction(),
- new UnderlineAction() };
+ Action[] myActions = new Action[] {
+ new FontSizeAction("font-size-8", 8),
+ new FontSizeAction("font-size-10", 10),
+ new FontSizeAction("font-size-12", 12),
+ new FontSizeAction("font-size-14", 14),
+ new FontSizeAction("font-size-16", 16),
+ new FontSizeAction("font-size-18", 18),
+ new FontSizeAction("font-size-24", 24),
+ new FontSizeAction("font-size-36", 36),
+ new FontSizeAction("font-size-48", 48),
+ new FontFamilyAction("font-family-Serif", "Serif"),
+ new FontFamilyAction("font-family-Monospaced", "Monospaced"),
+ new FontFamilyAction("font-family-SansSerif", "SansSerif"),
+ new AlignmentAction("left-justify", StyleConstants.ALIGN_LEFT),
+ new AlignmentAction("center-justify", StyleConstants.ALIGN_CENTER),
+ new AlignmentAction("right-justify", StyleConstants.ALIGN_RIGHT),
+ new BoldAction(),
+ new ItalicAction(),
+ new UnderlineAction()
+ };
return TextAction.augmentList(actions1, myActions);
}
@@ -696,9 +714,8 @@ public class StyledEditorKit extends DefaultEditorKit
protected void createInputAttributes(Element element,
MutableAttributeSet set)
{
- AttributeSet atts = element.getAttributes();
- set.removeAttributes(set);
// FIXME: Filter out component, icon and element name attributes.
- set.addAttributes(atts);
+ set.removeAttributes(set);
+ set.addAttributes(element.getAttributes());
}
}