Fix missing header in previous checkin.
Also remove the silent logger from the render() method, and create the
silent logger in the palette preview drag where it's more obvious why
the rendering is quiet.
Change-Id: I80d2be0c40d00589182988262f1d0f2e64ee4dd4
* @param transparentBackground If true, the rendering will <b>not</b> paint the
* normal background requested by the theme, and it will instead paint the
* background using a fully transparent background color
+ * @param logger a logger where rendering errors are reported
* @return the resulting rendered image wrapped in an {@link RenderSession}
*/
public RenderSession render(UiDocumentNode model, int width, int height,
- Set<UiElementNode> explodeNodes, boolean transparentBackground) {
+ Set<UiElementNode> explodeNodes, boolean transparentBackground,
+ LayoutLog logger) {
if (!ensureFileValid()) {
return null;
}
IProject iProject = mEditedFile.getProject();
return renderWithBridge(iProject, model, layoutLib, width, height, explodeNodes,
- transparentBackground, new LayoutLog());
+ transparentBackground, logger);
}
/**
import com.android.ide.common.api.InsertType;
import com.android.ide.common.api.Rect;
-import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.common.rendering.LayoutLibrary;
import com.android.ide.common.rendering.api.Capability;
+import com.android.ide.common.rendering.api.LayoutLog;
import com.android.ide.common.rendering.api.RenderSession;
import com.android.ide.common.rendering.api.ViewInfo;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
import com.android.ide.eclipse.adt.internal.editors.descriptors.DocumentDescriptor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
org.eclipse.draw2d.geometry.Rectangle screenBounds = editor.getScreenBounds();
int renderWidth = Math.min(screenBounds.width, MAX_RENDER_WIDTH);
int renderHeight = Math.min(screenBounds.height, MAX_RENDER_HEIGHT);
-
+ LayoutLog silentLogger = new LayoutLog();
session = editor.render(model, renderWidth, renderHeight,
- null /* explodeNodes */, hasTransparency);
+ null /* explodeNodes */, hasTransparency, silentLogger);
} catch (Throwable t) {
// Previews can fail for a variety of reasons -- let's not bug
// the user with it
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.ide.eclipse.adt.internal.editors.layout.gle2;