package com.zx.dialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class FindUserPage extends WizardPage
{
/** 页面名称 */
public static final String FIND_USER_PAGE = "FindUserPage";
public int seletedType = 0;
public String info = "";
public String info2 = "";
boolean isOnLikeQuery = false;
protected FindUserPage()
{
super(FIND_USER_PAGE);
// TODO Auto-generated constructor stub
}
public void createControl ( Composite parent )
{
/** 设置面板布局 */
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
Group group = new Group(composite, SWT.NONE);
group.setText("选择查询类型");
group.setLayout(new GridLayout(3, false));
Button srchHouseBtn = new Button(group, SWT.RADIO);
srchHouseBtn.setText("按楼盘+房号查询");
srchHouseBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
srchHouseBtn.setSelection(true);
Button srchNameBtn = new Button(group, SWT.RADIO);
srchNameBtn.setText("按名字查询");
srchNameBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button srchPhoneBtn = new Button(group, SWT.RADIO);
srchPhoneBtn.setText("按手机号查询");
srchPhoneBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
new Label(composite, SWT.NONE);
Group group2 = new Group(composite, SWT.NONE);
group2.setText("输入查询信息");
group2.setLayout(new GridLayout(2, false));
final Label mm = new Label(group2, SWT.NONE);
mm.setText("输入楼盘:");
final Text infoTxt = new Text(group2, SWT.BORDER);
infoTxt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final Label mm2 = new Label(group2, SWT.NONE);
mm2.setText("输入房号:");
final Text info2Txt = new Text(group2, SWT.BORDER);
info2Txt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
srchNameBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入名字:");
seletedType = 0;
mm2.setVisible(false);
info2Txt.setVisible(false);
}
});
srchPhoneBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入手机号:");
seletedType = 1;
mm2.setVisible(false);
info2Txt.setVisible(false);
}
});
srchHouseBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入楼盘:");
seletedType = 2;
mm2.setVisible(true);
info2Txt.setVisible(true);
}
});
this.setControl(composite);
}
}
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class FindUserPage extends WizardPage
{
/** 页面名称 */
public static final String FIND_USER_PAGE = "FindUserPage";
public int seletedType = 0;
public String info = "";
public String info2 = "";
boolean isOnLikeQuery = false;
protected FindUserPage()
{
super(FIND_USER_PAGE);
// TODO Auto-generated constructor stub
}
public void createControl ( Composite parent )
{
/** 设置面板布局 */
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
Group group = new Group(composite, SWT.NONE);
group.setText("选择查询类型");
group.setLayout(new GridLayout(3, false));
Button srchHouseBtn = new Button(group, SWT.RADIO);
srchHouseBtn.setText("按楼盘+房号查询");
srchHouseBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
srchHouseBtn.setSelection(true);
Button srchNameBtn = new Button(group, SWT.RADIO);
srchNameBtn.setText("按名字查询");
srchNameBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button srchPhoneBtn = new Button(group, SWT.RADIO);
srchPhoneBtn.setText("按手机号查询");
srchPhoneBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
new Label(composite, SWT.NONE);
Group group2 = new Group(composite, SWT.NONE);
group2.setText("输入查询信息");
group2.setLayout(new GridLayout(2, false));
final Label mm = new Label(group2, SWT.NONE);
mm.setText("输入楼盘:");
final Text infoTxt = new Text(group2, SWT.BORDER);
infoTxt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final Label mm2 = new Label(group2, SWT.NONE);
mm2.setText("输入房号:");
final Text info2Txt = new Text(group2, SWT.BORDER);
info2Txt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
srchNameBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入名字:");
seletedType = 0;
mm2.setVisible(false);
info2Txt.setVisible(false);
}
});
srchPhoneBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入手机号:");
seletedType = 1;
mm2.setVisible(false);
info2Txt.setVisible(false);
}
});
srchHouseBtn.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected ( SelectionEvent e )
{
mm.setText("输入楼盘:");
seletedType = 2;
mm2.setVisible(true);
info2Txt.setVisible(true);
}
});
this.setControl(composite);
}
}