Browse Source

Fixed GridLayout caption rendering

Components that do not delegate caption handling to parent should not
get a caption
tags/7.0.0.alpha2
Artur Signell 12 years ago
parent
commit
e420751790

+ 15
- 0
src/com/vaadin/terminal/gwt/client/ComponentConnector.java View File

@@ -104,4 +104,19 @@ public interface ComponentConnector extends ServerConnector {

public boolean hasEventListener(String eventIdentifier);

/**
* Return true if parent handles caption, false if the paintable handles the
* caption itself.
*
* <p>
* This should always return true and all components should let the parent
* handle the caption and use other attributes for internal texts in the
* component
* </p>
*
* @return true if caption handling is delegated to the parent, false if
* parent should not be allowed to render caption
*/
public boolean delegateCaptionHandling();

}

+ 6
- 10
src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java View File

@@ -219,18 +219,14 @@ public abstract class AbstractComponentConnector extends AbstractConnector
}
}

/**
* Return true if parent handles caption, false if the paintable handles the
* caption itself.
*
/*
* (non-Javadoc)
*
* @deprecated This should always return true and all components should let
* the parent handle the caption and use other attributes for
* internal texts in the component
* @return
* @see
* com.vaadin.terminal.gwt.client.ComponentConnector#delegateCaptionHandling
* ()
*/
@Deprecated
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return true;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java View File

@@ -43,7 +43,7 @@ public class ButtonConnector extends AbstractComponentConnector implements
}

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java View File

@@ -19,7 +19,7 @@ public class CheckBoxConnector extends AbstractFieldConnector implements
Paintable {

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/FormConnector.java View File

@@ -49,7 +49,7 @@ public class FormConnector extends AbstractComponentContainerConnector
}

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 3
- 1
src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java View File

@@ -168,7 +168,9 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector
needCaptionUpdate = false;

for (ComponentConnector child : getChildren()) {
updateCaption(child);
if (child.delegateCaptionHandling()) {
updateCaption(child);
}
}
}
getLayoutManager().setNeedsUpdate(this);

+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java View File

@@ -17,7 +17,7 @@ public class LinkConnector extends AbstractComponentConnector implements
Paintable {

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java View File

@@ -27,7 +27,7 @@ public class NativeButtonConnector extends AbstractComponentConnector implements
}

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java View File

@@ -86,7 +86,7 @@ public class PanelConnector extends AbstractComponentContainerConnector
}

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java View File

@@ -20,7 +20,7 @@ public class PopupViewConnector extends AbstractComponentContainerConnector
private boolean centerAfterLayout = false;

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java View File

@@ -15,7 +15,7 @@ public class UnknownComponentConnector extends AbstractComponentConnector
implements Paintable {

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java View File

@@ -112,7 +112,7 @@ public class WindowConnector extends AbstractComponentContainerConnector
private WindowServerRPC rpc;

@Override
protected boolean delegateCaptionHandling() {
public boolean delegateCaptionHandling() {
return false;
};


Loading…
Cancel
Save