本文整理汇总了Java中org.eclipse.core.internal.resources.ResourceStatus类的典型用法代码示例。如果您正苦于以下问题:Java ResourceStatus类的具体用法?Java ResourceStatus怎么用?Java ResourceStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceStatus类属于org.eclipse.core.internal.resources包,在下文中一共展示了ResourceStatus类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: alert
import org.eclipse.core.internal.resources.ResourceStatus; //导入依赖的package包/类
private void alert(String str) {
ErrorDialog msgDialog = new ErrorDialog(this.getShell(), "", str, new ResourceStatus(1, ""), 1);
msgDialog.create();
msgDialog.open();
}
示例2: configTableOnDoubleClick
import org.eclipse.core.internal.resources.ResourceStatus; //导入依赖的package包/类
/**
* 双击lTableTo,弹出配置表的对话框
*
* @param lTableTo
* @param lTableStatus
*/
private void configTableOnDoubleClick(List lTableTo, List lTableStatus) {
String currentTable = lTableTo.getItem(lTableTo.getFocusIndex());
File currentTableXmlFile = new File(RmXmlHelper.formatToFile(QbXmlGenerateCodePlugin.qbGenerateCodeHome + "/" + getLongTableXmlName(currentTable)));
if (connectDatabase()) {
try {
if (gcRule.getMTableDocs().get(currentTable) == null) { //如果内存中没有xml
gcRule.initTableDoc(currentTable, currentTableXmlFile, pdmParser, this);
//QbXmlGenerateCodePlugin.log("save file '" + currentTableXmlFile.getPath() + "', before dialog");
RmXmlHelper.saveXmlToPath((Document) gcRule.getMTableDocs().get(currentTable), currentTableXmlFile.getPath());
}
{ //弹出对话框,并等其点OK后,把值保存回去xml
ConfigTableDialog dialog = new ConfigTableDialog(this.getShell(), this, currentTable, gcRule);
dialog.create();
if (dialog.open() == ContainerSelectionDialog.OK) {
//QbXmlGenerateCodePlugin.log("save file '" + currentTableXmlFile.getPath() + "', after OK");
RmXmlHelper.saveXmlToPath((Document) gcRule.getMTableDocs().get(currentTable), currentTableXmlFile.getPath());
}
}
lTableStatus.setItem(lTableTo.getFocusIndex(), "finished");
{ //删除xml中的已选状态,回写tableTos/@xmlName
Node thisTableTo = getNodeFromXmlByText("/rules/database/tableTos/tableTo", currentTable, gcRule.getMainRule());
if (thisTableTo == null) {
Element thisTableTos = (Element) gcRule.getMainRule().selectSingleNode("/rules/database/tableTos");
Element thisTableToEle = thisTableTos.addElement("tableTo");
thisTableToEle.setText(currentTable);
thisTableToEle.addAttribute("xmlName", getLongTableXmlName(currentTable));
} else {
Node thisXmlName = thisTableTo.selectSingleNode("@xmlName");
thisXmlName.setText(getLongTableXmlName(currentTable));
}
}
} catch (Exception e) {
e.printStackTrace();
ErrorDialog msgDialog = new ErrorDialog(this.getShell(), "", "不能生成此表", new ResourceStatus(1, "\n从 " + currentTable + " 表生成xml定义文件时错误!\n\n" + e.toString()), 1);
msgDialog.create();
msgDialog.open();
}
}
}
示例3: validateFolderName
import org.eclipse.core.internal.resources.ResourceStatus; //导入依赖的package包/类
/**
* Checks if the folder name is valid.
*
* @return null if the new folder name is valid.
* a message that indicates the problem otherwise.
*/
@SuppressWarnings("restriction")
private boolean validateFolderName() {
String name = folderNameField.getText();
IWorkspace workspace = container.getWorkspace();
IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
if ("".equals(name)) { //$NON-NLS-1$
updateStatus(IStatus.ERROR,
IDEWorkbenchMessages.NewFolderDialog_folderNameEmpty);
return false;
}
if (nameStatus.isOK() == false) {
updateStatus(nameStatus);
return false;
}
// 修改创建文件夹时,所进行的文件名特殊字符验证 --robert 2013-07-01
String result = null;
if ((result = CommonFunction.validResourceName(name)) != null) {
updateStatus(new ResourceStatus(IResourceStatus.INVALID_VALUE, null, result));
return false;
}
IPath path = new Path(name);
if (container.getFolder(path).exists()
|| container.getFile(path).exists()) {
updateStatus(IStatus.ERROR, NLS.bind(
IDEWorkbenchMessages.NewFolderDialog_alreadyExists, name));
return false;
}
updateStatus(IStatus.OK, ""); //$NON-NLS-1$
return true;
}