⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskpropertysource.java

📁 一个eclipse插件源代码。用于web开发
💻 JAVA
字号:
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/module/editor/TaskPropertySource.java,v 1.1.1.1 2004/07/01 09:07:50 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:50 $
 *
 * ====================================================================
 *
 * 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.module.editor;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;

import com.webpump.ui.base.data.BaseObject;
import com.webpump.ui.base.gui.BasePropertySource;
import com.webpump.ui.module.model.Model;
import com.webpump.ui.module.model.Resource;
import com.webpump.ui.module.model.Task;
import com.webpump.ui.perspective.MacroResource;
import com.webpump.ui.perspective.WebpumpIDEPlugin;

/**
 * Class for property source of Task
 * 
 * @author shi_l
 * @version 2.0.0 2004-2-26
 */
public class TaskPropertySource extends BasePropertySource {

    /** Id of the task name shown in property sheet*/
	private final static String TASK_NAME = "Name";
    
    /** Id of the forward type shown in property sheet*/
	private final static String MODE = "Mode";
    
    /** Id of the formbean check shown in property sheet*/
	private final static String VALIDATE = "Validate";
    
    /** Id of the request page name shown in property sheet*/
	private final static String REQUEST_PAGE = "Requestpage";
    
    /** Id of the response page name shown in property sheet*/
	private final static String RESPONSE_PAGE = "Responsepage";
    
    /**
     * Class for property label provider
     * 
     * @author shi_l
     * @version 2.0.0 2004-2-26
     */
	public class PropertyLabelProvider extends LabelProvider {
        /** image of the label*/
        private Image image;

        /** name of the label*/
        private String name;

        /** type of the label*/
        private String type;
        
        /**
         * constructor
         * @param name
         * @param image
         * @param type
         */
		public PropertyLabelProvider(String name, Image image, String type) {
			this.image = image;
			this.name = name;
			this.type = type;
		}
        
        /**
         * get text of the label after choose
         * @param obj
         * @return text of the label String
         */
		public String getText(Object obj) {
			Object value = getPropertyValue(name);
			if (value instanceof Integer) {
				if (type.equals("boolean")) {
                    //boolean型显示验证和不验证
					if (((Integer) value).intValue() == 1) {
						return WebpumpIDEPlugin.getResourceString(MacroResource.MODULE_FORMBEAN_CHECK);
					} else {
						return WebpumpIDEPlugin.getResourceString(MacroResource.MODULE_FORMBEAN_UNCHECK);
					}
				} else if (type.equals("validate")) {
                    //validate型显示client & server
					if (((Integer) value).intValue() == 1) {
						return WebpumpIDEPlugin.getResourceString(
							MacroResource.TASKDIALOGVIEW_FORWARD_CLIENT);
					} else {
						return WebpumpIDEPlugin.getResourceString(
							MacroResource.TASKDIALOGVIEW_FORWARD_SERVER);
					}
				}
			}
			return value.toString();
		}
        
        /**
         * get image of the label after choose
         * @param obj
         * @return image Image
         */
		public Image getImage(Object obj) {
			return image;
		}
	}

    /**
     * constructor
     * @param objBaseObject
     */
	public TaskPropertySource(BaseObject objBaseObject) {
		super(objBaseObject);
	}

    /**
     * get property descriptors
     * @return descriptors IPropertyDescriptor[]
     */
	public IPropertyDescriptor[] getPropertyDescriptors() {
		if (descriptors == null) {
			descriptors = new PropertyDescriptor[5];
            
            //迁移名称栏
			descriptors[0] =
				createModifiedPropertyDescriptor(
					TASK_NAME,
					WebpumpIDEPlugin.getResourceString(MacroResource.MODULE_TASK_NAME));
             
            //

⌨️ 快捷键说明

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