You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2005/11/02 23:29:43 UTC

svn commit: r330378 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui: icons/Geronimo_Welcome4.gif src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java src/org/apache/geronimo/ui/sections/BannerPart.java

Author: sppatel
Date: Wed Nov  2 14:29:38 2005
New Revision: 330378

URL: http://svn.apache.org/viewcvs?rev=330378&view=rev
Log:
add banner

Added:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/Geronimo_Welcome4.gif   (with props)
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BannerPart.java
Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/Geronimo_Welcome4.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/Geronimo_Welcome4.gif?rev=330378&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/icons/Geronimo_Welcome4.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java?rev=330378&r1=330377&r2=330378&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java (original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/pages/AbstractGeronimoFormPage.java Wed Nov  2 14:29:38 2005
@@ -16,7 +16,9 @@
 package org.apache.geronimo.ui.pages;
 
 import org.apache.geronimo.ui.editors.AbstractGeronimoDeploymentPlanEditor;
+import org.apache.geronimo.ui.sections.BannerPart;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.IManagedForm;
@@ -63,7 +65,8 @@
         body = managedForm.getForm().getBody();
         toolkit = managedForm.getToolkit();
         ScrolledForm form = managedForm.getForm();
-        form.setText(getTitle());
+        //form.setText(getTitle());
+        managedForm.addPart(new BannerPart(form.getBody(), toolkit, SWT.NONE));
         form.getBody().setLayout(getLayout());
         fillBody(managedForm);
         form.reflow(true);

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BannerPart.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BannerPart.java?rev=330378&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BannerPart.java (added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/BannerPart.java Wed Nov  2 14:29:38 2005
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ *  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 org.apache.geronimo.ui.sections;
+
+import org.apache.geronimo.ui.internal.GeronimoUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class BannerPart extends SectionPart {
+	
+	FormToolkit toolkit;
+	
+	ImageDescriptor defaultImgDesc = GeronimoUIPlugin
+	.imageDescriptorFromPlugin("org.apache.geronimo.ui",
+			"icons/Geronimo_Welcome4.gif");
+
+	public BannerPart(Composite parent, FormToolkit toolkit, int style) {
+		super(parent, toolkit, style);
+		this.toolkit = toolkit;
+		create();
+	}
+	
+	private void create() {
+		Section section = getSection();
+		GridData gd = new GridData();
+		gd.horizontalSpan = 2;
+        section.setLayoutData(gd);
+        section.setText("");
+
+        Composite composite = toolkit.createComposite(section);
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 1;
+        layout.marginHeight = 1;
+        layout.marginWidth = 1;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 10;
+        composite.setLayout(layout);
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        section.setClient(composite);             
+		
+	
+		Label label = toolkit.createLabel(composite, "");
+		label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+		label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		label.setImage(defaultImgDesc.createImage());
+	}
+
+}