*** empty log message ***
diff --git a/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
index 39f52ab..29154cf 100644
--- a/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
@@ -10,8 +10,7 @@
org.eclipse.ui.forms.events,
org.eclipse.ui.forms.widgets,
org.eclipse.ui.internal.forms;x-internal:=true,
- org.eclipse.ui.internal.forms.widgets;x-internal:=true,
- org.eclipse.ui.internal.provisional.forms
+ org.eclipse.ui.internal.forms.widgets;x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
org.eclipse.jface;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)";resolution:=optional
diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/provisional/forms/FormDialog.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormDialog.java
similarity index 64%
rename from bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/provisional/forms/FormDialog.java
rename to bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormDialog.java
index 185c767..cf716e1 100644
--- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/provisional/forms/FormDialog.java
+++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormDialog.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.internal.provisional.forms;
+package org.eclipse.ui.forms;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.window.IShellProvider;
@@ -16,51 +16,74 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.ManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.internal.forms.Messages;
/**
- * A general-purpose dialog that hosts a form. Clients should
- * extend the class and override <code>createFormContent(IManagedForm)</code>
- * protected method.
+ * A general-purpose dialog that hosts a form. Clients should extend the class
+ * and override <code>createFormContent(IManagedForm)</code> protected method.
* <p>
- * Since forms with wrapped text typically don't have a preferred
- * size, it is important to set the initial dialog size upon creation:
+ * Since forms with wrapped text typically don't have a preferred size, it is
+ * important to set the initial dialog size upon creation:
* <p>
+ *
* <pre>
* MyFormDialog dialog = new MyFormDialog(shell);
* dialog.create();
* dialog.getShell().setSize(500, 500);
* dialog.open();
* </pre>
+ *
* <p>
* Otherwise, the dialog may open very wide.
* <p>
+ *
* @since 3.3
*/
public class FormDialog extends TrayDialog {
private FormToolkit toolkit;
+ /**
+ * Creates a new form dialog for a provided parent shell.
+ *
+ * @param shell
+ * the parent shell
+ */
public FormDialog(Shell shell) {
super(shell);
setShellStyle(getShellStyle() | SWT.RESIZE);
}
- public FormDialog(IShellProvider parentShell) {
- super(parentShell);
+ /**
+ * Creates a new form dialog for a provided parent shell provider.
+ *
+ * @param parentShellProvider
+ * the parent shell provider
+ */
+ public FormDialog(IShellProvider parentShellProvider) {
+ super(parentShellProvider);
}
-
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.TrayDialog#close()
+ */
public boolean close() {
boolean rcode = super.close();
toolkit.dispose();
return rcode;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
protected Control createDialogArea(Composite parent) {
toolkit = new FormToolkit(parent.getDisplay());
ScrolledForm sform = toolkit.createScrolledForm(parent);
@@ -70,29 +93,27 @@
applyDialogFont(sform.getBody());
return sform;
}
-
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ */
protected Control createButtonBar(Composite parent) {
- Control sep = toolkit.createCompositeSeparator(parent);
+ Label sep = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint =1;
sep.setLayoutData(gd);
Control bar = super.createButtonBar(parent);
- recursiveAdapt((Composite)bar);
return bar;
}
-
- private void recursiveAdapt(Composite parent) {
- toolkit.adapt(parent);
- Control [] children = parent.getChildren();
- for (int i=0; i<children.length; i++) {
- Control c = children[i];
- if (c instanceof Composite)
- recursiveAdapt((Composite)c);
- else
- toolkit.adapt(c, false, false);
- }
- }
-
+
+ /**
+ * Configures the dialog form and creates form content. Clients should
+ * override this method.
+ *
+ * @param mform
+ * the dialog form
+ */
protected void createFormContent(IManagedForm mform) {
mform.getForm().setText(Messages.FormDialog_defaultTitle);
}
diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java
index f4fc23d..769d334 100644
--- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java
+++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java
@@ -119,7 +119,9 @@
getDisplay().asyncExec(new Runnable() {
public void run() {
if (!isDisposed())
- drawBackground(offScreenImageGC, 0, 0, loader.logicalScreenWidth, loader.logicalScreenHeight);
+ drawBackground(offScreenImageGC, 0, 0,
+ loader.logicalScreenWidth,
+ loader.logicalScreenHeight);
}
});
if (isDisposed())
@@ -153,9 +155,18 @@
* Fill with the background color before
* drawing.
*/
- offScreenImageGC.fillRectangle(imageData.x,
- imageData.y, imageData.width,
- imageData.height);
+ /*
+ * offScreenImageGC.fillRectangle(imageData.x,
+ * imageData.y, imageData.width,
+ * imageData.height);
+ */
+ final ImageData fimageData = imageData;
+ getDisplay().syncExec(new Runnable() {
+ public void run() {
+ drawBackground(offScreenImageGC, fimageData.x,
+ fimageData.y, fimageData.width,
+ fimageData.height);
+ }});
break;
case SWT.DM_FILL_PREVIOUS:
/* Restore the previous image before drawing. */
@@ -206,8 +217,8 @@
repeatCount--;
}
} catch (SWTException ex) {
- //System.out
- // .println("There was an error animating the GIF");
+ // System.out
+ // .println("There was an error animating the GIF");
} finally {
if (offScreenImage != null
&& !offScreenImage.isDisposed())
@@ -262,8 +273,8 @@
* Process the paint event
*/
protected void onPaint(PaintEvent event) {
- if (animationImage!=null && animationImage.isDisposed()) {
- animationImage=null;
+ if (animationImage != null && animationImage.isDisposed()) {
+ animationImage = null;
}
Rectangle rect = getClientArea();
if (rect.width == 0 || rect.height == 0)
diff --git a/examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java b/examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
index fd216e2..03854c0 100644
--- a/examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
+++ b/examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
@@ -2,9 +2,11 @@
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.FormDialog;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.examples.internal.rcp.FreeFormPage;
-import org.eclipse.ui.internal.provisional.forms.FormDialog;
public class SampleFormDialog extends FormDialog {
@@ -15,9 +17,14 @@
public SampleFormDialog(IShellProvider parentShell) {
super(parentShell);
}
-
+
protected void createFormContent(IManagedForm mform) {
mform.getForm().setText("An example of a simple form dialog");
FreeFormPage.createSharedFormContent(mform);
+ mform.getForm().setBackgroundImage(null);
+ mform.getToolkit().decorateFormHeading(mform.getForm().getForm());
+ mform.getForm().setImage(
+ PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_ELEMENT));
}
}
\ No newline at end of file