Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Tabs using radio button
Tabs using radio button [message #480087] Thu, 13 August 2009 18:12 Go to next message
Eclipse UserFriend
Originally posted by: rodrigo.garcia.kotasoft.com

Hi,

I'd like to simulate the tabFolder behaviour using radio buttons,
showing a different section or composite depending on the button pressed.

I have been trying with setVisible(false) to hide composites, but a
white space corresponding to this section is shown

Any idea?

Thanks in advance.
Re: Tabs using radio button [message #480091 is a reply to message #480087] Thu, 13 August 2009 19:01 Go to previous messageGo to next message
steven is currently offline stevenFriend
Messages: 7
Registered: August 2009
Location: China
Junior Member

I can't know the panorama of your program. Maybe you can post some code.
Try relayout your parent composite or execute update your composite.
Re: Tabs using radio button [message #480147 is a reply to message #480091] Fri, 14 August 2009 07:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rodrigo.garcia.kotasoft.com

Below is my code, I'm going to try relayout and let you know

steven escribió:
> I can't know the panorama of your program. Maybe you can post some code.
> Try relayout your parent composite or execute update your composite.
>



private void createSectionPieza(IManagedForm mform, String title,
String desc, Composite parent){
final Composite client = createSection(mform, title, desc,
4,parent,0,vehicleKeyNumColumns);
FormToolkit toolkit = mform.getToolkit();
final ScrolledForm form = mform.getForm();
GridData gd=new GridData(SWT.FILL,SWT.TOP,true,false);

Button buttonPCorrecta=toolkit.createButton(
client, CotizacionesMessages.pieza_correcta_label,SWT.RADIO);
buttonPCorrecta.setLayoutData(gd);
buttonPCorrecta.setSelection(true);
Button buttonPDiscontinuada=toolkit.createButton(
client, CotizacionesMessages.pieza_discontinuada_label,SWT.RADIO |
SWT.BOLD);
buttonPDiscontinuada.setLayoutData(gd);
Button buttonPInfoIncompleta=toolkit.createButton(
client, CotizacionesMessages.pieza_info_incompleta_label,SWT.RADIO);
buttonPInfoIncompleta.setLayoutData(gd);
Button buttonPRefAlternativa=toolkit.createButton(
client, CotizacionesMessages.pieza_ref_alternativa_label,SWT.RADIO);
buttonPRefAlternativa.setLayoutData(gd);
// GridData gd=new GridData();
// gd.horizontalSpan=2;
// b.setLayoutData(gd);
createSpacer(toolkit, client, 4);
final Composite
compPiezaCorrecta=createCompositePiezaCorrecta(mform,5, client, 0,4);
// compPiezaCorrecta.setVisible(false);
final Composite
compPiezaDiscontinuada=createCompositePiezaDiscontinuada(mfo rm, 5,
client, 0, 4);
compPiezaDiscontinuada.setVisible(false);

buttonPCorrecta.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e) {}

@Override
public void widgetSelected(SelectionEvent e) {
compPiezaCorrecta.setVisible(true);
compPiezaDiscontinuada.setVisible(false);
});
buttonPDiscontinuada.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e) {}

@Override
public void widgetSelected(SelectionEvent e) {
compPiezaCorrecta.setVisible(false);
compPiezaDiscontinuada.setVisible(true);
}
});
}
Re: Tabs using radio button [message #480189 is a reply to message #480087] Fri, 14 August 2009 10:23 Go to previous messageGo to next message
Andrey Dulub is currently offline Andrey DulubFriend
Messages: 54
Registered: July 2009
Member
StackLayout is exactly what you need
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/StackLayou tSample.htm

Thanks,
Andrey Dulub

"Rodrigo Garc
Re: Tabs using radio button [message #481890 is a reply to message #480087] Mon, 24 August 2009 15:45 Go to previous message
Alex Molochnikov is currently offline Alex MolochnikovFriend
Messages: 25
Registered: July 2009
Junior Member
To hide a Composite, you can place it into a parent Composite with
GridLayout, and set grid layout data in the target Composite to be
excluded from the layout:

GridData gridData = new GridData();
gridData.exclude = true;
composite.setLayoutData(gridData);
composite.setVisible(false);

HTH

Alex Molochnikov
Kelman Technologies Inc.
Previous Topic:Text Match in Snippet060TextCellEditorWithContentProposal
Next Topic:TableViewer Inline Editting Snippet013
Goto Forum:
  


Current Time: Sun Dec 21 17:24:58 GMT 2014

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

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