本文整理汇总了Java中net.sf.memoranda.util.MimeTypesList.removeMimeType方法的典型用法代码示例。如果您正苦于以下问题:Java MimeTypesList.removeMimeType方法的具体用法?Java MimeTypesList.removeMimeType怎么用?Java MimeTypesList.removeMimeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.util.MimeTypesList
的用法示例。
在下文中一共展示了MimeTypesList.removeMimeType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的package包/类
void deleteB_actionPerformed(ActionEvent e) {
MimeType mt = (MimeType) typesList.getSelectedValue();
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("Delete resource type")
+ "\n'"
+ mt.getLabel()
+ "'\n"
+ Local.getString("Are you sure?"),
Local.getString("Delete resource type"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
MimeTypesList.removeMimeType(mt.getMimeTypeId());
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
}
示例2: deleteB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的package包/类
/**
* Delete a resource type and update the list.
* @param e
*/
void deleteB_actionPerformed(ActionEvent e) {
MimeType mt = (MimeType) typesList.getSelectedValue();
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("Delete resource type")
+ "\n'"
+ mt.getLabel()
+ "'\n"
+ Local.getString("Are you sure?"),
Local.getString("Delete resource type"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
MimeTypesList.removeMimeType(mt.getMimeTypeId());
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
}
示例3: deleteB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的package包/类
void deleteB_actionPerformed(ActionEvent e) {
MimeType mt = (MimeType) typesList.getSelectedValue();
int n = JOptionPane.showConfirmDialog(App.getFrame(),
Local.getString("Delete resource type") + "\n'" + mt.getLabel() + "'\n"
+ Local.getString("Are you sure?"),
Local.getString("Delete resource type"), JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
return;
}
MimeTypesList.removeMimeType(mt.getMimeTypeId());
CurrentStorage.get().storeMimeTypesList();
this.initTypesList();
}
示例4: editB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的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);
}
示例5: editB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的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);
}
示例6: editB_actionPerformed
import net.sf.memoranda.util.MimeTypesList; //导入方法依赖的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);
}