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


Java AppList类代码示例

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


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

示例1: newTypeB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
void newTypeB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
    Dimension dlgSize = new Dimension(420, 420);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.extField.setText(ext);
    dlg.descField.setText(ext);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.iconLabel.setIcon(
        new ImageIcon(
            net.sf.memoranda.ui.AppFrame.class.getResource("resources/icons/mimetypes/default.png")));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = Util.generateId();
    MimeType mt = MimeTypesList.addMimeType(typeId);
    String[] exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    AppList appList = MimeTypesList.getAppList();
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:40,代码来源:ResourceTypePanel.java

示例2: newTypeB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
/**
 * Create new resource type and update the list.
 * @param e
 */
void newTypeB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
    Dimension dlgSize = new Dimension(420, 420);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.extField.setText(ext);
    dlg.descField.setText(ext);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.iconLabel.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.DESCRIPTION, 24, ColorMap.ICON));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = Util.generateId();
    MimeType mt = MimeTypesList.addMimeType(typeId);
    String[] exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    AppList appList = MimeTypesList.getAppList();
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:42,代码来源:ResourceTypePanel.java

示例3: newTypeB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
void newTypeB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New widget type"));
    Dimension dlgSize = new Dimension(420, 420);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.extField.setText(ext);
    dlg.descField.setText(ext);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.iconLabel.setIcon(
        new ImageIcon(
            net.sf.memoranda.ui.AppFrame.class.getResource("resources/icons/mimetypes/default.png")));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = Util.generateId();
    MimeType mt = MimeTypesList.addMimeType(typeId);
    String[] exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    AppList appList = MimeTypesList.getAppList();
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:40,代码来源:ResourceTypePanel.java

示例4: newTypeB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
void newTypeB_actionPerformed(ActionEvent e) {
	EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("New resource type"));
	Dimension dlgSize = new Dimension(420, 420);
	dlg.setSize(dlgSize);
	Dimension frmSize = App.getFrame().getSize();
	Point loc = App.getFrame().getLocation();
	dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
	dlg.extField.setText(ext);
	dlg.descField.setText(ext);
	dlg.appPanel.argumentsField.setText("$1");
	dlg.iconLabel.setIcon(
			new ImageIcon(net.sf.memoranda.ui.AppFrame.class.getResource("resources/icons/mimetypes/default.png")));
	dlg.setVisible(true);
	if (dlg.CANCELLED) {
		return;
	}
	String typeId = Util.generateId();
	MimeType mt = MimeTypesList.addMimeType(typeId);
	String[] exts = dlg.extField.getText().trim().split(" ");
	for (int i = 0; i < exts.length; i++) {
		mt.addExtension(exts[i]);
	}
	mt.setLabel(dlg.descField.getText());
	AppList appList = MimeTypesList.getAppList();
	if (dlg.appPanel.applicationField.getText().length() > 0) {
		File f = new File(dlg.appPanel.applicationField.getText());
		String appId = Util.generateId();
		appList.addApp(appId, f.getParent().replace('\\', '/'), f.getName().replace('\\', '/'),
				dlg.appPanel.argumentsField.getText());
		mt.setApp(appId);
	}
	if (dlg.iconPath.length() > 0) {
		mt.setIconPath(dlg.iconPath);
	}
	CurrentStorage.get().storeMimeTypesList();
	this.initTypesList();
	typesList.setSelectedValue(mt, true);
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:39,代码来源:ResourceTypePanel.java

示例5: editB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
void editB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("Edit resource type"));
    Dimension dlgSize = new Dimension(420, 450);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    MimeType mt = (MimeType) typesList.getSelectedValue();
    String[] exts = mt.getExtensions();
    String extss = "";
    for (int i = 0; i < exts.length; i++)
        extss += exts[i] + " ";
    dlg.extField.setText(extss);
    dlg.descField.setText(mt.getLabel());
    dlg.iconLabel.setIcon(mt.getIcon());
    AppList appList = MimeTypesList.getAppList();
    dlg.appPanel.applicationField.setText(
        appList.getFindPath(mt.getAppId()) + "/" + appList.getExec(mt.getAppId()));
    dlg.appPanel.argumentsField.setText(appList.getCommandLinePattern(mt.getAppId()));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = mt.getMimeTypeId();
    MimeTypesList.removeMimeType(typeId);
    mt = MimeTypesList.addMimeType(typeId);
    exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);

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

示例6: checkApp

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
/**
 * Find the application needed to run the file type.
 * @param mt
 * @return
 */
boolean checkApp(MimeType mt) {
    String appId = mt.getAppId();
    AppList appList = MimeTypesList.getAppList();
    File d;
    if (appId == null) {
        appId = Util.generateId();
        d = new File("/");
    }
    else {
        File exe = new File(appList.getFindPath(appId) + "/" + appList.getExec(appId));
        if (exe.isFile())
            return true;
        d = new File(exe.getParent());
        while (!d.exists())
            d = new File(d.getParent());
    }
    SetAppDialog dlg =
        new SetAppDialog(
            App.getFrame(),
            Local.getString(Local.getString("Select the application to open files of type")+" '" + mt.getLabel() + "'"));
    Dimension dlgSize = new Dimension(420, 300);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setDirectory(d);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return false;
    File f = new File(dlg.appPanel.applicationField.getText());

    appList.addOrReplaceApp(
        appId,
        f.getParent().replace('\\', '/'),
        f.getName().replace('\\', '/'),
        dlg.appPanel.argumentsField.getText());
    mt.setApp(appId);
    /*appList.setFindPath(appId, chooser.getSelectedFile().getParent().replace('\\','/'));
    appList.setExec(appId, chooser.getSelectedFile().getName().replace('\\','/'));*/
    CurrentStorage.get().storeMimeTypesList();
    return true;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:49,代码来源:ResourcesPanel.java

示例7: editB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
/**
 * Edit a resource type.
 * @param e
 */
void editB_actionPerformed(ActionEvent e) {
    EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("Edit resource type"));
    Dimension dlgSize = new Dimension(420, 450);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    MimeType mt = (MimeType) typesList.getSelectedValue();
    String[] exts = mt.getExtensions();
    String extss = "";
    for (int i = 0; i < exts.length; i++)
        extss += exts[i] + " ";
    dlg.extField.setText(extss);
    dlg.descField.setText(mt.getLabel());
    dlg.iconLabel.setIcon(mt.getIcon());
    AppList appList = MimeTypesList.getAppList();
    dlg.appPanel.applicationField.setText(
        appList.getFindPath(mt.getAppId()) + "/" + appList.getExec(mt.getAppId()));
    dlg.appPanel.argumentsField.setText(appList.getCommandLinePattern(mt.getAppId()));
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return;
    String typeId = mt.getMimeTypeId();
    MimeTypesList.removeMimeType(typeId);
    mt = MimeTypesList.addMimeType(typeId);
    exts = dlg.extField.getText().trim().split(" ");
    for (int i = 0; i < exts.length; i++)
        mt.addExtension(exts[i]);
    mt.setLabel(dlg.descField.getText());
    if (dlg.appPanel.applicationField.getText().length() > 0) {
        File f = new File(dlg.appPanel.applicationField.getText());
        String appId = Util.generateId();
        appList.addApp(
            appId,
            f.getParent().replace('\\', '/'),
            f.getName().replace('\\', '/'),
            dlg.appPanel.argumentsField.getText());
        mt.setApp(appId);
    }
    if (dlg.iconPath.length() > 0)
        mt.setIconPath(dlg.iconPath);
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
    typesList.setSelectedValue(mt, true);

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

示例8: checkApp

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
boolean checkApp(MimeType mt) {
    String appId = mt.getAppId();
    AppList appList = MimeTypesList.getAppList();
    File d;
    if (appId == null) {
        appId = Util.generateId();
        d = new File("/");
    }
    else {
        File exe = new File(appList.getFindPath(appId) + "/" + appList.getExec(appId));
        if (exe.isFile())
            return true;
        d = new File(exe.getParent());
        while (!d.exists())
            d = new File(d.getParent());
    }
    SetAppDialog dlg =
        new SetAppDialog(
            App.getFrame(),
            Local.getString(Local.getString("Select the application to open files of type")+" '" + mt.getLabel() + "'"));
    Dimension dlgSize = new Dimension(420, 300);
    dlg.setSize(dlgSize);
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setDirectory(d);
    dlg.appPanel.argumentsField.setText("$1");
    dlg.setVisible(true);
    if (dlg.CANCELLED)
        return false;
    File f = new File(dlg.appPanel.applicationField.getText());

    appList.addOrReplaceApp(
        appId,
        f.getParent().replace('\\', '/'),
        f.getName().replace('\\', '/'),
        dlg.appPanel.argumentsField.getText());
    mt.setApp(appId);
    /*appList.setFindPath(appId, chooser.getSelectedFile().getParent().replace('\\','/'));
    appList.setExec(appId, chooser.getSelectedFile().getName().replace('\\','/'));*/
    CurrentStorage.get().storeMimeTypesList();
    return true;
}
 
开发者ID:cst316,项目名称:spring16project-Modula-2,代码行数:44,代码来源:ResourcesPanel.java

示例9: checkApp

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
boolean checkApp(MimeType mt) {
	String appId = mt.getAppId();
	AppList appList = MimeTypesList.getAppList();
	File d;
	if (appId == null) {
		appId = Util.generateId();
		d = new File("/");
	} else {
		File exe = new File(appList.getFindPath(appId) + "/" + appList.getExec(appId));
		if (exe.isFile()) {
			return true;
		}
		d = new File(exe.getParent());
		while (!d.exists()) {
			d = new File(d.getParent());
		}
	}
	SetAppDialog dlg = new SetAppDialog(App.getFrame(), Local.getString(
			Local.getString("Select the application to open files of type") + " '" + mt.getLabel() + "'"));
	Dimension dlgSize = new Dimension(420, 300);
	dlg.setSize(dlgSize);
	Dimension frmSize = App.getFrame().getSize();
	Point loc = App.getFrame().getLocation();
	dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
	dlg.setDirectory(d);
	dlg.appPanel.argumentsField.setText("$1");
	dlg.setVisible(true);
	if (dlg.CANCELLED) {
		return false;
	}
	File f = new File(dlg.appPanel.applicationField.getText());

	appList.addOrReplaceApp(appId, f.getParent().replace('\\', '/'), f.getName().replace('\\', '/'),
			dlg.appPanel.argumentsField.getText());
	mt.setApp(appId);
	/*
	 * appList.setFindPath(appId,
	 * chooser.getSelectedFile().getParent().replace('\\','/'));
	 * appList.setExec(appId,
	 * chooser.getSelectedFile().getName().replace('\\','/'));
	 */
	CurrentStorage.get().storeMimeTypesList();
	return true;
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:45,代码来源:ResourcesPanel.java

示例10: editB_actionPerformed

import net.sf.memoranda.util.AppList; //导入依赖的package包/类
void editB_actionPerformed(ActionEvent e) {
	EditTypeDialog dlg = new EditTypeDialog(App.getFrame(), Local.getString("Edit resource type"));
	Dimension dlgSize = new Dimension(420, 450);
	dlg.setSize(dlgSize);
	Dimension frmSize = App.getFrame().getSize();
	Point loc = App.getFrame().getLocation();
	dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
	MimeType mt = (MimeType) typesList.getSelectedValue();
	String[] exts = mt.getExtensions();
	String extss = "";
	for (int i = 0; i < exts.length; i++) {
		extss += exts[i] + " ";
	}
	dlg.extField.setText(extss);
	dlg.descField.setText(mt.getLabel());
	dlg.iconLabel.setIcon(mt.getIcon());
	AppList appList = MimeTypesList.getAppList();
	dlg.appPanel.applicationField
			.setText(appList.getFindPath(mt.getAppId()) + "/" + appList.getExec(mt.getAppId()));
	dlg.appPanel.argumentsField.setText(appList.getCommandLinePattern(mt.getAppId()));
	dlg.setVisible(true);
	if (dlg.CANCELLED) {
		return;
	}
	String typeId = mt.getMimeTypeId();
	MimeTypesList.removeMimeType(typeId);
	mt = MimeTypesList.addMimeType(typeId);
	exts = dlg.extField.getText().trim().split(" ");
	for (int i = 0; i < exts.length; i++) {
		mt.addExtension(exts[i]);
	}
	mt.setLabel(dlg.descField.getText());
	if (dlg.appPanel.applicationField.getText().length() > 0) {
		File f = new File(dlg.appPanel.applicationField.getText());
		String appId = Util.generateId();
		appList.addApp(appId, f.getParent().replace('\\', '/'), f.getName().replace('\\', '/'),
				dlg.appPanel.argumentsField.getText());
		mt.setApp(appId);
	}
	if (dlg.iconPath.length() > 0) {
		mt.setIconPath(dlg.iconPath);
	}
	CurrentStorage.get().storeMimeTypesList();
	this.initTypesList();
	typesList.setSelectedValue(mt, true);

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


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