org.eclipse.ui.IPropertyListener Java Examples

The following examples show how to use org.eclipse.ui.IPropertyListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CTabFolderStackPresentation.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/** 
 * {@inheritDoc}
 */
@Override
public void addPart(final IPresentablePart newPart, Object cookie)
{
    ignoreSelection = true;
    final CTabItem item = new CTabItem(tabFolder,SWT.NONE);
    ignoreSelection = false;
    item.setData(DATAKEY_PART,newPart);
    
    updateItem(newPart);
    
    newPart.addPropertyListener(new IPropertyListener()
    {        
        public void propertyChanged(Object source, int propId)
        {
            updateItem(newPart);
        }        
    });
}
 
Example #2
Source File: ExpandBarStandaloneStackPresentation.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/** 
 * {@inheritDoc}
 */
@Override
public void addPart(final IPresentablePart newPart, Object cookie)
{ 
    updateItem(newPart);
    
    newPart.addPropertyListener(new IPropertyListener()
    {        
        public void propertyChanged(Object source, int propId)
        {
            updateItem(newPart);
        }        
    });
    
    resizeSelectedPart();
}
 
Example #3
Source File: PGroupStackPresentation.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/** 
 * {@inheritDoc}
 */
@Override
public void addPart(final IPresentablePart newPart, Object cookie)
{ 
    updateItem(newPart);
    
    newPart.addPropertyListener(new IPropertyListener()
    {        
        public void propertyChanged(Object source, int propId)
        {
            updateItem(newPart);
        }        
    });
    
    resizeSelectedPart();
}
 
Example #4
Source File: XLIFFEditorImplWithNatTable.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void addPropertyListener(IPropertyListener l) {
	if (tagStyleManager != null) {
		tagStyleManager.setTagStyle(TagStyle.curStyle);
		autoResize();
		refresh();
	}
	super.addPropertyListener(l);
}
 
Example #5
Source File: ConditionPage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void createTypeSpecificEditors(Composite parent) {
	try {
		IJavaBreakpoint breakpoint = getBreakpoint();
		IMarker marker = breakpoint.getMarker();
		Object sourceUri = marker.getAttribute(StratumBreakpointAdapterFactory.ORG_ECLIPSE_XTEXT_XBASE_SOURCE_URI);
		if (sourceUri != null) {
			setTitle("Condition");
			final JavaBreakpointConditionEditor editor = new JavaBreakpointConditionEditor();
			editor.createControl(parent);
			editor.addPropertyListener(new IPropertyListener() {
				@Override
				public void propertyChanged(Object source, int propId) {
					IStatus status = editor.getStatus();
					if (status.isOK()) {
						if (fPrevMessage != null) {
							removeErrorMessage(fPrevMessage);
							fPrevMessage = null;
						}
					} else {
						fPrevMessage = status.getMessage();
						addErrorMessage(fPrevMessage);
					}
				}
			});
			URI uri = URI.createURI(String.valueOf(sourceUri));
			JavaBreakPointProvider breakPointProvider = registry.getResourceServiceProvider(uri).get(JavaBreakPointProvider.class);
			editor.setInput(breakPointProvider.getBreakpointWithJavaLocation((IJavaStratumLineBreakpoint) breakpoint));
			// set this editor only if it was correctly initialized
			this.editor = editor;
		}
	} catch (CoreException e) {
		setErrorMessage(e.getMessage());
	} 
}
 
Example #6
Source File: OpenModuleHandler.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * 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
                
            } 
        }
    });

}
 
Example #7
Source File: XLIFFEditorImplWithNatTable.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public void addPropertyListener(IPropertyListener l) {
	if (tagStyleManager != null) {
		tagStyleManager.setTagStyle(TagStyle.curStyle);
		autoResize();
		refresh();
	}
	super.addPropertyListener(l);
}
 
Example #8
Source File: PShelfStackPresentation.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
/** 
 * {@inheritDoc}
 */
@Override
public void addPart(final IPresentablePart newPart, Object cookie)
{
    ignoreSelection = true;
    final PShelfItem item = new PShelfItem(shelf,SWT.NONE);
    ignoreSelection = false;
    item.setData(DATAKEY_PART,newPart);
    
    item.getBody().setLayout(null);        
    item.getBody().addListener(SWT.Paint, new Listener()
    {        
        public void handleEvent(Event e)
        {
            Integer separatorY = (Integer)item.getBody().getData(DATAKEY_SEPHEIGHT);
            if (separatorY == null) return;
            e.gc.setForeground(border);
            e.gc.drawLine(0,separatorY.intValue(),item.getBody().getSize().x,separatorY.intValue());
        }        
    });
    
    CLabel descLabel = new CLabel(item.getBody(),SWT.WRAP);
    item.setData(DATAKEY_DESCLABEL,descLabel);
    
    descLabel.setBackground(toolbarBackground);
    
    ToolBar tb = new ToolBar(item.getBody(),SWT.NONE);
    item.setData(DATAKEY_MENUTOOL,tb);
    
    tb.setBackground(toolbarBackground);
    
    updateItem(newPart);
    
    newPart.addPropertyListener(new IPropertyListener()
    {        
        public void propertyChanged(Object source, int propId)
        {
            updateItem(newPart);
        }        
    });
}
 
Example #9
Source File: SVNLocalCompareSummaryInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
}
 
Example #10
Source File: EditIgnoredCaughtExceptions.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@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");
    //        }
}
 
Example #11
Source File: SVNCompareRevisionsInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
}
 
Example #12
Source File: SVNLocalBranchTagCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
}
 
Example #13
Source File: SVNLocalBaseCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
}
 
Example #14
Source File: SVNLocalCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
}
 
Example #15
Source File: FakeEditorPart.java    From bonita-studio with GNU General Public License v2.0 2 votes vote down vote up
@Override
public void addPropertyListener(IPropertyListener listener) {

}
 
Example #16
Source File: FakeEditorPart.java    From bonita-studio with GNU General Public License v2.0 2 votes vote down vote up
@Override
public void removePropertyListener(IPropertyListener listener) {

}
 
Example #17
Source File: HadoopPathPage.java    From hadoop-gpu with Apache License 2.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
  // TODO Auto-generated method stub

}
 
Example #18
Source File: HadoopPathPage.java    From hadoop-gpu with Apache License 2.0 2 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
  // TODO Auto-generated method stub

}
 
Example #19
Source File: HadoopPathPage.java    From RDFS with Apache License 2.0 2 votes vote down vote up
public void removePropertyListener(IPropertyListener listener) {
  // TODO Auto-generated method stub

}
 
Example #20
Source File: HadoopPathPage.java    From RDFS with Apache License 2.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
  // TODO Auto-generated method stub

}
 
Example #21
Source File: SVNLocalCompareSummaryInput.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
	
}
 
Example #22
Source File: SVNCompareRevisionsInput.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
	
}
 
Example #23
Source File: SVNLocalBranchTagCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
	
}
 
Example #24
Source File: SVNLocalBaseCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
	
}
 
Example #25
Source File: SVNLocalCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
public void addPropertyListener(IPropertyListener listener) {
	
}