HPDocViewer 世维会是什么么

Tableviewer中为表格添加删除、修改link - 推酷
Tableviewer中为表格添加删除、修改link
package com.pcm.chni.recipereport.
import java.util.ArrayL
public class TableViewerDel {
protected S
private String findLinkKey = &FindLink&;
private List listcuCustomers = new ArrayList();
private ArrayList&Hyperlink& delList = new ArrayList&Hyperlink&();
private final FormToolkit formToolkit = new FormToolkit(Display
.getDefault());
private TableViewer tableV
private boolean finashaddlink=
* Launch the application.
* @param args
public static void main(String[] args) {
TableViewerDel window = new TableViewerDel();
window.open();
} catch (Exception e) {
e.printStackTrace();
* Open the window.
public void open() {
Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
* Create contents of the window.
protected void createContents() {
shell = new Shell();
shell.setSize(450, 300);
shell.setText(&SWT Application&);
tableViewer = new TableViewer(shell, SWT.BORDER
| SWT.FULL_SELECTION);
table = tableViewer.getTable();
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.setBounds(10, 27, 422, 191);
TableColumn tableColumn = new TableColumn(table, SWT.NONE);
tableColumn.setWidth(100);
tableColumn.setText(&数据显示&);
TableColumn tableColumn_1 = new TableColumn(table, SWT.NONE);
tableColumn_1.setWidth(100);
tableColumn_1.setText(&删除&);
tableViewer.setContentProvider(new RecipereportTableViewContentProvider());//内容器
tableViewer.setLabelProvider(new RecipereportTableViewLabelProvider());//标签器
listcuCustomers.add(&zhangsan&);
listcuCustomers.add(&lis&);
listcuCustomers.add(&wangwu&);
listcuCustomers.add(&liuliu&);
listcuCustomers.add(&qiqi&);
tableViewer.setInput(listcuCustomers);
linkListener();
table.addListener(SWT.MeasureItem, new Listener() {//表格监听器 表格画完后设置高度
public void handleEvent(Event event) {
event.height = 23;
Listener delayInit = new Listener() {
public void handleEvent(Event arg0) {
if(table.getItemHeight() & 23 || listcuCustomers.size() == 0 || finashaddlink){
linkListener();
finashaddlink =
table.addListener(SWT.MeasureItem, delayInit);
public void linkListener() {
deleteAllLinks();//删除所有的删除链接
if (listcuCustomers != null && listcuCustomers.size() & 0) {
for (int i = 0; i & listcuCustomers.size(); i++) {//获取集合中的数据
TableItem itemi = table.getItem(i);//表格中一行数据
final Hyperlink hprlnDeleO = formToolkit.createHyperlink(table,
&删除&, SWT.CENTER);//创建一个删除链接
formToolkit.paintBordersFor(hprlnDeleO);
TableEditor editor = new TableEditor(table);//编辑table
editor.grabHorizontal = editor.grabVertical =
editor.setEditor(hprlnDeleO, itemi, 1);//设置删除链接
delList.add(hprlnDeleO);//将删除链接添加到delList中
hprlnDeleO.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
TableItem xxx = table.getItem(new Point(e.x +
hprlnDeleO.getBounds().x, e.y +
hprlnDeleO.getBounds().y));
String hhlfir = (String) xxx.getData();//获取点击这一行的数据
listcuCustomers.remove(hhlfir);//点击删除remove listcuCustomers中的数据
tableViewer.setInput(listcuCustomers);//重新set数据
linkListener();//在每一行中添加删除链接
hprlnDeleO.setEnabled(true);//将删除按钮设置为启用
hprlnDeleO.setData(findLinkKey, hprlnDeleO);
protected void deleteAllLinks() {
for (int i = 0; i & delList.size(); i++) {//循环 删除所有删除链接
deleteLink(delList.get(i));
delList.clear();//清空list
protected void deleteLink(Hyperlink hprlnk_Delete) {
if (hprlnk_Delete == null) {
hprlnk_Delete.dispose();//摧毁所有的删除链接
Hyperlink findlink = (Hyperlink) hprlnk_Delete.getData(findLinkKey);
if (findlink != null) {
findlink.dispose();
} catch (Exception ex) {
ex.printStackTrace();
package com.pcm.chni.recipereport.
import java.util.L
import org.eclipse.jface.viewers.IStructuredContentP
import org.eclipse.jface.viewers.V
public class RecipereportTableViewContentProvider implements IStructuredContentProvider{
@SuppressWarnings(&unchecked&)
public Object[] getElements(Object inputElement) {
// TODO Auto-generated method stub
if(inputElement instanceof List)
return ((List)inputElement).toArray();
return new Object[0];
public void dispose() {
// TODO Auto-generated method stub
public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
// TODO Auto-generated method stub
package com.pcm.chni.recipereport.
import org.eclipse.jface.viewers.ILabelProviderL
import org.eclipse.jface.viewers.ITableLabelP
import org.eclipse.swt.graphics.I
import com.pcm.chni.userManage.model.C
public class RecipereportTableViewLabelProvider implements ITableLabelProvider{
public Image getColumnImage(Object arg0, int arg1) {
// TODO Auto-generated method stub
public String getColumnText(Object element, int index) {
if(element instanceof Customer){
Customer cu=(Customer)
switch (index) {
return cu.getCustomerid();
return cu.getCustomername();
return cu.getSexid().equals(&1&)?&男&:&女&;
return cu.getBirthday();
return cu.getMobile();
return cu.getOrgname();
return cu.getDocname();
return &--&;
}else if(element instanceof String){
switch (index) {
return (String)
return &--&;
public void addListener(ILabelProviderListener arg0) {
// TODO Auto-generated method stub
public void dispose() {
// TODO Auto-generated method stub
public boolean isLabelProperty(Object arg0, String arg1) {
// TODO Auto-generated method stub
public void removeListener(ILabelProviderListener arg0) {
// TODO Auto-generated method stub
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致PDF Solutions For All Your Needs - PDF Software | Foxit Software
Leading Companies Choose Foxit
Customers Include
OEM Partners
Featured Foxit Products
PhantomPDF
Feature rich PDF Editor to quickly and easily work on PDF documents.
Better collaboration generates better documents
Easily modify PDF files
Document management and tracking
Scan, OCR, and compress
Protect and sign
Organize and create
Leverage Foxit's powerful, standard-compliant PDF technology.
Rendition Server
Enterprise platform for standardized conversion to PDF and PDF/A.
Foxit Reader & MobilePDF
Free feature rich PDF readers on desktop and mobile devices.
PDF Compressor
High volume server-based document OCR and compression.
Ultraforms
2D barcode generation engine to capture PDF fillable form data.
PDF Toolkit
Set of command line modules to perform specific workflow tasks.
PDF IN THE CONNECTED WORLD
Next-generation PDF, turning isolated documents into smart documents, facilitating collaboration, tracking, and security.
Customer Testimonials
I am happy with Foxit PDF. It is perfectly serving my professional needs.
Thank you very much for availing me this opportunity to work with your excellent software product.
This is by far the best PDF software I've used in ages. I am very pleased with the ease of use and functionality of the program.
Ronn Buchanan
I used to dread working on PDF's in Adobe Writer. Foxit is much more intuitive and makes my life a little less stressful.
Ray Otberg
Foxit rocks! It's doing everything I hoped it would, and more I have yet to learn.
F.J. "Paco" Amram
Foxit is without a doubt, the best PDF software I have ever used.
It is much better than Nuance, by the way.
David Swinehart
Congratulations on an excellent product, and a big saving over Acrobat Pro, which I was using.
Grant Crawley
Greatest customer service in my entire life.
You guys Rock!!
Vince Surace
It's awesome and I probably not even fully aware of features.
Martha Stanton-Smith
So far we are loving the many options available with your software.
Marlene Ruiz237131 人聚集在这个小组
(爱看书的老头)
(楼兰城主)
第三方登录:Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format,
then convert it to structurally valid XHTML (or HTML).
The goal for Markdown's formatting syntax is to be as readable as possible. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions.
In short, you can create beautiful HTML documents without knowing any HTML.
Who uses Markdown?
Markdown is used by popular websites like Reddit, GitHub, and Stack Overflow.
What does Markdown look like?
**Strong Text**
& Strong Text
*Emphasis Text*
& Emphasis Text
[A Hyperlink](#yourLink)
![An Image](img/MarkdownPad-Logo-16.png)
MarkdownPad is a full-featured
editor for Windows.
MarkdownPad Features
Instant HTML Preview
Make changes, See changes
Instantly see what your Markdown documents look like in HTML as you create them.
While you type, LivePreview will automatically scroll to the current location you're editing.
Easy Markdown formatting with keyboard shortcuts
Ultimate simplicity
Markdown formatting can be applied (and removed) with handy keyboard shortcuts and toolbar buttons.
You don't need to know anything about Markdown to use MarkdownPad!
Fully Customizable
Make it your own
Color schemes, fonts, sizes and layouts are all customizable so you can turn MarkdownPad into your perfect editor.
Use your own CSS
Custom Stylesheets
Change the look of your HTML documents by using your own CSS stylesheets. MarkdownPad supports multiple stylesheets and has a built-in CSS editor.
The default CSS is beautiful and minimal, and will make your HTML documents look great.
HTML and PDF Export
Your documents, à la carte
Quickly create ready-to-use HTML documents, or simply copy a portion of your document as HTML.
Need a PDF? No problem, you can create them directly from MarkdownPad.
Advanced features for power users
supports multiple Markdown processing engines, including Markdown Extra (with Table support), and GitHub Flavored Markdown.
With tabbed documents, a built-in image uploader, spell check, auto-save and syntax highlighting, there's no limit to what you can do with MarkdownPad.
Wonderful things people are saying about MarkdownPad
MarkdownPad for Windows is stunning. Simple. Clean. Perfect. Well done,
Technology Evangelist at Microsoft
MarkdownPad is what I do pretty much all of my writing in. It's a great little app.
Writer at Ars Technica
If you have any interest in Markdown, and you're a Windows user, MarkdownPad is definitely worth a download.
I just discovered MarkdownPad for Windows so, uhh, I guess this is goodbye, Microsoft Word?
Web Developer and Designer
MarkdownPad destroys the myth that Markdown editors only exist on Apple's Mac OS X.
Communications and Development Manager
MarkdownPad saved my life writing API documentation for work. Best software I've used in a long time.
.NET Developer
I love MarkdownPad, it's my first stop when writing almost anything. Great that the developer, , is so responsive too!
We're able to write our Markdown documentation on Windows with ease thanks to MarkdownPad.
PHP Framework Developer
Want to share your love for MarkdownPad? Use the hashtag
#MarkdownPad
on Twitter!
About MarkdownPad
MarkdownPad is developed by
, a software engineer based out of Minneapolis, MN.
For updates, follow
on Twitter.
Built Exclusively for Windows
MarkdownPad is designed for Windows and uses the .NET 4 and Windows Presentation Foundation 4 frameworks (that means it's extra shiny on the inside).
Upgrade to MarkdownPad Pro
Unlock the full potential of MarkdownPad by upgrading to MarkdownPad Pro. This version includes great additional features and is licensed for commercial use.
Copyright & 2011-
/ Apricity Software LLC

我要回帖

更多关于 世维会是什么 的文章

 

随机推荐