Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Section in Form Page is not getting Expanded
Section in Form Page is not getting Expanded [message #758664] Thu, 24 November 2011 07:25 Go to next message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member
Hi,

I have a created the Form view page using Eclipse Plug-gin with a view.I am trying to run a Form View Page, but Sections are not expanded on my first display.
I have set the property of Section as Expanded but its not getting reflected. If I again click on the section, it will display the contents.


Please find the code snippet for the Form View Page.

public class View extends ViewPart {
	private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
	private Text txtEemv;
public View() {
	}
	public static final String ID = "example2.view";
	
	class ViewContentProvider implements IStructuredContentProvider {
		public void inputChanged(Viewer v, Object oldInput, Object newInput) {
		}

		public void dispose() {
		}

		public Object[] getElements(Object parent) {
			if (parent instanceof Object[]) {
				return (Object[]) parent;
			}
	        return new Object[0];
		}
	}

	class ViewLabelProvider extends LabelProvider implements
			ITableLabelProvider {
		public String getColumnText(Object obj, int index) {
			return getText(obj);
		}

		public org.eclipse.swt.graphics.Image getColumnImage(Object obj, int index) {
			return getImage(obj);
		}

		public org.eclipse.swt.graphics.Image getImage(Object obj) {
			return PlatformUI.getWorkbench().getSharedImages().getImage(
					ISharedImages.IMG_OBJ_ELEMENT);
		}
	}

	@Override
	public void createPartControl(Composite parent) {
		
		TabFolder tabFolder = new TabFolder(parent, SWT.BOTTOM);
		formToolkit.adapt(tabFolder);
		formToolkit.paintBordersFor(tabFolder);
final ScrolledForm scrldfrmNewScrolledform = formToolkit.createScrolledForm(tabFolder);
		scrldfrmNewScrolledform.setShowFocusedControl(true);
		tbtmEemv_1.setControl(scrldfrmNewScrolledform);
Section sctnCatalogEntry = formToolkit.createSection(scrldfrmNewScrolledform.getBody(),Section.EXPANDED| Section.TWISTIE| Section.TITLE_BAR);
		sctnCatalogEntry.setVisible(true);
		sctnCatalogEntry.setEnabled(true);
		sctnCatalogEntry.setExpanded(true);
		sctnCatalogEntry.setBounds(10, 276, 365, 124);
		formToolkit.paintBordersFor(sctnCatalogEntry);
		sctnCatalogEntry.setText("Catalog Entry");
		sctnCatalogEntry.setToolTipText("Catalog Information");
Composite composite_2 = new Composite(sctnCatalogEntry, SWT.Expand);
		formToolkit.adapt(composite_2);
		formToolkit.paintBordersFor(composite_2);
		sctnCatalogEntry.setClient(composite_2);
		
		org.eclipse.swt.widgets.Label lblNewLabel_3 = new org.eclipse.swt.widgets.Label(composite_2, SWT.NONE);
		lblNewLabel_3.setBounds(7, 10, 84, 15);
		formToolkit.adapt(lblNewLabel_3, true, true);
		lblNewLabel_3.setText("Item Title :");
		
		txtContractToCash_1 = new Text(composite_2, SWT.BORDER);
		txtContractToCash_1.setBounds(102, 7, 241, 21);
		txtContractToCash_1.setText("Contract to Cash");
		formToolkit.adapt(txtContractToCash_1, true, true);
}
public void setFocus() {
	}
	
	public void dispose() {
		formToolkit.dispose();
		super.dispose();
	}
}


Can you please let me know what could be reason and how can I render when I run for the first time?

index.php/fa/6231/0/

Thanks in Advance!
Regards,
Vinod
Re: Section in Form Page is not getting Expanded [message #759447 is a reply to message #758664] Mon, 28 November 2011 17:21 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Your question is not about Sapphire. You will need to post it on another forum. Maybe try the main Eclipse Platform forum...

http://www.eclipse.org/forums/index.php/f/11/

Alternatively, you may want to know that developers who use Sapphire do not need to struggle with SWT/JFace/Forms widgets. You can learn more about Sapphire in this intro article...

http://www.eclipse.org/sapphire/documentation/latest/introduction/index.html

Thanks,

- Konstantin

Previous Topic:Sapphire 0.4 RC1
Next Topic:Running a sapphire application in a simple java main method
Goto Forum:
  


Current Time: Fri Apr 19 09:36:33 GMT 2024

Powered by FUDForum. Page generated in 0.02131 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top