本文整理汇总了Java中org.eclipse.jface.text.templates.persistence.TemplatePersistenceData.setDeleted方法的典型用法代码示例。如果您正苦于以下问题:Java TemplatePersistenceData.setDeleted方法的具体用法?Java TemplatePersistenceData.setDeleted怎么用?Java TemplatePersistenceData.setDeleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.templates.persistence.TemplatePersistenceData
的用法示例。
在下文中一共展示了TemplatePersistenceData.setDeleted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData; //导入方法依赖的package包/类
public void load() throws IOException {
if (fProjectStore != null) {
fProjectStore.load();
Set<String> datas= new HashSet<String>();
TemplatePersistenceData[] data= fProjectStore.getTemplateData(false);
for (int i= 0; i < data.length; i++) {
datas.add(data[i].getId());
}
data= fInstanceStore.getTemplateData(false);
for (int i= 0; i < data.length; i++) {
TemplatePersistenceData orig= data[i];
if (!datas.contains(orig.getId())) {
TemplatePersistenceData copy= new TemplatePersistenceData(new Template(orig.getTemplate()), orig.isEnabled(), orig.getId());
fProjectStore.add(copy);
copy.setDeleted(true);
}
}
}
}
示例2: addTemplatesFromFile
import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData; //导入方法依赖的package包/类
/**
* Contribute templates defined in file with the give URL.
*
* @param templates
* the URL of the file with templates
*/
private void addTemplatesFromFile(final URL templates) {
if (templates != null) {
TemplateReaderWriter reader = new TemplateReaderWriter();
try {
InputStream openStream = templates.openStream();
try {
TemplatePersistenceData[] datas = reader.read(openStream, null);
int templateCounter = 0;
for (TemplatePersistenceData data : datas) {
if (data.getId() == null) {
templateCounter++;
TemplatePersistenceData dataWithGenId = new TemplatePersistenceData(data.getTemplate(), data.isEnabled(), templates.getPath() + "." //$NON-NLS-1$
+ templateCounter);
dataWithGenId.setDeleted(data.isDeleted());
internalAdd(dataWithGenId);
} else {
// if contributed template has an id
internalAdd(data);
}
}
} finally {
openStream.close();
}
} catch (IOException e) {
LOG.error(e);
}
}
}
示例3: setProjectSpecific
import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData; //导入方法依赖的package包/类
public void setProjectSpecific(String id, boolean projectSpecific) {
Assert.isNotNull(fProjectStore);
TemplatePersistenceData data= fProjectStore.getTemplateData(id);
if (data == null) {
return; // does not exist
} else {
data.setDeleted(!projectSpecific);
}
}