• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ISaveablePart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getAdapter

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(final Class<T> adapter)
{
    if (adapter == ISaveablePart.class)
        return (T)clean_saveable;
    return null;
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:9,代码来源:DataBrowserPropertySheetPage.java


示例2: propertyChange

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
	getSite().getWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() {
		public void run() {
			isDirty = true;
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:DataAdapterEditorPart.java


示例3: doSave

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@Override
public void doSave(IProgressMonitor monitor) {
	isRefresh = true;
	String xml = null;
	if (activePage == 0) {
		xml = model2xml();
	} else if (activePage == 1) {
		xml2model();
	}
	doSaveParticipate(monitor);
	xmlEditor.doSave(monitor);

	if (xml != null) {
		try {
			IFile f = getCurrentFile();
			if (f != null)
				f.setContents(new ByteArrayInputStream(xml.getBytes("UTF-8")), IFile.KEEP_HISTORY | IFile.FORCE, monitor);
		} catch (Throwable e) {
			UIUtils.showError(e);
		}
	}
	Display.getDefault().asyncExec(new Runnable() {
		public void run() {
			isRefresh = false;
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});
	xmlFresh = true;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:AMultiEditor.java


示例4: propertyChange

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
	getSite().getWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() {
		public void run() {
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:AMultiEditor.java


示例5: finishSave

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
protected void finishSave(IFile resource) {
	String resourceAbsolutePath = resource.getRawLocation().toOSString();
	if (DefaultManager.INSTANCE.isCurrentDefault(resourceAbsolutePath)) {
		DefaultManager.INSTANCE.reloadCurrentDefault();
	}
	Display.getDefault().asyncExec(new Runnable() {
		public void run() {
			isRefresh = false;
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:JrxmlEditor.java


示例6: handlePropertyChange

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@Override
protected void handlePropertyChange(int propertyId) {
	if (!isRefresh) {
		if (propertyId == ISaveablePart.PROP_DIRTY && previewEditor != null)
			previewEditor.setDirty(true);
		super.handlePropertyChange(propertyId);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:JrxmlEditor.java


示例7: dirtyStateChanged

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@Override
public void dirtyStateChanged() {
	WidgetUtils.runInDisplayThread(ChartEditor.this.getSite().getShell(), new Runnable() {
		@Override
		public void run() {
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:ChartEditor.java


示例8: setInput

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * Required by IReusableEditor - change our editor to a new input.
 * Unconditionally remove the existing input if there is one, undoing listeners and providers.
 * If the given input is not null, set the editor to work on it. Finally, notify that the
 * dirty and input properties have changed.
 * @param input the new input which is to replace the existing input
 */
@Override
public void setInput(IEditorInput input) {
	unsetOldInput();
	if (input == null) {
		setPartName("<disposed>");
	} else {
		setNewInput(input);
	}
	setPageInputs(input);

	firePropertyChange(ISaveablePart.PROP_DIRTY);
	// following the instructions from the javadoc on IReusableEditor
	firePropertyChange(IWorkbenchPartConstants.PROP_INPUT);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:MultiPagePlanEditor.java


示例9: dirtyStateChanged

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * When the dirty state changes, fire a property-change event for the "dirty" property.
 */
@Override
public void dirtyStateChanged() {
	WidgetUtils.runInDisplayThread(MultiPagePlanEditor.this.getContainer(), new Runnable() {
		@Override
		public void run() {
			firePropertyChange(ISaveablePart.PROP_DIRTY);
		}
	});
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:13,代码来源:MultiPagePlanEditor.java


示例10: evaluate

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@Override
protected EvaluationResult evaluate(IEvaluationContext context) {

	IWorkbenchWindow window = InternalHandlerUtil.getActiveWorkbenchWindow(context);
	// no window? not active
	if (window == null)
		return EvaluationResult.FALSE;
	WorkbenchPage page = (WorkbenchPage) window.getActivePage();

	// no page? not active
	if (page == null)
		return EvaluationResult.FALSE;

	// get saveable part
	ISaveablePart saveablePart = getSaveablePart(context);
	if (saveablePart == null)
		return EvaluationResult.FALSE;

	if (saveablePart instanceof ISaveablesSource) {
		ISaveablesSource modelSource = (ISaveablesSource) saveablePart;
		if (SaveableHelper.needsSave(modelSource))
			return EvaluationResult.TRUE;
		return EvaluationResult.FALSE;
	}

	if (saveablePart != null && saveablePart.isDirty())
		return EvaluationResult.TRUE;

	return EvaluationResult.FALSE;
}
 
开发者ID:wangzw,项目名称:CppStyle,代码行数:31,代码来源:CppStyleHandler.java


示例11: run

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
@Override
public void run() {
    IPath ignoreThrownExceptionsPath = PyExceptionBreakPointManager.getInstance().ignoreCaughtExceptionsWhenThrownFrom
            .getIgnoreThrownExceptionsPath();
    File file = ignoreThrownExceptionsPath.toFile();
    IEditorPart openFile = EditorUtils.openFile(file);

    if (openFile instanceof ITextEditor) {
        final ITextEditor textEditor = (ITextEditor) openFile;
        IDocumentProvider documentProvider = textEditor.getDocumentProvider();
        final IEditorInput input = openFile.getEditorInput();
        if (documentProvider instanceof IStorageDocumentProvider) {
            IStorageDocumentProvider storageDocumentProvider = (IStorageDocumentProvider) documentProvider;

            // Make sure the file is seen as UTF-8.
            storageDocumentProvider.setEncoding(input, "utf-8");
            textEditor.doRevertToSaved();
        }
        if (textEditor instanceof ISaveablePart) {
            IPropertyListener listener = new IPropertyListener() {

                @Override
                public void propertyChanged(Object source, int propId) {
                    if (propId == IWorkbenchPartConstants.PROP_DIRTY) {
                        if (source == textEditor) {
                            if (textEditor.getEditorInput() == input) {
                                if (!textEditor.isDirty()) {
                                    PyExceptionBreakPointManager.getInstance().ignoreCaughtExceptionsWhenThrownFrom
                                            .updateIgnoreThrownExceptions();
                                }
                            }
                        }
                    }
                }
            };
            textEditor.addPropertyListener(listener);

        }
    }

    //        Code to provide a dialog to edit it (decided on opening the file instead).
    //        Collection<IgnoredExceptionInfo> ignoreThrownExceptionsForEdition = PyExceptionBreakPointManager.getInstance()
    //                .getIgnoreThrownExceptionsForEdition();
    //        HashMap<String, String> map = new HashMap<>();
    //        for (IgnoredExceptionInfo ignoredExceptionInfo : ignoreThrownExceptionsForEdition) {
    //            map.put(ignoredExceptionInfo.filename + ": " + ignoredExceptionInfo.line, ignoredExceptionInfo.contents);
    //        }
    //
    //        EditIgnoredCaughtExceptionsDialog dialog = new EditIgnoredCaughtExceptionsDialog(EditorUtils.getShell(), map);
    //        int open = dialog.open();
    //        if (open == dialog.OK) {
    //            Map<String, String> result = dialog.getResult();
    //
    //        } else {
    //            System.out.println("Cancel");
    //        }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:58,代码来源:EditIgnoredCaughtExceptions.java


示例12: ScriptDocumentProvider

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * Creates a new script's document provider with the specified saveable
 * part.
 * 
 * @param part
 *            the saveable part.
 */
public ScriptDocumentProvider( ISaveablePart part )
{
	super( part );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:ScriptDocumentProvider.java


示例13: JSDocumentProvider

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * Creates a new javascript's document provider with the specified saveable
 * part.
 * 
 * @param part
 *            the saveable part.
 */
public JSDocumentProvider( ISaveablePart part )
{
	super( part );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:JSDocumentProvider.java


示例14: StorageDocumentProvider

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * Creates a new document provider with the specified saveable part.
 * 
 * @param part
 *            the saveable part.
 */
public StorageDocumentProvider( ISaveablePart part )
{
	super( part );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:StorageDocumentProvider.java


示例15: DocumentProvider

import org.eclipse.ui.ISaveablePart; //导入依赖的package包/类
/**
 * Creates a new document provider with the specified saveable part.
 * 
 * @param part
 *            the saveable part.
 */
public DocumentProvider( ISaveablePart part )
{
	super( );
	this.part = part;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:DocumentProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SecurityContextHolder类代码示例发布时间:2022-05-22
下一篇:
Java HRegionInterface类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap