- 浏览: 119846 次
- 性别:
- 来自: 深圳
-
文章分类
最新评论
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import com.huawei.enip.esdt.common.ui.esdt.forms.EsdtFormSection;
import com.huawei.enip.esdt.esb.ui.editor.pages.ESBTransportConfigPage;
public class TransportConfigSection extends EsdtFormSection
{
private Table table = null;//表格对象
private ESBTransportConfigPage page = null;//ESBOverViewPage页
private Label pageInfoLab;//页信息标签
private Label protocolLab;
private Label LoadLab;
private Label urlLab;//url标签
private Label formatLab;
private Label retryLab;
private Label iterationLab;
private Label applicationLab;
private Text httpTxt;
private Text numTxt;
private Text nubTxt;
private Combo protocolCombo;
private Combo roundCombo;
private Button yesBut;
private Button noBut;
private Button buttonUp;
private Button buttonAdd;
private Button buttonDown;
private Button buttonDel;
/**
* 构造函数
* @param parent
* @param toolkit
* @param style
*/
public TransportConfigSection(Composite parent, FormToolkit toolkit,
int style)
{
super(parent, toolkit, style);
}
/* (此注释不是Javadoc注释)
* @see
com.huawei.enip.esdt.common.ui.forms.FormSection#createClientArea
(org.eclipse.swt.widgets.Composite,
org.eclipse.ui.forms.widgets.FormToolkit)
*/
@Override
public void createClientArea(Composite parent, FormToolkit
formToolkit)
{
//设置Section标签
getSection().setText("Transport Configuration");
getSection().setLayoutData(new GridLayout());
getSection().setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.VERTICAL_ALIGN_FILL
| GridData.FILL_HORIZONTAL));
//设置分割线
formToolkit.createCompositeSeparator(getSection());
//创建页面显示
createDescriptionArea(parent);
}
/**
* 页面显示的方法
* @param parent
*/
private void createDescriptionArea(Composite parent)
{
parent.setLayout(new FillLayout());
//设置全局网格布局方式
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3; //设置网格的列数为4
gridLayout.horizontalSpacing = 50;
parent.setLayout(gridLayout);
pageInfoLab = new Label(parent, SWT.NONE);//定义标签对象
pageInfoLab.setText("Use this page to configure the transport
information for this service.");
GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER,
false,
false, 3, 1);
pageInfoLab.setLayoutData(gridData);
//第一个标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Protocol");
//下拉列表框
protocolCombo = new Combo(parent, SWT.READ_ONLY);
protocolCombo.add("http");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 120;
protocolCombo.setLayoutData(gridData);
//第二个标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Load Balancing\nALgorithm");
//下拉列表框
protocolCombo = new Combo(parent, SWT.READ_ONLY);
protocolCombo.add("round-robin");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 120;
protocolCombo.setLayoutData(gridData);
//URL标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Endpoint URI");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 1,
5);
protocolLab.setLayoutData(gridData);
//FORMAT标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Format:http://host:post/soneService");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 300;
protocolLab.setLayoutData(gridData);
Text text = new Text(parent, SWT.BORDER);
text.setText("http://www.iteye.com");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
gridData.widthHint = 300;
text.setLayoutData(gridData);
Button button = new Button(parent, SWT.PUSH);
button.setText("Add");
gridData = new GridData();
gridData.widthHint = 50;
button.setLayoutData(gridData);
//创建表格样式
table = new Table(parent, 2565);
table.setLinesVisible(true); //设置显示表格线
table.setHeaderVisible(true); //设置显示表头
//设置表头数组
final String[] table_column = {"Existing URIs", ""};
//用于设置列宽的布局管理器
TableLayout tLayout = new TableLayout();
//创建表头
for (int i = 0; i < table_column.length; ++i)
{
TableColumn tableColumn = new TableColumn(table, 0);
tableColumn.setText(table_column[i]);
tableColumn.setWidth(200);
//将列宽设置为50px
tLayout.addColumnData(new ColumnWeightData(100));
}
//创建TableViewer
TableViewer tableViewer = new TableViewer(table);
tableViewer.getTable().setLayout(tLayout);
//将表头填充,并显示
for (int i = 0; i < tableViewer.getTable().getColumnCount(); ++i)
{
tableViewer.getTable().getColumn(i).pack();
}
//设置表格样式
gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 3);
table.setLayoutData(gridData);
Button button1 = new Button(parent, SWT.PUSH);
button1.setText("Up");
gridData = new GridData();
gridData.widthHint = 50;
button1.setLayoutData(gridData);
Button button2 = new Button(parent, SWT.PUSH);
button2.setText("Down");
gridData = new GridData();
gridData.widthHint = 50;
button2.setLayoutData(gridData);
Button button3 = new Button(parent, SWT.PUSH);
button3.setText("Delete");
gridData = new GridData();
gridData.widthHint = 50;
button3.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Count");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
protocolLab.setLayoutData(gridData);
//Count文本框
Text text2 = new Text(parent, SWT.BORDER);
text2.setText("0");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 135;
text2.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Iteration\nInterval");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
protocolLab.setLayoutData(gridData);
//Count文本框
Text text3 = new Text(parent, SWT.BORDER);
text3.setText("30");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 135;
text3.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Application\nErrors");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 2);
protocolLab.setLayoutData(gridData);
Button button4 = new Button(parent, SWT.RADIO);
button4.setText("男");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 2,
1);
button4.setLayoutData(gridData);
Button button5 = new Button(parent, SWT.RADIO);
button5.setText("女");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 2,
1);
button5.setLayoutData(gridData);
}
}
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import com.huawei.enip.esdt.common.ui.esdt.forms.EsdtFormSection;
import com.huawei.enip.esdt.esb.ui.editor.pages.ESBTransportConfigPage;
public class TransportConfigSection extends EsdtFormSection
{
private Table table = null;//表格对象
private ESBTransportConfigPage page = null;//ESBOverViewPage页
private Label pageInfoLab;//页信息标签
private Label protocolLab;
private Label LoadLab;
private Label urlLab;//url标签
private Label formatLab;
private Label retryLab;
private Label iterationLab;
private Label applicationLab;
private Text httpTxt;
private Text numTxt;
private Text nubTxt;
private Combo protocolCombo;
private Combo roundCombo;
private Button yesBut;
private Button noBut;
private Button buttonUp;
private Button buttonAdd;
private Button buttonDown;
private Button buttonDel;
/**
* 构造函数
* @param parent
* @param toolkit
* @param style
*/
public TransportConfigSection(Composite parent, FormToolkit toolkit,
int style)
{
super(parent, toolkit, style);
}
/* (此注释不是Javadoc注释)
* @see
com.huawei.enip.esdt.common.ui.forms.FormSection#createClientArea
(org.eclipse.swt.widgets.Composite,
org.eclipse.ui.forms.widgets.FormToolkit)
*/
@Override
public void createClientArea(Composite parent, FormToolkit
formToolkit)
{
//设置Section标签
getSection().setText("Transport Configuration");
getSection().setLayoutData(new GridLayout());
getSection().setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.VERTICAL_ALIGN_FILL
| GridData.FILL_HORIZONTAL));
//设置分割线
formToolkit.createCompositeSeparator(getSection());
//创建页面显示
createDescriptionArea(parent);
}
/**
* 页面显示的方法
* @param parent
*/
private void createDescriptionArea(Composite parent)
{
parent.setLayout(new FillLayout());
//设置全局网格布局方式
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3; //设置网格的列数为4
gridLayout.horizontalSpacing = 50;
parent.setLayout(gridLayout);
pageInfoLab = new Label(parent, SWT.NONE);//定义标签对象
pageInfoLab.setText("Use this page to configure the transport
information for this service.");
GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER,
false,
false, 3, 1);
pageInfoLab.setLayoutData(gridData);
//第一个标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Protocol");
//下拉列表框
protocolCombo = new Combo(parent, SWT.READ_ONLY);
protocolCombo.add("http");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 120;
protocolCombo.setLayoutData(gridData);
//第二个标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Load Balancing\nALgorithm");
//下拉列表框
protocolCombo = new Combo(parent, SWT.READ_ONLY);
protocolCombo.add("round-robin");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 120;
protocolCombo.setLayoutData(gridData);
//URL标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Endpoint URI");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 1,
5);
protocolLab.setLayoutData(gridData);
//FORMAT标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Format:http://host:post/soneService");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 300;
protocolLab.setLayoutData(gridData);
Text text = new Text(parent, SWT.BORDER);
text.setText("http://www.iteye.com");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
gridData.widthHint = 300;
text.setLayoutData(gridData);
Button button = new Button(parent, SWT.PUSH);
button.setText("Add");
gridData = new GridData();
gridData.widthHint = 50;
button.setLayoutData(gridData);
//创建表格样式
table = new Table(parent, 2565);
table.setLinesVisible(true); //设置显示表格线
table.setHeaderVisible(true); //设置显示表头
//设置表头数组
final String[] table_column = {"Existing URIs", ""};
//用于设置列宽的布局管理器
TableLayout tLayout = new TableLayout();
//创建表头
for (int i = 0; i < table_column.length; ++i)
{
TableColumn tableColumn = new TableColumn(table, 0);
tableColumn.setText(table_column[i]);
tableColumn.setWidth(200);
//将列宽设置为50px
tLayout.addColumnData(new ColumnWeightData(100));
}
//创建TableViewer
TableViewer tableViewer = new TableViewer(table);
tableViewer.getTable().setLayout(tLayout);
//将表头填充,并显示
for (int i = 0; i < tableViewer.getTable().getColumnCount(); ++i)
{
tableViewer.getTable().getColumn(i).pack();
}
//设置表格样式
gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 3);
table.setLayoutData(gridData);
Button button1 = new Button(parent, SWT.PUSH);
button1.setText("Up");
gridData = new GridData();
gridData.widthHint = 50;
button1.setLayoutData(gridData);
Button button2 = new Button(parent, SWT.PUSH);
button2.setText("Down");
gridData = new GridData();
gridData.widthHint = 50;
button2.setLayoutData(gridData);
Button button3 = new Button(parent, SWT.PUSH);
button3.setText("Delete");
gridData = new GridData();
gridData.widthHint = 50;
button3.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Count");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
protocolLab.setLayoutData(gridData);
//Count文本框
Text text2 = new Text(parent, SWT.BORDER);
text2.setText("0");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 135;
text2.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Iteration\nInterval");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 1);
protocolLab.setLayoutData(gridData);
//Count文本框
Text text3 = new Text(parent, SWT.BORDER);
text3.setText("30");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
2, 1);
gridData.widthHint = 135;
text3.setLayoutData(gridData);
//Count标签
protocolLab = new Label(parent, SWT.NONE);
protocolLab.setText("Retry Application\nErrors");
gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false,
1, 2);
protocolLab.setLayoutData(gridData);
Button button4 = new Button(parent, SWT.RADIO);
button4.setText("男");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 2,
1);
button4.setLayoutData(gridData);
Button button5 = new Button(parent, SWT.RADIO);
button5.setText("女");
gridData = new GridData(SWT.BEGINNING, SWT.TOP, false, false, 2,
1);
button5.setLayoutData(gridData);
}
}
发表评论
文章已被作者锁定,不允许评论。
-
SWT控件3
2011-08-10 10:02 364ssssssssss -
SWT控件2
2011-08-10 09:47 426vvvvvvvvvv -
SWT控件
2011-08-10 09:44 379aaaaaaa -
SWT的Table对单元格添加可编辑属性
2011-08-09 17:11 971http://imylone.iteye.com/blog/1 ... -
TreeViewer的ContentProvider详解,以及Lazy载入
2011-07-20 14:00 699http://lizhensan.iteye.com/blog ... -
eclipse 对话框 大全
2011-07-20 13:57 560http://lizhensan.iteye.com/blog ... -
rcp 便捷操作
2011-07-20 13:55 662http://lizhensan.iteye.com/blog ... -
eclipse 代码
2011-07-20 13:54 678http://lizhensan.iteye.com/blog ... -
浏览器 chrome 插件开发
2011-07-20 13:52 781http://lizhensan.iteye.com/blog ... -
代码创建java工程
2011-07-20 13:50 652http://lizhensan.iteye.com/blog ... -
eclipse jet
2011-07-20 13:48 635http://lizhensan.iteye.com/blog ... -
freemarker 第一个例子
2011-07-20 13:47 632http://lizhensan.iteye.com/blog ... -
Eclipse的Error Log View中显示自己的Log
2011-07-20 13:44 789http://lizhensan.iteye.com/blog ... -
述_综_术_技_台_平_Eclipse
2011-07-20 13:40 469http://lizhensan.iteye.com/blog ... -
绍_介_点_展_扩
2011-07-20 12:28 280http://lizhensan.iteye.com/blog ... -
TableViewer_TreeViewer
2011-07-12 12:33 1533SWT中设置TableViewer和TreeViewer成为双 ... -
具_工_小_制_自
2011-07-12 12:31 799<extension point=& ... -
点_展_扩_义_定_自
2011-07-12 12:28 573博客分类: eclipse plugin Eclipse 自 ... -
化_际_国_eclipse
2011-07-12 12:23 606博客分类: eclipse plugin 像eclipse ... -
语_法_件_控_本_基_S_W_T
2011-04-06 20:24 1524************************基本控件*** ...
相关推荐
* 打 开 布 局:Ctrl+Shift+O 插入 * 草:X * 拉伸:X * 回转:R * 修剪的片体:T * 变化的扫掠:V 格式 * 图层设置:Ctrl+L * 在视图中可见:Ctrl+Shift+V * 移动至图层:Alt+R+M * 复制至图层:Alt+R+O 工具 ...
- GJ:通信用室(局)内光缆,适用于室内布线,如数据中心、办公楼等。 - GS:通信用设备内光缆,用于设备内部连接,例如交换机、路由器之间的连接。 - GH:通信用海底(水下)光缆,专为水下通信设计。 - GT:...
- **铝带-聚乙烯粘结护层**(A)、**钢带-聚乙烯粘结护层**(S)、**夹带钢丝的钢带-聚乙烯粘结护层**(W):分别提供不同的机械保护和防鼠咬功能。 #### 六、外护层的加固与保护 外护层进一步增强了光缆的机械...
今 年 6月 7日 ,由 SUN公 司 和 台 湾 经 济 事 务 部 信 息 发 展 局, 台湾信 息 技 术 研究 所 等 单 位 牵 头 ,成 立 了 一 个 "Java联 盟 ", 参 加 的 有 22个 在 台 湾相 当 著 名 的 计 算 机公 司 ,并 在 台 ...
歜宁用户接口W:数宇用户线接口是数宇程控交换系统和数字用户终端设备 之间的接口电蹄。 3)操作管理和维护(0A)接口: 用于传递与操作和维护有关的息。 25.模拟用户接口电路有哪些功能? 答: 程控交换机中的用户电蹄功能...