ftp服务器zip文件怎么解压,从ftp服务器上的Zip解压缩csv文件

本文展示了如何在Eclipse应用中使用Draw2D库创建一个带有多级树视图的TitleAreaDialog。通过实例代码,读者可以学习如何构建一个包含10级嵌套树结构的树形控件,并定制对话框标题和布局。
摘要由CSDN通过智能技术生成

修正使用:

import org.eclipse.draw2d.ColorConstants;

import org.eclipse.jface.dialogs.TitleAreaDialog;

import org.eclipse.jface.viewers.TreeViewer;

import org.eclipse.swt.SWT;

import org.eclipse.swt.custom.SashForm;

import org.eclipse.swt.events.DisposeEvent;

import org.eclipse.swt.events.DisposeListener;

import org.eclipse.swt.layout.GridData;

import org.eclipse.swt.layout.GridLayout;

import org.eclipse.swt.widgets.Composite;

import org.eclipse.swt.widgets.Control;

import org.eclipse.swt.widgets.Display;

import org.eclipse.swt.widgets.Label;

import org.eclipse.swt.widgets.Shell;

import org.eclipse.swt.widgets.TreeItem;

public class testTitleDialog extends TitleAreaDialog {

private static final String DIALOG_TITLE = "TITLE AREA DIALOG";

Composite area;

public testTitleDialog(Shell parentShell) {

super(parentShell);

}

@Override

public void create() {

super.create();

setTitle("TITLE WILL BE HERE");

}

@Override

protected Control createDialogArea(final Composite parent) {

this.area = (Composite) super.createDialogArea(parent);

parent.getShell().setText(DIALOG_TITLE);

Composite area = (Composite) super.createDialogArea(parent);

Composite contents = (Composite) super.createDialogArea(area);

contents.setLayout(new GridLayout());

contents.setLayoutData(new GridData(GridData.FILL_BOTH));

contents.addDisposeListener(new DisposeListener(){

public void widgetDisposed(DisposeEvent e) {

}

});

createMapperComposite(contents);

return this.dialogArea;

}

private void createMapperComposite(Composite composite) {

Composite main = new Composite(composite, SWT.NONE);

main.setLayout(new GridLayout());

main.setLayoutData(new GridData(GridData.FILL_BOTH));

treeMapper(main);

}

private Composite treeMapper(Composite main) {

SashForm sashForm = new SashForm(main, SWT.HORIZONTAL);

Composite composite = new Composite(sashForm, SWT.NONE);

composite.setLayout(new GridLayout());

composite.setLayoutData(new GridData(GridData.FILL_BOTH));

composite.setBackground(ColorConstants.white);

//i is number of trees

for (int i = 0; i < 10; i++) {

Label lbl = new Label(composite, SWT.NONE);

lbl.setText("Tree " + i);

// Add content to scrolled composite

Composite scrolledContent = new Composite(composite, SWT.NONE);

scrolledContent.setLayout(new GridLayout());

GridData gridData = new GridData();

gridData.horizontalAlignment = SWT.FILL;

gridData.grabExcessHorizontalSpace = true;

gridData.verticalAlignment = SWT.FILL;

gridData.grabExcessVerticalSpace = true;

scrolledContent.setLayoutData(gridData);

final TreeViewer tree = new TreeViewer(scrolledContent);

for(int loopIndex0 = 0; loopIndex0 < 10; loopIndex0++) {

TreeItem treeItem0 = new TreeItem(tree.getTree(), 0);

treeItem0.setText("Level 0 Item "+ loopIndex0);

for(int loopIndex1 = 0; loopIndex1 < 10; loopIndex1++) {

TreeItem treeItem1 = new TreeItem(treeItem0, 0);

treeItem1.setText("Level 1 Item "+ loopIndex1);

for(int loopIndex2 = 0; loopIndex2 < 10; loopIndex2++) {

TreeItem treeItem2 = new TreeItem(treeItem1, 0);

treeItem2.setText("Level 2 Item "+ loopIndex2);

}

}

}

tree.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

}

new TreeViewer(sashForm);

return main;

}

@Override

protected boolean isResizable() {

return true;

}

@Override

protected void okPressed() {

super.okPressed();

}

public static void main(final String[] args) {

Display display = new Display();

Shell shell = new Shell(display);

new testTitleDialog(shell).open();

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值