diff options
author | Andre Weinand | 2004-05-28 08:28:28 +0000 |
---|---|---|
committer | Andre Weinand | 2004-05-28 08:28:28 +0000 |
commit | d873f4d32471d7d4d95359b502cdb65a4d2a3968 (patch) | |
tree | 076d9fc7b4f6af2384af206997508715054565a0 | |
parent | 145d8dd8da88ccbbd247c0c552fe0307c60bb63c (diff) | |
download | eclipse.platform.team-d873f4d32471d7d4d95359b502cdb65a4d2a3968.tar.gz eclipse.platform.team-d873f4d32471d7d4d95359b502cdb65a4d2a3968.tar.xz eclipse.platform.team-d873f4d32471d7d4d95359b502cdb65a4d2a3968.zip |
removed ColorEdit (#64505)v20040528
4 files changed, 6 insertions, 262 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html index 139034d5a..0c6aa55b6 100644 --- a/bundles/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/buildnotes_compare.html @@ -11,21 +11,15 @@ <h1> Eclipse Platform Build Notes<br> Compare</h1> -Eclipse Build Input May 27th 2004 +Eclipse Build Input May 28th 2004 (RC1) <h2> Problem reports fixed</h2> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=62356">#62356</a>: Use progress service when running compare input<br> - - -<h1> -<hr WIDTH="100%"></h1> -Eclipse Build Input May 25th 2004 - -<h2> -Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=64505">#64505</a>: Remove unused class ColorEditor<br> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=63610">#63610</a>: Colors and Fonts: Text Compare Appearance -> Text Compare<br> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=61996">#61996</a>: bad idea to subclass Error for ordinary exceptions<br> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=63608">#63608</a>: Migrate to improved modal progress support<br> <h1> diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java deleted file mode 100644 index 787c3fb26..000000000 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.compare.internal; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.ColorDialog; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.jface.resource.JFaceResources; - -/** - * A "button" of a certain color determined by the color picker. - */ -public class ColorEditor { - - private Point fExtent; - private Image fImage; - private RGB fColorValue; - private Color fColor; - private Button fButton; - - public ColorEditor(Composite parent) { - - fButton= new Button(parent, SWT.PUSH); - fExtent= computeImageSize(parent); - fImage= new Image(parent.getDisplay(), fExtent.x, fExtent.y); - - GC gc= new GC(fImage); - gc.setBackground(fButton.getBackground()); - gc.fillRectangle(0, 0, fExtent.x, fExtent.y); - gc.dispose(); - - fButton.setImage(fImage); - fButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - ColorDialog colorDialog= new ColorDialog(fButton.getShell()); - colorDialog.setRGB(fColorValue); - RGB newColor = colorDialog.open(); - if (newColor != null) { - fColorValue= newColor; - updateColorImage(); - } - } - }); - - fButton.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - if (fImage != null) { - fImage.dispose(); - fImage= null; - } - if (fColor != null) { - fColor.dispose(); - fColor= null; - } - } - }); - } - - public RGB getColorValue() { - return fColorValue; - } - - public void setColorValue(RGB rgb) { - fColorValue= rgb; - updateColorImage(); - } - - public Button getButton() { - return fButton; - } - - protected void updateColorImage() { - - Display display= fButton.getDisplay(); - - GC gc= new GC(fImage); - gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK)); - gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4); - - if (fColor != null) - fColor.dispose(); - - fColor= new Color(display, fColorValue); - gc.setBackground(fColor); - gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5); - gc.dispose(); - - fButton.setImage(fImage); - } - - protected Point computeImageSize(Control window) { - GC gc= new GC(window); - Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); - gc.setFont(f); - int height= gc.getFontMetrics().getHeight(); - gc.dispose(); - Point p= new Point(height * 3 - 6, height); - return p; - } -} diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html index 139034d5a..0c6aa55b6 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html @@ -11,21 +11,15 @@ <h1> Eclipse Platform Build Notes<br> Compare</h1> -Eclipse Build Input May 27th 2004 +Eclipse Build Input May 28th 2004 (RC1) <h2> Problem reports fixed</h2> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=62356">#62356</a>: Use progress service when running compare input<br> - - -<h1> -<hr WIDTH="100%"></h1> -Eclipse Build Input May 25th 2004 - -<h2> -Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=64505">#64505</a>: Remove unused class ColorEditor<br> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=63610">#63610</a>: Colors and Fonts: Text Compare Appearance -> Text Compare<br> <a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=61996">#61996</a>: bad idea to subclass Error for ordinary exceptions<br> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=63608">#63608</a>: Migrate to improved modal progress support<br> <h1> diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java deleted file mode 100644 index 787c3fb26..000000000 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ColorEditor.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.compare.internal; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.ColorDialog; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.jface.resource.JFaceResources; - -/** - * A "button" of a certain color determined by the color picker. - */ -public class ColorEditor { - - private Point fExtent; - private Image fImage; - private RGB fColorValue; - private Color fColor; - private Button fButton; - - public ColorEditor(Composite parent) { - - fButton= new Button(parent, SWT.PUSH); - fExtent= computeImageSize(parent); - fImage= new Image(parent.getDisplay(), fExtent.x, fExtent.y); - - GC gc= new GC(fImage); - gc.setBackground(fButton.getBackground()); - gc.fillRectangle(0, 0, fExtent.x, fExtent.y); - gc.dispose(); - - fButton.setImage(fImage); - fButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - ColorDialog colorDialog= new ColorDialog(fButton.getShell()); - colorDialog.setRGB(fColorValue); - RGB newColor = colorDialog.open(); - if (newColor != null) { - fColorValue= newColor; - updateColorImage(); - } - } - }); - - fButton.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - if (fImage != null) { - fImage.dispose(); - fImage= null; - } - if (fColor != null) { - fColor.dispose(); - fColor= null; - } - } - }); - } - - public RGB getColorValue() { - return fColorValue; - } - - public void setColorValue(RGB rgb) { - fColorValue= rgb; - updateColorImage(); - } - - public Button getButton() { - return fButton; - } - - protected void updateColorImage() { - - Display display= fButton.getDisplay(); - - GC gc= new GC(fImage); - gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK)); - gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4); - - if (fColor != null) - fColor.dispose(); - - fColor= new Color(display, fColorValue); - gc.setBackground(fColor); - gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5); - gc.dispose(); - - fButton.setImage(fImage); - } - - protected Point computeImageSize(Control window) { - GC gc= new GC(window); - Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); - gc.setFont(f); - int height= gc.getFontMetrics().getHeight(); - gc.dispose(); - Point p= new Point(height * 3 - 6, height); - return p; - } -} |