当前位置: 首页>>代码示例>>Java>>正文


Java Resource类代码示例

本文整理汇总了Java中net.sf.memoranda.Resource的典型用法代码示例。如果您正苦于以下问题:Java Resource类的具体用法?Java Resource怎么用?Java Resource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Resource类属于net.sf.memoranda包,在下文中一共展示了Resource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
/**
 * Create table for resources panel.
 */
public void initTable() {
    Vector v = CurrentProject.getResourcesList().getAllResources();
    files = new Vector();
    for (int i = 0; i < v.size(); i++) {
        Resource r = (Resource)v.get(i);
        if (!r.isInetShortcut()) {
            File f = new File(r.getPath());
            if (f.isFile())
                files.add(r);
        }
        else 
            files.add(r);
    }

}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:19,代码来源:ResourcesTable.java

示例2: getValueAt

import net.sf.memoranda.Resource; //导入依赖的package包/类
public Object getValueAt(int row, int col) {
    Resource r = (Resource)files.get(row);
    if (col == _RESOURCE)
        return r;
    if (!r.isInetShortcut())  {
        File f = new File(r.getPath());
        switch (col) {
            case 0: return f.getName();
            case 1: MimeType mt = MimeTypesList.getMimeTypeForFile(f.getName());
                    if (mt != null) return mt.getLabel();
                    else return "unknown";
            case 2: Date d = new Date(f.lastModified());
                    return d;/*Local.getDateString(d, java.text.DateFormat.SHORT) +" "+
                           Local.getTimeString(d);*/
            case 3:return f.getPath();
        }
    }
    else {
        if (col == 0)
            return r.getPath();
        else if (col == 1)
            return Local.getString("Internet shortcut");
        else
            return "";                
    }
    return null;
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:28,代码来源:ResourcesTable.java

示例3: removeResB_actionPerformed

import net.sf.memoranda.Resource; //导入依赖的package包/类
void removeResB_actionPerformed(ActionEvent e) {
	int[] toRemove = resourcesTable.getSelectedRows();
	String msg = "";
	if (toRemove.length == 1)
		msg = Local.getString("Remove the shortcut to resource") + "\n'"
				+ resourcesTable.getModel().getValueAt(toRemove[0], 0) + "'";

	else
		msg = Local.getString("Remove") + " " + toRemove.length + " " + Local.getString("shortcuts");
	msg += "\n" + Local.getString("Are you sure?");
	int n = JOptionPane.showConfirmDialog(App.getFrame(), msg, Local.getString("Remove resource"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION)
		return;
	for (int i = 0; i < toRemove.length; i++) {
		CurrentProject.getResourcesList().removeResource(
				((Resource) resourcesTable.getModel().getValueAt(toRemove[i], ResourcesTable._RESOURCE)).getPath());
	}
	resourcesTable.tableChanged();
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:21,代码来源:ResourcesPanel.java

示例4: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
public void initTable() {
	Vector v = CurrentProject.getResourcesList().getAllResources();
	files = new Vector();
	for (int i = 0; i < v.size(); i++) {
		Resource r = (Resource) v.get(i);
		if (!r.isInetShortcut()) {
			File f = new File(r.getPath());
			if (f.isFile()) {
				files.add(r);
			}
		} else {
			files.add(r);
		}
	}

}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:17,代码来源:ResourcesTable.java

示例5: removeResB_actionPerformed

import net.sf.memoranda.Resource; //导入依赖的package包/类
void removeResB_actionPerformed(ActionEvent e) {
	int[] toRemove = resourcesTable.getSelectedRows();
	String msg = "";
	if (toRemove.length == 1) {
		msg = Local.getString("Remove the shortcut to resource") + "\n'"
				+ resourcesTable.getModel().getValueAt(toRemove[0], 0) + "'";
	} else {
		msg = Local.getString("Remove") + " " + toRemove.length + " " + Local.getString("shortcuts");
	}
	msg += "\n" + Local.getString("Are you sure?");
	int n = JOptionPane.showConfirmDialog(App.getFrame(), msg, Local.getString("Remove resource"),
			JOptionPane.YES_NO_OPTION);
	if (n != JOptionPane.YES_OPTION) {
		return;
	}
	for (int i = 0; i < toRemove.length; i++) {
		CurrentProject.getResourcesList().removeResource(
				((Resource) resourcesTable.getModel().getValueAt(toRemove[i], ResourcesTable._RESOURCE)).getPath());
	}
	resourcesTable.tableChanged();
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:22,代码来源:ResourcesPanel.java

示例6: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
public void initTable() {
    Vector v = CurrentProject.getResourcesList().getAllResources();
    files = new Vector();
    for (int i = 0; i < v.size(); i++) {
        Resource r = (Resource)v.get(i);
        if (!r.isInetShortcut()) {
            File f = new File(r.getPath());
            if (f.isFile())
                files.add(r);
        }
        else 
            files.add(r);
    }

}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:16,代码来源:ResourcesTable.java

示例7: removeResB_actionPerformed

import net.sf.memoranda.Resource; //导入依赖的package包/类
void removeResB_actionPerformed(ActionEvent e) {
    int[] toRemove = resourcesTable.getSelectedRows();
    String msg = "";
    if (toRemove.length == 1)
        msg =
            Local.getString("Remove the shortcut to resource")
                + "\n'"
                + resourcesTable.getModel().getValueAt(toRemove[0], 0)
                + "'";

    else
        msg = Local.getString("Remove") + " " + toRemove.length + " " + Local.getString("shortcuts");
    msg +=
        "\n"
        + Local.getString("Are you sure?");
    int n =
        JOptionPane.showConfirmDialog(
            App.getFrame(),
            msg,
            Local.getString("Remove resource"),
            JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION)
        return;
    for (int i = 0; i < toRemove.length; i++) {        	
    		CurrentProject.getResourcesList().removeResource(
                    ((Resource) resourcesTable.getModel().getValueAt(toRemove[i], ResourcesTable._RESOURCE)).getPath());
    }
    resourcesTable.tableChanged();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:30,代码来源:ResourcesPanel.java

示例8: getValueAt

import net.sf.memoranda.Resource; //导入依赖的package包/类
public Object getValueAt(int row, int col) {
    Resource r = (Resource)files.get(row);
    if (col == _RESOURCE)
        return r;
    if (!r.isInetShortcut())  {
        File f = new File(r.getPath());
        switch (col) {
            case 0: return f.getName();
            case 1: MimeType mt = MimeTypesList.getMimeTypeForFile(f.getName());
                    if (mt != null) return mt.getLabel();
                    else return "unknown";
            case 2: Date d = new Date(f.lastModified());
                    return d;/*Local.getDateString(d, java.text.DateFormat.SHORT) +" "+
                           Local.getTimeString(d);*/
            case 3:return f.getPath();
            default:
            	break;
        }
    }
    else {
        if (col == 0)
            return r.getPath();
        else if (col == 1)
            return Local.getString("Internet shortcut");
        else
            return "";                
    }
    return null;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:30,代码来源:ResourcesTable.java

示例9: removeResB_actionPerformed

import net.sf.memoranda.Resource; //导入依赖的package包/类
/**
 * Connects remove resource button to event.
 * Removes resource information from UI and program, also prompts user if they are 
 * sure they wish to remove the resource. Updates the UI following an affirmative 
 * decision.
 * @param e
 */
void removeResB_actionPerformed(ActionEvent e) {
    int[] toRemove = resourcesTable.getSelectedRows();
    String msg = "";
    if (toRemove.length == 1)
        msg =
            Local.getString("Remove the shortcut to resource")
                + "\n'"
                + resourcesTable.getModel().getValueAt(toRemove[0], 0)
                + "'";

    else
        msg = Local.getString("Remove") + " " + toRemove.length + " " + Local.getString("shortcuts");
    msg +=
        "\n"
        + Local.getString("Are you sure?");
    int n =
        JOptionPane.showConfirmDialog(
            App.getFrame(),
            msg,
            Local.getString("Remove resource"),
            JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION)
        return;
    for (int i = 0; i < toRemove.length; i++) {            
            CurrentProject.getResourcesList().removeResource(
                    ((Resource) resourcesTable.getModel().getValueAt(toRemove[i], ResourcesTable._RESOURCE)).getPath());
    }
    resourcesTable.tableChanged();
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:37,代码来源:ResourcesPanel.java

示例10: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
public void initTable() {
    Vector v = CurrentProject.getResourcesList().getAllResources();
    files = new Vector();
    for (int i = 0; i < v.size(); i++) {
        Resource r = (Resource)v.get(i);
        if (!r.isInetShortcut()) {
            File f = new File(r.getPath());
            if (f.isFile())
                files.add(r);
        }
        else 
            files.add(r);
    }
    
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:16,代码来源:ResourcesTable.java

示例11: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
public void initTable() {
	Vector v = CurrentProject.getResourcesList().getAllResources();
	files = new Vector();
	for (int i = 0; i < v.size(); i++) {
		Resource r = (Resource) v.get(i);
		if (!r.isInetShortcut()) {
			File f = new File(r.getPath());

			if (f.isFile())
				files.add(r);
		} else
			files.add(r);
	}

}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:16,代码来源:ResourcesTable.java

示例12: getValueAt

import net.sf.memoranda.Resource; //导入依赖的package包/类
public Object getValueAt(int row, int col) {
	Resource r = (Resource) files.get(row);
	if (col == _RESOURCE)
		return r;
	if (!r.isInetShortcut()) {
		File f = new File(r.getPath());

		switch (col) {
		case 0:
			return f.getName();
		case 1:
			return r.getdescription();
		case 2:
			MimeType mt = MimeTypesList.getMimeTypeForFile(f.getName());
			if (mt != null)
				return mt.getLabel();
			else
				return "unknown";
		case 3:
			Date d = new Date(f.lastModified());
			return d;/*
						 * Local.getDateString(d,
						 * java.text.DateFormat.SHORT) +" "+
						 * Local.getTimeString(d);
						 */
		case 4:
			return f.getPath();
		}
	} else {
		if (col == 0)
			return r.getPath();
		else if (col == 1)
			return r.getdescription();
		else if (col == 2)
			return Local.getString("Internet shortcut");
		else
			return "";
	}
	return null;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:41,代码来源:ResourcesTable.java

示例13: initTable

import net.sf.memoranda.Resource; //导入依赖的package包/类
private void initTable() {
    Vector v = CurrentProject.getResourcesList().getAllResources();
    files = new Vector<>();
    for (Object aV : v) {
        Resource r = (Resource) aV;
        if (!r.isInetShortcut()) {
            File f = new File(r.getPath());
            if (f.isFile())
                files.add(r);
        } else
            files.add(r);
    }

}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:15,代码来源:ResourcesTable.java

示例14: getValueAt

import net.sf.memoranda.Resource; //导入依赖的package包/类
public Object getValueAt(int row, int col) {
    Resource r = files.get(row);
    if (col == _RESOURCE)
        return r;
    if (!r.isInetShortcut()) {
        File f = new File(r.getPath());
        switch (col) {
            case 0:
                return f.getName();
            case 1:
                MimeType mt = MimeTypesList.getMimeTypeForFile(f.getName());
                return mt.getLabel();
            case 2:
                Date d = new Date(f.lastModified());
                return d;
            case 3:
                return f.getPath();
        }
    } else {
        if (col == 0)
            return r.getPath();
        else if (col == 1)
            return Local.getString("Internet shortcut");
        else
            return "";
    }
    return null;
}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:29,代码来源:ResourcesTable.java

示例15: removeResB_actionPerformed

import net.sf.memoranda.Resource; //导入依赖的package包/类
private void removeResB_actionPerformed() {
    int[] toRemove = resourcesTable.getSelectedRows();
    String msg = "";
    if (toRemove.length == 1)
        msg =
                Local.getString("Remove the shortcut to resource")
                        + "\n'"
                        + resourcesTable.getModel().getValueAt(toRemove[0], 0)
                        + "'";

    else
        msg = Local.getString("Remove") + " " + toRemove.length + " " + Local.getString("shortcuts");
    msg +=
            "\n"
                    + Local.getString("Are you sure?");
    int n =
            JOptionPane.showConfirmDialog(
                    App.getFrame(),
                    msg,
                    Local.getString("Remove resource"),
                    JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION)
        return;
    for (int aToRemove : toRemove) {
        CurrentProject.getResourcesList().removeResource(
                ((Resource) resourcesTable.getModel().getValueAt(aToRemove, ResourcesTable._RESOURCE)).getPath());
    }
    resourcesTable.tableChanged();
}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:30,代码来源:ResourcesPanel.java


注:本文中的net.sf.memoranda.Resource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。