Section in Form Page is not getting Expanded [message #758664] |
Thu, 24 November 2011 07:25 |
Vinod Kannur 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?
Thanks in Advance!
Regards,
Vinod
|
|
|
|
Powered by
FUDForum. Page generated in 0.02131 seconds