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


Java AppList.addApp方法代码示例

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


在下文中一共展示了AppList.addApp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例7: 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.addApp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。