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


Java MDirtyable类代码示例

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


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

示例1: save

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的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: save

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的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

示例3: save

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的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

示例4: setAlternative

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
protected void setAlternative(final IEditorInputResource alternative){
			
	if(this.alternative == alternative){
		this.alternative.load();
		return;
	}
			
	if(this.alternative != null){
		this.alternative.removePropertyChangeListener(alternativeListener);
		if(this.alternative.isDirty()){
			boolean keep = DialogUtils.openQuestion("Save changes?", "Alternative has unsaved changes. Do you want to keep them?");
			if(keep){
				this.alternative.save();
			}
			else{
				this.alternative.load();
			}
		}
	}
	
	alternative.load();
	
	part.getContext().set(IProject.class, alternative.getProject());
	part.getContext().set(IResource.class, alternative.getResource());
	part.getContext().set(IEditorInputResource.class, alternative);
	part.getContext().set(IValidationStatusProvider.class, alternative);
	part.getContext().set(MDirtyable.class, dirtyable);

	this.alternative = alternative;
	this.alternative.addPropertyChangeListener(alternativeListener);
	setControl(createComposite(parentComposite, alternative));
			
	focus();
	
	dirtyable.setDirty(alternative.isDirty());		
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:37,代码来源:AlternativeEditor.java

示例5: canExecute

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
@CanExecute
public boolean canExecute(
		@Named(IServiceConstants.ACTIVE_PART) MDirtyable dirtyable) {
	
	if (dirtyable == null) {
		return false;
	}
	
	return dirtyable.isDirty();
}
 
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:11,代码来源:SaveHandler.java

示例6: canExecute

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
@CanExecute
public boolean canExecute(
		@Named(IServiceConstants.ACTIVE_PART) MDirtyable dirtyable) {
	if (dirtyable == null) {
		return false;
	}
	return dirtyable.isDirty();
}
 
开发者ID:CrowdsourcingGeek,项目名称:CrowdBenchmark,代码行数:9,代码来源:SaveHandler.java

示例7: caseDirtyable

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
@Override
public Adapter caseDirtyable(MDirtyable object) {
	return createDirtyableAdapter();
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:5,代码来源:ExtensionsAdapterFactory.java

示例8: canExecute

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
@CanExecute
boolean canExecute(
		@Named(IServiceConstants.ACTIVE_PART) final MDirtyable inDirtyable) {
	return inDirtyable == null ? false : inDirtyable.isDirty();
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:6,代码来源:InspectorSaveHandler.java

示例9: caseDirtyable

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
/**
 * Returns the result of interpreting the object as an instance of '<em>Dirtyable</em>'.
 * <!-- begin-user-doc -->
 * This implementation returns null;
 * returning a non-null result will terminate the switch.
 * <!-- end-user-doc -->
 * @param object the target of the switch.
 * @return the result of interpreting the object as an instance of '<em>Dirtyable</em>'.
 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
 * @generated
 */
public T caseDirtyable(MDirtyable object) {
	return null;
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:15,代码来源:ExtensionsSwitch.java

示例10: save

import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
/**
 * Calls on the encapsulated editor to save its changes.
 * 
 * @param dirty			The editor's dirty state.
 * 
 * @throws IOException
 */
@Persist
public void save(MDirtyable dirty) throws IOException{
	projectDataEditor.saveChanges();
}
 
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:12,代码来源:ProjectDataEditorContainer.java


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