diff options
Diffstat (limited to 'picasso/plugins/org.eclipse.pde.picasso')
-rw-r--r-- | picasso/plugins/org.eclipse.pde.picasso/.options | 1 | ||||
-rw-r--r-- | picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Activator.java | 10 | ||||
-rw-r--r-- | picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/DebugFilter.java | 2 | ||||
-rw-r--r-- | picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Painter.java (renamed from picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/SwtDebugUtility.java) | 208 |
4 files changed, 114 insertions, 107 deletions
diff --git a/picasso/plugins/org.eclipse.pde.picasso/.options b/picasso/plugins/org.eclipse.pde.picasso/.options new file mode 100644 index 0000000..424eb5f --- /dev/null +++ b/picasso/plugins/org.eclipse.pde.picasso/.options @@ -0,0 +1 @@ +org.eclipse.pde.picasso/paint=true
\ No newline at end of file diff --git a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Activator.java b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Activator.java index df9fd33..484bb67 100644 --- a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Activator.java +++ b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Activator.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.pde.internal.picasso; +import org.eclipse.core.runtime.Platform; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.progress.UIJob; import org.osgi.framework.BundleContext; @@ -21,6 +22,7 @@ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.pde.picasso"; + public static final String OPTION_ID_PAINT = "paint"; // The shared instance private static Activator plugin; @@ -38,8 +40,12 @@ public class Activator extends AbstractUIPlugin { public void start(BundleContext context) throws Exception { super.start(context); plugin = this; - UIJob job = new ListenerJob(Messages.ListenerJob_name); - job.schedule(); + + String option = Platform.getDebugOption(PLUGIN_ID + '/' + OPTION_ID_PAINT); + if(option != null && option.equalsIgnoreCase("true")) { + UIJob job = new ListenerJob(Messages.ListenerJob_name); + job.schedule(); + } } /* diff --git a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/DebugFilter.java b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/DebugFilter.java index 80fbb0c..9721062 100644 --- a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/DebugFilter.java +++ b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/DebugFilter.java @@ -20,7 +20,7 @@ public class DebugFilter implements Listener { public void handleEvent(Event event) { Widget widget = event.widget; if(widget instanceof Control) { - SwtDebugUtility.decorate((Control) widget); + Painter.decorate((Control) widget); } } diff --git a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/SwtDebugUtility.java b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Painter.java index 2ddd202..3f89c19 100644 --- a/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/SwtDebugUtility.java +++ b/picasso/plugins/org.eclipse.pde.picasso/src/org/eclipse/pde/internal/picasso/Painter.java @@ -30,7 +30,7 @@ import org.eclipse.swt.widgets.Layout; /** * SwtDebugUtility.java */ -public final class SwtDebugUtility extends Object { +public final class Painter extends Object { // // Static Fields // @@ -38,18 +38,18 @@ public final class SwtDebugUtility extends Object { private static final int BUFFER_SIZE = 2048; private static final Color[] COLORS = new Color[] { - SwtDebugUtility.getSystemColor(SWT.COLOR_RED), - SwtDebugUtility.getSystemColor(SWT.COLOR_BLUE), - SwtDebugUtility.getSystemColor(SWT.COLOR_YELLOW), - SwtDebugUtility.getSystemColor(SWT.COLOR_GREEN), - SwtDebugUtility.getSystemColor(SWT.COLOR_CYAN), - SwtDebugUtility.getSystemColor(SWT.COLOR_MAGENTA), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_RED), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_BLUE), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_YELLOW), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_GREEN), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_CYAN), - SwtDebugUtility.getSystemColor(SWT.COLOR_DARK_MAGENTA) + Painter.getSystemColor(SWT.COLOR_RED), + Painter.getSystemColor(SWT.COLOR_BLUE), + Painter.getSystemColor(SWT.COLOR_YELLOW), + Painter.getSystemColor(SWT.COLOR_GREEN), + Painter.getSystemColor(SWT.COLOR_CYAN), + Painter.getSystemColor(SWT.COLOR_MAGENTA), + Painter.getSystemColor(SWT.COLOR_DARK_RED), + Painter.getSystemColor(SWT.COLOR_DARK_BLUE), + Painter.getSystemColor(SWT.COLOR_DARK_YELLOW), + Painter.getSystemColor(SWT.COLOR_DARK_GREEN), + Painter.getSystemColor(SWT.COLOR_DARK_CYAN), + Painter.getSystemColor(SWT.COLOR_DARK_MAGENTA) }; private static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$ @@ -60,21 +60,21 @@ public final class SwtDebugUtility extends Object { private static void createCompositeToolTip(StringBuffer buffer, Composite composite) { Layout layout = composite.getLayout(); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" layout="); //$NON-NLS-1$ if (layout instanceof GridLayout) { // $codepro.audit.disable disallowInstanceof GridLayout gridLayout = (GridLayout) layout; - SwtDebugUtility.createGridLayoutToolTip(buffer, gridLayout); + Painter.createGridLayoutToolTip(buffer, gridLayout); } else if (layout instanceof FormLayout) { // $codepro.audit.disable disallowInstanceof FormLayout formLayout = (FormLayout) layout; - SwtDebugUtility.createFormLayoutToolTip(buffer, formLayout); + Painter.createFormLayoutToolTip(buffer, formLayout); } else if (layout instanceof FillLayout) { // $codepro.audit.disable disallowInstanceof FillLayout fillLayout = (FillLayout) layout; - SwtDebugUtility.createFillLayoutToolTip(buffer, fillLayout); + Painter.createFillLayoutToolTip(buffer, fillLayout); } else if (layout instanceof RowLayout) { // $codepro.audit.disable disallowInstanceof RowLayout rowLayout = (RowLayout) layout; - SwtDebugUtility.createRowLayoutToolTip(buffer, rowLayout); + Painter.createRowLayoutToolTip(buffer, rowLayout); } else { buffer.append(layout); } @@ -83,50 +83,50 @@ public final class SwtDebugUtility extends Object { private static void createFillLayoutToolTip(StringBuffer buffer, FillLayout layout) { buffer.append("FormLayout"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginHeight="); //$NON-NLS-1$ buffer.append(layout.marginHeight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginWidth="); //$NON-NLS-1$ buffer.append(layout.marginWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" spacing="); //$NON-NLS-1$ buffer.append(layout.spacing); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" type="); //$NON-NLS-1$ buffer.append(layout.type); buffer.append(" ("); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.getLayoutTypeText(layout.type)); + buffer.append(Painter.getLayoutTypeText(layout.type)); buffer.append(')'); } private static void createFormDataToolTip(StringBuffer buffer, FormData data) { buffer.append("FormData"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" bottom="); //$NON-NLS-1$ buffer.append(data.bottom); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" height="); //$NON-NLS-1$ buffer.append(data.height); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" left="); //$NON-NLS-1$ buffer.append(data.left); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" right="); //$NON-NLS-1$ buffer.append(data.right); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" top="); //$NON-NLS-1$ buffer.append(data.top); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" width="); //$NON-NLS-1$ buffer.append(data.width); } @@ -134,31 +134,31 @@ public final class SwtDebugUtility extends Object { private static void createFormLayoutToolTip(StringBuffer buffer, FormLayout layout) { buffer.append("FormLayout"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginBottom="); //$NON-NLS-1$ buffer.append(layout.marginBottom); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginHeight="); //$NON-NLS-1$ buffer.append(layout.marginHeight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginLeft="); //$NON-NLS-1$ buffer.append(layout.marginLeft); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginRight="); //$NON-NLS-1$ buffer.append(layout.marginRight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginTop="); //$NON-NLS-1$ buffer.append(layout.marginTop); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginWidth="); //$NON-NLS-1$ buffer.append(layout.marginWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" spacing="); //$NON-NLS-1$ buffer.append(layout.spacing); } @@ -166,55 +166,55 @@ public final class SwtDebugUtility extends Object { private static void createGridDataToolTip(StringBuffer buffer, GridData gridData) { buffer.append("GridData"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" exclude="); //$NON-NLS-1$ buffer.append(gridData.exclude); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" grabExcessHorizontalSpace="); //$NON-NLS-1$ buffer.append(gridData.grabExcessHorizontalSpace); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" grabExcessVerticalSpace="); //$NON-NLS-1$ buffer.append(gridData.grabExcessVerticalSpace); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" heightHint="); //$NON-NLS-1$ buffer.append(gridData.heightHint); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" horizontalAlignment="); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.getAlignmentText(gridData.horizontalAlignment)); + buffer.append(Painter.getAlignmentText(gridData.horizontalAlignment)); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" horizontalIndent="); //$NON-NLS-1$ buffer.append(gridData.horizontalIndent); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" horizontalSpan="); //$NON-NLS-1$ buffer.append(gridData.horizontalSpan); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" minimumHeight="); //$NON-NLS-1$ buffer.append(gridData.minimumHeight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" minimumWidth="); //$NON-NLS-1$ buffer.append(gridData.minimumWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" verticalAlignment="); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.getAlignmentText(gridData.verticalAlignment)); + buffer.append(Painter.getAlignmentText(gridData.verticalAlignment)); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" verticalIndent="); //$NON-NLS-1$ buffer.append(gridData.verticalIndent); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" verticalSpan="); //$NON-NLS-1$ buffer.append(gridData.verticalSpan); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" widthHint="); //$NON-NLS-1$ buffer.append(gridData.widthHint); } @@ -222,43 +222,43 @@ public final class SwtDebugUtility extends Object { private static void createGridLayoutToolTip(StringBuffer buffer, GridLayout layout) { buffer.append("GridLayout"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" horizontalSpacing="); //$NON-NLS-1$ buffer.append(layout.horizontalSpacing); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" makeColumnsEqualWidth="); //$NON-NLS-1$ buffer.append(layout.makeColumnsEqualWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginBottom="); //$NON-NLS-1$ buffer.append(layout.marginBottom); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginHeight="); //$NON-NLS-1$ buffer.append(layout.marginHeight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginLeft="); //$NON-NLS-1$ buffer.append(layout.marginLeft); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginRight="); //$NON-NLS-1$ buffer.append(layout.marginRight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginTop="); //$NON-NLS-1$ buffer.append(layout.marginBottom); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginWidth="); //$NON-NLS-1$ buffer.append(layout.marginWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" numColumns="); //$NON-NLS-1$ buffer.append(layout.numColumns); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" verticalSpacing="); //$NON-NLS-1$ buffer.append(layout.verticalSpacing); } @@ -266,15 +266,15 @@ public final class SwtDebugUtility extends Object { private static void createRowDataToolTip(StringBuffer buffer, RowData data) { buffer.append("RowData"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" exclude="); //$NON-NLS-1$ buffer.append(data.exclude); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" height="); //$NON-NLS-1$ buffer.append(data.height); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" width="); //$NON-NLS-1$ buffer.append(data.width); } @@ -282,54 +282,54 @@ public final class SwtDebugUtility extends Object { private static void createRowLayoutToolTip(StringBuffer buffer, RowLayout layout) { buffer.append("RowLayout"); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" fill="); //$NON-NLS-1$ buffer.append(layout.fill); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" justify="); //$NON-NLS-1$ buffer.append(layout.justify); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginBottom="); //$NON-NLS-1$ buffer.append(layout.marginBottom); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginHeight="); //$NON-NLS-1$ buffer.append(layout.marginHeight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginLeft="); //$NON-NLS-1$ buffer.append(layout.marginLeft); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginRight="); //$NON-NLS-1$ buffer.append(layout.marginRight); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginTop="); //$NON-NLS-1$ buffer.append(layout.marginTop); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" marginWidth="); //$NON-NLS-1$ buffer.append(layout.marginWidth); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" pack="); //$NON-NLS-1$ buffer.append(layout.pack); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" spacing="); //$NON-NLS-1$ buffer.append(layout.spacing); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" type="); //$NON-NLS-1$ buffer.append(layout.type); buffer.append(" ("); //$NON-NLS-1$ - buffer.append(SwtDebugUtility.getLayoutTypeText(layout.type)); + buffer.append(Painter.getLayoutTypeText(layout.type)); buffer.append(')'); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" wrap="); //$NON-NLS-1$ buffer.append(layout.wrap); } @@ -341,27 +341,27 @@ public final class SwtDebugUtility extends Object { } buffer.append(control); - buffer.append(SwtDebugUtility.getHashCodeText(control)); + buffer.append(Painter.getHashCodeText(control)); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" parent="); //$NON-NLS-1$ Control parent = control.getParent(); buffer.append(parent); - buffer.append(SwtDebugUtility.getHashCodeText(parent)); + buffer.append(Painter.getHashCodeText(parent)); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" border width="); //$NON-NLS-1$ buffer.append(control.getBorderWidth()); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" bounds="); //$NON-NLS-1$ buffer.append(control.getBounds()); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" data="); //$NON-NLS-1$ buffer.append(control.getData()); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" font="); //$NON-NLS-1$ Font font = control.getFont(); FontData[] fontData = font.getFontData(); @@ -369,70 +369,70 @@ public final class SwtDebugUtility extends Object { if (control instanceof Composite) { // $codepro.audit.disable disallowInstanceof Composite composite = (Composite) control; - SwtDebugUtility.createCompositeToolTip(buffer, composite); + Painter.createCompositeToolTip(buffer, composite); } Object layoutData = control.getLayoutData(); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" layout data="); //$NON-NLS-1$ if (layoutData instanceof GridData) { // $codepro.audit.disable disallowInstanceof GridData gridData = (GridData) layoutData; - SwtDebugUtility.createGridDataToolTip(buffer, gridData); + Painter.createGridDataToolTip(buffer, gridData); } else if (layoutData instanceof FormData) { // $codepro.audit.disable disallowInstanceof FormData formData = (FormData) layoutData; - SwtDebugUtility.createFormDataToolTip(buffer, formData); + Painter.createFormDataToolTip(buffer, formData); } else if (layoutData instanceof RowData) { // $codepro.audit.disable disallowInstanceof RowData rowData = (RowData) layoutData; - SwtDebugUtility.createRowDataToolTip(buffer, rowData); + Painter.createRowDataToolTip(buffer, rowData); } else { buffer.append(layoutData); } - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" location="); //$NON-NLS-1$ buffer.append(control.getLocation()); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" size="); //$NON-NLS-1$ buffer.append(control.getSize()); - buffer.append(SwtDebugUtility.LINE_SEPARATOR); + buffer.append(Painter.LINE_SEPARATOR); buffer.append(" style="); //$NON-NLS-1$ buffer.append(control.getStyle()); } public static void decorate(Control control) { - SwtDebugUtility.decorate(control, 0); + Painter.decorate(control, 0); } public static void decorate(Control control, int marginWidth) { if (control == null) throw new IllegalArgumentException("The argument 'control' must not be null"); //$NON-NLS-1$ - StringBuffer buffer = new StringBuffer(SwtDebugUtility.BUFFER_SIZE); - SwtDebugUtility.decorate(buffer, control, marginWidth, 0, 0); + StringBuffer buffer = new StringBuffer(Painter.BUFFER_SIZE); + Painter.decorate(buffer, control, marginWidth, 0, 0); } private static void decorate(StringBuffer buffer, Control control, int marginWidth, int colorIndex, int childIndex) { - int count = SwtDebugUtility.COLORS.length; + int count = Painter.COLORS.length; int index = colorIndex == count ? 0 : colorIndex; - Color color = SwtDebugUtility.COLORS [ index ]; + Color color = Painter.COLORS [ index ]; control.setBackground(color); - SwtDebugUtility.createToolTip(buffer, control, childIndex); - String tip = SwtDebugUtility.getBufferValue(buffer); + Painter.createToolTip(buffer, control, childIndex); + String tip = Painter.getBufferValue(buffer); control.setToolTipText(tip); if (control instanceof Composite) { // $codepro.audit.disable disallowInstanceof Composite composite = (Composite) control; - SwtDebugUtility.padComposite(composite, marginWidth); + Painter.padComposite(composite, marginWidth); Control[] children = composite.getChildren(); Control child; for (int i = 0; i < children.length; i++) { child = children [ i ]; - SwtDebugUtility.decorate(buffer, child, marginWidth, index + 1, i + 1); + Painter.decorate(buffer, child, marginWidth, index + 1, i + 1); } } } @@ -494,7 +494,7 @@ public final class SwtDebugUtility extends Object { buffer.append(hexString); buffer.append(')'); - String result = SwtDebugUtility.getBufferValue(buffer); + String result = Painter.getBufferValue(buffer); return result; } @@ -546,7 +546,7 @@ public final class SwtDebugUtility extends Object { } public static void setBackground(Control control, int id) { - Color color = SwtDebugUtility.getSystemColor(id); + Color color = Painter.getSystemColor(id); control.setBackground(color); } @@ -554,7 +554,7 @@ public final class SwtDebugUtility extends Object { // Constructors // - private SwtDebugUtility() { + private Painter() { super(); } } |