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


Java Persist类代码示例

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


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

示例1: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save(MDirtyable dirty,
		@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
	String absolutePath = this.fileInput.getFile().getAbsolutePath();
	logger.debug("Saving " + absolutePath);

	try {
		fileInput.save(this.text.getText());
		
		// save was successful
		dirty.setDirty(false);
	} catch (IOException e) {
		logger.error(e);
		MessageDialog.openError(shell, "Save error", e.getMessage());
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:17,代码来源:FileEditorPart.java

示例2: saveText

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public boolean saveText() {
	if (dirty.isDirty()) {
		if (corpusObject instanceof BTSText)
		{
			textEditorController.save((BTSText) corpusObject);
		}
		else if (corpusObject instanceof BTSLemmaEntry)
		{
			lemmaEditorController.save((BTSLemmaEntry) corpusObject);
		}
			
		localCommandCacheSet.clear();

		dirty.setDirty(false);
	}
	return true;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:19,代码来源:EgyHieroglyphenTypeWriter.java

示例3: saveChanges

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
void saveChanges() {
	try {
		item.saveTitleText(getTitleText(), getContentText());
		isSending = true;
		eventBroker.post(
		        RelationsConstants.TOPIC_FROM_BROWSER_MANAGER_SYNC_CONTENT,
		        item);
		isSending = false;

		clearDirty();
		dirty.setDirty(false);
	}
	catch (final BOMException exc) {
		log.error(exc, exc.getMessage());
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:18,代码来源:InspectorView.java

示例4: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save(MDirtyable dirty, ResourceService resourceService,
		@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		EPipeline pipeline) {
	// save changes via ITodoService for example
	try {
		resourceService.savePipeline(pipeline);
		
		// save was successful
		dirty.setDirty(false);
	} catch (IOException e) {
		MessageDialog.openError(shell, "Save error", e.getMessage());
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:15,代码来源:PipelinePart.java

示例5: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save(MDirtyable dirty)
{
	manageDirtyObjects(selectedProject, null);
	boolean internalDirty = dirty != null ? dirty.isDirty() : true;
	if (!dirtyUsers.isEmpty())
	{
		if (!userManagerController.saveUsers(dirtyUsers))
		{
			internalDirty = true;
		} else
		{
			dirtyUsers.clear();
		}
	}
	if (!dirtyUserGroups.isEmpty())
	{
		if (!userManagerController.saveUserGroups(dirtyUserGroups))
		{
			internalDirty = true;
		} else
		{
			dirtyUserGroups.clear();
		}
	}
	if (!dirtyProjects.isEmpty())
	{
		if (!projectController.saveProjects(dirtyProjects))
		{
			internalDirty = true;
		} else
		{
			dirtyProjects.clear();
		}
	}
	if (dirty != null)
	{
		dirty.setDirty(internalDirty);
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:41,代码来源:UserManagementPart.java

示例6: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public boolean save() {
	if (dirty != null && dirty.isDirty() &&
		permissionsController.userMayEditObject(
				permissionsController.getAuthenticatedUser(), corpusObject)) {

		boolean success = passportEditorController.save(corpusObject);
		dirty.setDirty(!success);
		if (success) {
			localCommandCacheSet.clear();
		}
		return success;
	}
	return false;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:16,代码来源:PassportEditorPart.java

示例7: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public boolean save() {
	if (!userMayEdit) return false;
	
	if (dirty.isDirty() && corpusObject instanceof BTSText) {
		if (currentWord != null)
			saveWordData(currentWord);
		textEditorController.save((BTSText) corpusObject);
	}
	dirty.setDirty(false);
	return true;

}
 
开发者ID:cplutte,项目名称:bts,代码行数:14,代码来源:EgyLemmatizerPart.java

示例8: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
/**
 * Save.
 *
 * @return true, if successful
 */
@Persist
public boolean save() {
	if (text != null && dirty != null && dirty.isDirty() && 
		permissionsController.userMayEditObject(
				permissionsController.getAuthenticatedUser(), this.text)) {
		boolean canSave = true;
		switch (tabFolder.getSelectionIndex()) {
		case 0: {
			canSave = updateModelFromTranscription();
			break;
		}
		case 1: {
			break;
		}
		case 2: {
			break;
		}
		}
		if (!canSave)
		{
			return false;
		}
		localCommandCacheSet.clear();

		// turn word-wise graphical update on model change notifications off 
		signTextEditor.setNotifyWords(false);
		sentenceTranslate_Editor.save();
		boolean success = textEditorController.save(this.text);
		
		dirty.setDirty(!success);
		// turn word-wise update back on
		signTextEditor.setNotifyWords(true);
		return success;
	}
	return false;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:42,代码来源:EgyTextEditorPart.java

示例9: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
	public boolean save() {
		if (selectedLemmaEntry != null)
		{
			// update lemma words because loading lemma words into textcontent leads to the removel of lemma words form lemma
			// due to containment of words
//			updateModelFromTranscription();
			if (textContent != null && !textContent.getTextItems().isEmpty())
			{
				List<BTSSentenceItem> items = new Vector<BTSSentenceItem>();
				for (BTSTextItems sen : textContent.getTextItems())
				{
					if (sen instanceof BTSSenctence)
					{
						items.addAll(((BTSSenctence) sen).getSentenceItems());
						
					}
				}
				selectedLemmaEntry.getWords().clear();
				for (BTSSentenceItem item : items)
				{
					if (item instanceof BTSWord)
					{
						selectedLemmaEntry.getWords().add((BTSWord) item);
					}
				}
				textContent.getTextItems().clear();
			}
			// if dirty, persist
			if (dirty != null && dirty.isDirty())
			{
				lemmaTranslate_Editor.save();
				boolean success = lemmaEditorController.save(this.selectedLemmaEntry);
				logger.debug("Save LemmaEntry successful: " + success);
				dirty.setDirty(!success);
				return success;
			}
		}
		return true;
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:41,代码来源:EgyLemmaEditorPart.java

示例10: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save(final MPart mpart) {
	if (orderDetailPanel.mandatoryFieldsNonEmpty()) {
		Order editedOrder = orderDetailPanel.getOrderForUpdate();
		order = orderService.saveOrder(editedOrder);
		orderDetailPanel.setOrder(order);
		// save the content of the view
		dirtyable.setDirty(false);
	}
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:11,代码来源:OrderDetailsPart.java

示例11: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
	this.person.setFirstName(this.activePerson.getFirstName());
	this.person.setLastName(this.activePerson.getLastName());
	this.person.setMarried(this.activePerson.isMarried());
	this.person.setGender(this.activePerson.getGender());

	dirtyable.setDirty(false);
}
 
开发者ID:fipro78,项目名称:e4-cookbook-migration-guide,代码行数:10,代码来源:PersonEditor.java

示例12: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
	dirty.setDirty(false);
}
 
开发者ID:thibaultleouay,项目名称:E4WebSocketChat,代码行数:5,代码来源:SamplePart.java

示例13: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
	// TODO Your code here
}
 
开发者ID:cplutte,项目名称:bts,代码行数:5,代码来源:ComparePart.java

示例14: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
	//TODO Your code here
}
 
开发者ID:cplutte,项目名称:bts,代码行数:5,代码来源:AbstractComparePart.java

示例15: save

import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public boolean save() {
	return false;
	//TODO Your code here
}
 
开发者ID:cplutte,项目名称:bts,代码行数:6,代码来源:CompareViewerGeneralImpl.java


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