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

📄 resourcecolumn.java

📁 It is all about project scheduling. GanttProject is a tool for creating a project schedule by means
💻 JAVA
字号:
package net.sourceforge.ganttproject.resource;import javax.swing.DefaultCellEditor;import javax.swing.JComboBox;import org.jdesktop.swing.table.TableColumnExt;/**@author nokiljevic *   * Describes one column in the resources table. */     public class ResourceColumn    {    	/** Swing column composant representing the column */    	TableColumnExt column;    	/** Datatype of the column */    	Class type;    	/** Default value for the column */    	Object defaultVal;    	/** Visible on the screen */    	boolean visible;    	/** Default index in the table. When the column is shown    	 *  that index will be forced. */    	int defaultIndex;    	    	public ResourceColumn(String name, int index, Class type) {    		column = new TableColumnExt(index);    		this.type = type;    		this.setTitle(name);    		defaultIndex = index;    	}    	    	public ResourceColumn(TableColumnExt col, int index){    		column = col;    		this.type = String.class;    		defaultIndex = index;    		visible = true;    	}    	    	public ResourceColumn(TableColumnExt col, int index, Class type){    		column = col;    		this.type = type;    		defaultIndex = index;    		visible = true;    	}    	/**     	 * It enables to set the visible parameters.    	 *    	 * @param visible     means that the column name is checked or not     	 * 					  in the resource popup menu.    	 *     	 */    	public ResourceColumn(TableColumnExt col, int index, Class type, boolean visible){    		column = col;    		this.type = type;    		defaultIndex = index;    		this.visible = visible;    	}    	    	public ResourceColumn(TableColumnExt col, int index, Class type, Object def) {    		column = col;    		defaultIndex = index;    		visible = true;    		this.type = type;    		defaultVal = def;    	}    	    	public boolean nameCmp(String name) {    		System.out.println("comparing: "+name+" - "+column.getTitle()+" ");    		return column.getTitle().equals(name);    	}    	    	public void setTitle(String title) {    		column.setTitle(title);    	}    	    	public String getTitle() {    		return column.getTitle();    	}    	    	public boolean isVisible() {    		return visible;    	}    	    	public void setVisible(boolean vis) {    		visible = vis;    	}		public int getIndex() {			return defaultIndex;		}		public void setIndex(int defaultIndex)  {			this.defaultIndex = defaultIndex;		}				public TableColumnExt getColumn() {			return column;		}				public Object getDefaultVal() {			return defaultVal;		}				public void setDefaultVal(Object defaultVal) {			this.defaultVal = defaultVal;		}				public Class getType() {			return type;		}				public void setType(Class type) {			this.type = type;		}    }

⌨️ 快捷键说明

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