本文整理汇总了Java中org.eclipse.ui.IWorkbenchPartConstants类的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchPartConstants类的具体用法?Java IWorkbenchPartConstants怎么用?Java IWorkbenchPartConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IWorkbenchPartConstants类属于org.eclipse.ui包,在下文中一共展示了IWorkbenchPartConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doSaveAs
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
public void doSaveAs( )
{
getActivePageInstance( ).doSaveAs( );
setInput( getActivePageInstance( ).getEditorInput( ) );
// update site name
IReportProvider provider = getProvider( );
if ( provider != null )
{
setPartName( provider.getInputPath( getEditorInput( ) )
.lastSegment( ) );
firePropertyChange( IWorkbenchPartConstants.PROP_PART_NAME );
getProvider( ).getReportModuleHandle( getEditorInput( ) )
.setFileName( getProvider( ).getInputPath( getEditorInput( ) )
.toOSString( ) );
}
updateRelatedViews( );
fireDesignFileChangeEvent( );
}
示例2: openModule
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
/**
* This was the body of the <code>execute</code>, but was pulled out so it could be
* used in other places to open a module.
*
* @param moduleName
*/
public static void openModule(String moduleName) {
if (moduleName == null)
{
throw new RuntimeException("Module was null" );
}
Spec spec = Activator.getSpecManager().getSpecLoaded();
final IFile module = ResourceHelper.getLinkedFile(spec.getProject(), ResourceHelper.getModuleFileName(moduleName));
if (module == null)
{
throw new RuntimeException("Module " + moduleName + " could not be found" );
}
// open the editor
IEditorPart part = UIHelper.openEditor(OpenSpecHandler.TLA_EDITOR, new FileEditorInput(module));
part.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId)
{
if (IWorkbenchPartConstants.PROP_DIRTY == propId)
{
// here the listeners to editor changes go into
}
}
});
}
示例3: propertyChanged
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
public void propertyChanged(Object source, int propId)
{
if (propId == IWorkbenchPartConstants.PROP_TITLE
&& lastActiveEditor != null)
{
String newTitle = lastActiveEditor.getTitle();
if (!lastEditorTitle.equals(newTitle))
{
recomputeTitle();
}
}
}
示例4: setInput
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
/**
* Sets the input to this editor.
*
* <p><b>Note:</b> Clients must fire the {@link IEditorPart#PROP_INPUT }
* property change within their implementation of
* <code>setInput()</code>.<p>
*
* @param input the editor input
*/
@Override
public void setInput(IEditorInput input) {
super.setInput(input);
if (treeViewer != null) {
PlanEditorModel model = PlanEditorModelRegistry.getPlanEditorModel(input);
treeViewer.setInput(model.getEPlan());
treeViewer.setEditorModel(model);
}
firePropertyChange(IWorkbenchPartConstants.PROP_INPUT);
}
示例5: setInput
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
@Override
public void setInput(IEditorInput input) {
super.setInput(input);
if (daysComposite != null) {
daysComposite.setInput(input);
}
firePropertyChange(IWorkbenchPartConstants.PROP_INPUT);
}
示例6: setInput
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的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);
}
示例7: internalSetContentDescription
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
void internalSetContentDescription(String description) {
Assert.isNotNull(description);
// Do not send changes if they are the same
// if (Util.equals(contentDescription, description)) {
// return;
// }
this.contentDescription = description;
firePropertyChange(IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION);
}
示例8: internalSetPartName
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
void internalSetPartName(String partName) {
// partName = Util.safeString(partName);
Assert.isNotNull(partName);
// Do not send changes if they are the same
// if (Util.equals(this.partName, partName)) {
// return;
// }
this.partName = partName;
firePropertyChange(IWorkbenchPartConstants.PROP_PART_NAME);
}
示例9: setAllInput
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
private void setAllInput( FileEditorInput input )
{
// This for a bug. When close editor, the resource listener fire to
// multi page editor, but all embedded pages disposed.
if ( pages == null )
{
return;
}
setInput( input );
if ( getEditorInput( ) != null )
{
setPartName( getEditorInput( ).getName( ) );
firePropertyChange( IWorkbenchPartConstants.PROP_PART_NAME );
firePropertyChange( IWorkbenchPartConstants.PROP_PART_NAME );
getProvider( ).getReportModuleHandle( getEditorInput( ) )
.setFileName( getProvider( ).getInputPath( getEditorInput( ) )
.toOSString( ) );
}
for ( Iterator it = pages.iterator( ); it.hasNext( ); )
{
Object page = it.next( );
if ( page instanceof IReportEditorPage )
{
( (IReportEditorPage) page ).setInput( input );
}
}
updateRelatedViews( );
}
示例10: propertyChanged
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
public void propertyChanged( Object source, int propId )
{
if ( propId == IWorkbenchPartConstants.PROP_PART_NAME )
{
setPartName( instance.getPartName( ) );
}
firePropertyChange( propId );
}
示例11: setDirty
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
protected void setDirty(boolean newValue) {
if (this.isDirty != newValue) {
this.isDirty = newValue;
firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY);
}
}
示例12: handlePropertyChangedEvent
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
private void handlePropertyChangedEvent( int propertyId ) {
if( propertyId == IWorkbenchPartConstants.PROP_INPUT ) {
updateContent();
}
}
示例13: refresh
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
/**
* @param property one of IWorkbenchPartConstants.PROP_ constants
*
*/
public void refresh(int property) {
switch (property) {
case IWorkbenchPartConstants.PROP_DIRTY:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:dirty");
}
setToolTipText(tabArea.getPresentation().getPartTooltip(part));
setPartText(null);
partIsDirty = part.isDirty();
tabArea.layoutTabs();
break;
case IWorkbenchPartConstants.PROP_TITLE:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed title");
}
setToolTipText(tabArea.getPresentation().getPartTooltip(part));
setPartText(null);
break;
case IWorkbenchPartConstants.PROP_PART_NAME:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed name");
}
setToolTipText(tabArea.getPresentation().getPartTooltip(part));
setPartText(null);
break;
case IWorkbenchPartConstants.PROP_INPUT:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed input");
}
setToolTipText(tabArea.getPresentation().getPartTooltip(part));
setPartText(null);
break;
case IWorkbenchPartConstants.PROP_PREFERRED_SIZE:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed pref_size");
}
break;
case IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed content descr");
}
break;
default:
if(PresentationPlugin.DEBUG_STATE) {
System.out.println("PartTab:changed?");
}
return;
}
if(!isHidden()) {
redraw();
}
}
示例14: propertyChanged
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
public void propertyChanged(Object source, int propId) {
if (propId == IWorkbenchPartConstants.PROP_TITLE) {
setDefaultContentDescription();
}
}
示例15: propertyChanged
import org.eclipse.ui.IWorkbenchPartConstants; //导入依赖的package包/类
public void propertyChanged(Object source, int propId) {
if (propId == IWorkbenchPartConstants.PROP_TITLE) {
setDefaultPartName();
}
}