本文整理汇总了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());
}
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例12: save
import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
dirty.setDirty(false);
}
示例13: save
import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
// TODO Your code here
}
示例14: save
import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public void save() {
//TODO Your code here
}
示例15: save
import org.eclipse.e4.ui.di.Persist; //导入依赖的package包/类
@Persist
public boolean save() {
return false;
//TODO Your code here
}