requestThemeName = request.getParameter("theme");
maxInactiveInterval = request.getSession().getMaxInactiveInterval();
// repaint requested or session has timed out and new one is created
+ boolean repaintAll;
final OutputStream out;
- setRepaintAll(request.getParameter(GET_PARAM_REPAINT_ALL) != null);
+ repaintAll = (request.getParameter(GET_PARAM_REPAINT_ALL) != null);
// || (request.getSession().isNew()); FIXME What the h*ll is this??
out = response.getOutputStream();
boolean analyzeLayouts = false;
- if (isRepaintAll()) {
+ if (repaintAll) {
// analyzing can be done only with repaintAll
analyzeLayouts = (request.getParameter(GET_PARAM_ANALYZE_LAYOUTS) != null);
}
}
}
// No message to show, let's just repaint all.
- setRepaintAll(true);
+ repaintAll = true;
}
- paintAfterVariableChanges(request, response, callback, outWriter,
- window, analyzeLayouts);
+ paintAfterVariableChanges(request, response, callback, repaintAll,
+ outWriter, window, analyzeLayouts);
if (closingWindowName != null) {
currentlyOpenWindowsInClient.remove(closingWindowName);
* @param request
* @param response
* @param callback
+ * @param repaintAll
* @param outWriter
* @param window
* @param analyzeLayouts
* @throws IOException
*/
private void paintAfterVariableChanges(Request request, Response response,
- Callback callback, final PrintWriter outWriter, Window window,
- boolean analyzeLayouts) throws PaintException, IOException {
+ Callback callback, boolean repaintAll, final PrintWriter outWriter,
+ Window window, boolean analyzeLayouts) throws PaintException,
+ IOException {
- if (isRepaintAll()) {
+ if (repaintAll) {
makeAllPaintablesDirty(window);
}
application, window);
if (newWindow != window) {
window = newWindow;
- setRepaintAll(true);
+ repaintAll = true;
}
- writeUidlResponse(callback, outWriter, window, analyzeLayouts);
+ writeUidlResponse(callback, repaintAll, outWriter, window,
+ analyzeLayouts);
}
closeJsonMessage(outWriter);
}
- public void writeUidlResponse(Callback callback,
+ public void writeUidlResponse(Callback callback, boolean repaintAll,
final PrintWriter outWriter, Window window, boolean analyzeLayouts)
throws PaintException {
outWriter.print("\"changes\":[");
List<InvalidLayout> invalidComponentRelativeSizes = null;
JsonPaintTarget paintTarget = new JsonPaintTarget(this, outWriter,
- !isRepaintAll());
+ repaintAll);
OpenWindowCache windowCache = currentlyOpenWindowsInClient.get(window
.getName());
if (windowCache == null) {
}
// Paints components
- if (isRepaintAll()) {
+ if (repaintAll) {
paintables = new ArrayList<Paintable>();
paintables.add(window);
outWriter.print(", \"meta\" : {");
boolean metaOpen = false;
- if (isRepaintAll()) {
+ if (repaintAll) {
metaOpen = true;
outWriter.write("\"repaintAll\":true");
if (analyzeLayouts) {
&& ci.getSessionExpiredCaption() == null
&& ci.isSessionExpiredNotificationEnabled()) {
int newTimeoutInterval = getTimeoutInterval();
- if (isRepaintAll() || (timeoutInterval != newTimeoutInterval)) {
+ if (repaintAll || (timeoutInterval != newTimeoutInterval)) {
String escapedURL = ci.getSessionExpiredURL() == null ? "" : ci
.getSessionExpiredURL().replace("/", "\\/");
if (metaOpen) {
if (dragAndDropService != null) {
dragAndDropService.printJSONResponse(outWriter);
}
- setRepaintAll(false);
}
private int getTimeoutInterval() {
final PrintWriter outWriter = new PrintWriter(
new CharArrayWriter());
- setRepaintAll(true);
paintAfterVariableChanges(request, response, callback,
- outWriter, window, false);
+ true, outWriter, window, false);
}
private final HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
private int nextTypeKey = 0;
- private boolean repaintAll = false;
-
String getTagForType(Class<? extends Paintable> class1) {
Integer object = typeToKey.get(class1);
if (object == null) {
return b;
}
}
-
- private void setRepaintAll(boolean repaintAll) {
- this.repaintAll = repaintAll;
- }
-
- /**
- * @return true if a RepaintAll has been requested. E.g. by refreshing the
- * browser window or such.
- */
- public boolean isRepaintAll() {
- return repaintAll;
- }
}
private int errorsOpen;
- private boolean cacheEnabled = false;
+ private boolean fullRepaint = false;
private final Collection<Paintable> paintedComponents = new HashSet<Paintable>();
* @param manager
* @param outWriter
* A character-output stream.
+ * @param fullRepaint
+ * true if this is a full repaint, i.e. caches are to be
+ * bypassed.
* @throws PaintException
* if the paint operation failed.
*/
public JsonPaintTarget(AbstractCommunicationManager manager,
- PrintWriter outWriter, boolean cachingRequired)
- throws PaintException {
+ PrintWriter outWriter, boolean fullRepaint) throws PaintException {
this.manager = manager;
// Initialize tag-writing
mOpenTags = new Stack<String>();
openJsonTags = new Stack<JsonTag>();
- cacheEnabled = cachingRequired;
+ this.fullRepaint = fullRepaint;
}
public void startTag(String tagName) throws PaintException {
customLayoutArgumentsOpen = true;
}
- return cacheEnabled && isPreviouslyPainted;
+ return !fullRepaint && isPreviouslyPainted;
}
@Deprecated
* @see com.vaadin.terminal.PaintTarget#isFullRepaint()
*/
public boolean isFullRepaint() {
- return manager.isRepaintAll();
+ return fullRepaint;
}
}