-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#63: various improvements on RichTextArea (Font settings popup with p…
…review)
- Loading branch information
Showing
26 changed files
with
619 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...dget-impl-web-gwt/src/main/java/net/sf/mmm/client/ui/impl/gwt/gwtwidgets/BorderPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
package net.sf.mmm.client.ui.impl.gwt.gwtwidgets; | ||
|
||
import com.google.gwt.dom.client.Document; | ||
import com.google.gwt.dom.client.Element; | ||
|
||
/** | ||
* This is a custom {@link com.google.gwt.user.client.ui.Widget} that represents a | ||
* {@link net.sf.mmm.client.ui.api.widget.panel.UiWidgetBorderPanel} (fieldset-tag). | ||
* | ||
* @author Joerg Hohwiller (hohwille at users.sourceforge.net) | ||
* @since 1.0.0 | ||
*/ | ||
public class BorderPanel extends SingleCompositePanel { | ||
|
||
/** The labeled legend element. */ | ||
private final Element legend; | ||
|
||
/** | ||
* The constructor. | ||
*/ | ||
public BorderPanel() { | ||
|
||
super(); | ||
setElement(Document.get().createElement("fieldset")); | ||
this.legend = Document.get().createElement("legend"); | ||
getElement().appendChild(this.legend); | ||
} | ||
|
||
/** | ||
* @param label is the label for the border text. | ||
*/ | ||
public void setLabel(String label) { | ||
|
||
// HTML injection??? | ||
this.legend.setInnerText(label); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
...-web-gwt/src/main/java/net/sf/mmm/client/ui/impl/gwt/gwtwidgets/SingleCompositePanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
package net.sf.mmm.client.ui.impl.gwt.gwtwidgets; | ||
|
||
import java.util.Iterator; | ||
|
||
import net.sf.mmm.util.collection.base.SingleElementIterator; | ||
|
||
import com.google.gwt.user.client.ui.Panel; | ||
import com.google.gwt.user.client.ui.Widget; | ||
|
||
/** | ||
* This is a custom {@link Widget} that represents a {@link Panel} owing a single child. | ||
* | ||
* @author Joerg Hohwiller (hohwille at users.sourceforge.net) | ||
* @since 1.0.0 | ||
*/ | ||
public abstract class SingleCompositePanel extends Panel { | ||
|
||
/** @see #setChild(Widget) */ | ||
private Widget childWidget; | ||
|
||
/** | ||
* The constructor. | ||
*/ | ||
public SingleCompositePanel() { | ||
|
||
super(); | ||
} | ||
|
||
/** | ||
* @param child is the Widget to set as child. A potential previous child will be removed. | ||
*/ | ||
public void setChild(Widget child) { | ||
|
||
if (this.childWidget != null) { | ||
remove(this.childWidget); | ||
} | ||
if (child != null) { | ||
add(child); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Iterator<Widget> iterator() { | ||
|
||
return new SingleElementIterator<Widget>(this.childWidget); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void add(Widget child) { | ||
|
||
if (this.childWidget == null) { | ||
getElement().appendChild(child.getElement()); | ||
this.childWidget = child; | ||
adopt(child); | ||
} else { | ||
throw new IllegalStateException("Multiple children not supported!"); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean remove(Widget child) { | ||
|
||
if (child == null) { | ||
return false; | ||
} | ||
if (this.childWidget == child) { | ||
orphan(child); | ||
getElement().removeChild(child.getElement()); | ||
this.childWidget = null; | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
} |
Oops, something went wrong.