本文整理汇总了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());
}
}
示例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());
}
}
示例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);
}
}
示例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());
}
示例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();
}
示例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();
}
示例7: caseDirtyable
import org.eclipse.e4.ui.model.application.ui.MDirtyable; //导入依赖的package包/类
@Override
public Adapter caseDirtyable(MDirtyable object) {
return createDirtyableAdapter();
}
示例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();
}
示例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;
}
示例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();
}