summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/TabSheet.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/TabSheet.java')
-rw-r--r--server/src/com/vaadin/ui/TabSheet.java115
1 files changed, 20 insertions, 95 deletions
diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java
index 5a1aa02845..82faedcc41 100644
--- a/server/src/com/vaadin/ui/TabSheet.java
+++ b/server/src/com/vaadin/ui/TabSheet.java
@@ -176,7 +176,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
fireSelectedTabChange();
}
}
- requestRepaint();
+ markAsDirty();
}
}
@@ -301,7 +301,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
fireSelectedTabChange();
}
super.addComponent(c);
- requestRepaint();
+ markAsDirty();
return tab;
}
}
@@ -361,8 +361,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
String caption = null;
Resource icon = null;
if (TabSheet.class.isAssignableFrom(source.getClass())) {
- caption = ((TabSheet) source).getTabCaption(c);
- icon = ((TabSheet) source).getTabIcon(c);
+ Tab tab = ((TabSheet) source).getTab(c);
+ caption = tab.getCaption();
+ icon = tab.getIcon();
}
source.removeComponent(c);
addTab(c, caption, icon);
@@ -474,83 +475,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
*/
public void hideTabs(boolean tabsHidden) {
this.tabsHidden = tabsHidden;
- requestRepaint();
- }
-
- /**
- * Gets tab caption. The tab is identified by the tab content component.
- *
- * @param c
- * the component in the tab
- * @deprecated Use {@link #getTab(Component)} and {@link Tab#getCaption()}
- * instead.
- */
- @Deprecated
- public String getTabCaption(Component c) {
- Tab info = tabs.get(c);
- if (info == null) {
- return "";
- } else {
- return info.getCaption();
- }
- }
-
- /**
- * Sets tab caption. The tab is identified by the tab content component.
- *
- * @param c
- * the component in the tab
- * @param caption
- * the caption to set.
- * @deprecated Use {@link #getTab(Component)} and
- * {@link Tab#setCaption(String)} instead.
- */
- @Deprecated
- public void setTabCaption(Component c, String caption) {
- Tab info = tabs.get(c);
- if (info != null) {
- info.setCaption(caption);
- requestRepaint();
- }
- }
-
- /**
- * Gets the icon for a tab. The tab is identified by the tab content
- * component.
- *
- * @param c
- * the component in the tab
- * @deprecated Use {@link #getTab(Component)} and {@link Tab#getIcon()}
- * instead.
- */
- @Deprecated
- public Resource getTabIcon(Component c) {
- Tab info = tabs.get(c);
- if (info == null) {
- return null;
- } else {
- return info.getIcon();
- }
- }
-
- /**
- * Sets icon for the given component. The tab is identified by the tab
- * content component.
- *
- * @param c
- * the component in the tab
- * @param icon
- * the icon to set
- * @deprecated Use {@link #getTab(Component)} and
- * {@link Tab#setIcon(Resource)} instead.
- */
- @Deprecated
- public void setTabIcon(Component c, Resource icon) {
- Tab info = tabs.get(c);
- if (info != null) {
- info.setIcon(icon);
- requestRepaint();
- }
+ markAsDirty();
}
/**
@@ -594,7 +519,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
setSelected(c);
updateSelection();
fireSelectedTabChange();
- requestRepaint();
+ markAsDirty();
}
}
@@ -612,13 +537,13 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
// "cached" update even though the client knows nothing about the
// connector
if (selected instanceof ComponentContainer) {
- ((ComponentContainer) selected).requestRepaintAll();
+ ((ComponentContainer) selected).markAsDirtyRecursive();
} else if (selected instanceof Table) {
// Workaround until there's a generic way of telling a component
// that there is no client side state to rely on. See #8642
((Table) selected).refreshRowCache();
} else if (selected != null) {
- selected.requestRepaint();
+ selected.markAsDirty();
}
}
@@ -791,7 +716,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
copyTabMetadata(oldTab, newTab);
copyTabMetadata(tmp, oldTab);
- requestRepaint();
+ markAsDirty();
}
}
@@ -1103,7 +1028,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setCaption(String caption) {
this.caption = caption;
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1114,7 +1039,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setIcon(Resource icon) {
this.icon = icon;
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1128,7 +1053,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
if (updateSelection()) {
fireSelectedTabChange();
}
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1142,7 +1067,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
if (updateSelection()) {
fireSelectedTabChange();
}
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1153,7 +1078,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setClosable(boolean closable) {
this.closable = closable;
- requestRepaint();
+ markAsDirty();
}
public void close() {
@@ -1168,7 +1093,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setDescription(String description) {
this.description = description;
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1179,7 +1104,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setComponentError(ErrorMessage componentError) {
this.componentError = componentError;
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1195,7 +1120,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setStyleName(String styleName) {
this.styleName = styleName;
- requestRepaint();
+ markAsDirty();
}
@Override
@@ -1255,7 +1180,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
int oldPosition = getTabPosition(tab);
components.remove(oldPosition);
components.add(position, tab.getComponent());
- requestRepaint();
+ markAsDirty();
}
/**
@@ -1282,7 +1207,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
@Override
public void setTabIndex(int tabIndex) {
this.tabIndex = tabIndex;
- requestRepaint();
+ markAsDirty();
}
@Override