validationvaluesection.java

来自「一个eclipse插件源代码。用于web开发」· Java 代码 · 共 115 行

JAVA
115
字号
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/validation/ValidationValueSection.java,v 1.1.1.1 2004/07/01 09:07:53 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:53 $
 *
 * ====================================================================
 *
 * The NanJing HopeRun(IT-FOREST) Software License, Version 2.0.0
 *
 * Copyright 2003-2004 by NanJing HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and
 *                        IT Forest Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 */
package com.webpump.ui.validation;

import org.eclipse.jface.viewers.*;

import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.internal.ui.elements.DefaultTableProvider;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

import org.eclipse.swt.custom.TableEditor;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;

import com.webpump.ui.base.data.*;
import com.webpump.ui.base.gui.*;
import com.webpump.ui.perspective.MacroResource;
import com.webpump.ui.perspective.WebpumpIDEPlugin;

/**
 * Class for the table part of the validation editor which shows the args information..
 * 
 * @author zhao_f
 * @version 2.0.0 2004-1-13
 */
public class ValidationValueSection extends BaseTableSection{
	
	//编辑value的tableEditor
	private TableEditor m_objEditor1;
	
	private String strTag = "";
	
	/**
	 * Provide content for the table
	 */
	protected class ValidContentProvider extends DefaultTableProvider {
		public Object[] getElements(Object parent) {
			
			if (parent instanceof ValidationFields)
			{
				return ((ValidationFields)parent).getInfo();
			}

			return new Object[0];
		}

	}
	
	/**
	 * Provide Lable for the table
	 */	
	protected class TableLabelProvider extends LabelProvider  implements  ITableLabelProvider {

		public Image getColumnImage(Object element, int columnIndex) {
			return null;
		}

		public String getColumnText(Object element, int columnIndex) {
			if (element instanceof ValidationArgs)
				return ((ValidationArgs)element).getParamsShowInfo()[columnIndex] ;
				
			else
				return null;
		}
	}
	
	/**
	 * the constructor
	 */
	public ValidationValueSection(BasePage page){
		super(page);
		
		//Set the head text of this part
		this.setHeaderText(WebpumpIDEPlugin.getResourceString(MacroResource.VALIDATIONVALUESECTION_HEADER_TEXT));
		handleDefaultButton = false;
	}

    /**
     * Initailize this table section
     */
	public void initialize(Object input) {
		BaseModel model = (BaseModel) input;
					
		tableViewer.getTable().setLinesVisible(true);
		tableViewer.getTable().setHeaderVisible(true);
		tableViewer.setSorter(null);
		
		//为柄炻建

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?