page.java
来自「一个eclipse插件源代码。用于web开发」· Java 代码 · 共 111 行
JAVA
111 行
/*
* $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/gefmodule/model/Page.java,v 1.1.1.1 2004/07/01 09:07:48 wang_j Exp $
* $Revision: 1.1.1.1 $
* $Date: 2004/07/01 09:07:48 $
*
* ====================================================================
*
* 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.gefmodule.model;
import java.io.PrintWriter;
import java.util.Vector;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.webpump.ui.perspective.MacroResource;
import com.webpump.ui.perspective.WebpumpIDEPlugin;
/**
* Class for Page
*
* @author shi_l
* @version 2.0.0 2004-5-30
*/
public class Page extends ModelSubpart {
public class PropertyLabelProvider extends LabelProvider {
/** image of the label*/
private Image image;
/** name of the label*/
private Object 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 (name.equals("boolean")) {
//boolean型显示true & false
if (((Integer) value).intValue() == 1) {
return "true";
} else {
return "false";
}
} else if (name.equals("PROPERTY_TYPE")) {
//basetype型显示Error & Base
switch (((Integer) value).intValue()) {
case 0 :
return "Base";
case 1 :
return "Error";
case 2 :
return "Download";
case 3 :
return "Upload";
}
}
}
return value.toString();
}
/**
* get image of the label after choose
* @param obj
* @return image Image
*/
public Image getImage(Object obj) {
return image;
}
}
//锚点
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?