本文整理汇总了Java中org.eclipse.ui.IPropertyListener类的典型用法代码示例。如果您正苦于以下问题:Java IPropertyListener类的具体用法?Java IPropertyListener怎么用?Java IPropertyListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPropertyListener类属于org.eclipse.ui包,在下文中一共展示了IPropertyListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChanged
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void propertyChanged(Object source, int propId) {
// When a property from the xslEditor Changes, walk the list all the listeners and notify them.
Object listeners[] = listenerList.getListeners();
for (int i = 0; i < listeners.length; i++) {
IPropertyListener listener = (IPropertyListener) listeners[i];
listener.propertyChanged(this, propId);
}
if (propId == IEditorPart.PROP_DIRTY) {
if (!xmlEditor.isDirty()) {
// We changed from Dirty to non dirty ==> User has saved so,
// launch Convertigo engine
// "touch" the parent style sheet ==> Convertigo engine will
// recompile it
IPath path;
path = file.getRawLocation();
path = path.append("../../" + parentStyleSheetUrl);
File parentFile = path.toFile();
parentFile.setLastModified(System.currentTimeMillis());
}
}
}
示例2: addPage
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
/**
* Creates and adds a new page containing the given editor to this multi-page editor. The page is added at the given
* index. This also hooks a property change listener on the nested editor.
*
* @param index
* the index at which to add the page (0-based)
* @param editor
* the nested editor
* @param input
* the input for the nested editor
* @exception PartInitException
* if a new page could not be created
*
*/
public void addPage(int index, IEditorPart editor, IEditorInput input) throws PartInitException {
IEditorSite site = createSite(editor);
// call init first so that if an exception is thrown, we have created no
// new widgets
editor.init(site, input);
Composite parent2 = new Composite(getContainer(), getOrientation(editor));
parent2.setLayout(new FillLayout());
editor.createPartControl(parent2);
editor.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propertyId) {
MultiPageToolbarEditorPart.this.handlePropertyChange(propertyId);
}
});
// create item for page only after createPartControl has succeeded
Item item = createItem(index, parent2);
// remember the editor, as both data on the item, and in the list of
// editors (see field comment)
item.setData(editor);
nestedEditors.add(editor);
}
示例3: ReferenceObservableValue
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public ReferenceObservableValue(Realm realm, PopupWidget view)
{
super(realm);
this.view = view;
this.currentValue = view.getComponent();
listener = new IPropertyListener()
{
@Override
public void propertyChanged(Object value, int propId)
{
if (updating)
{
return;
}
notifyIfChanged(currentValue, currentValue = getCurrentValue());
}
};
this.view.addPropertyListener(listener);
}
示例4: propertyChanged
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void propertyChanged(Object source, int propId) {
// When a property from the xmlEditor Changes, walk the list all the listeners and notify them.
Object listeners[] = listenerList.getListeners();
for (int i = 0; i < listeners.length; i++) {
IPropertyListener listener = (IPropertyListener) listeners[i];
listener.propertyChanged(this, propId);
}
}
示例5: propertyChanged
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void propertyChanged(Object source, int propId) {
// When a property from the jsEditor Changes, walk the list all the listeners and notify them.
Object listeners[] = listenerList.getListeners();
for (int i = 0; i < listeners.length; i++) {
IPropertyListener listener = (IPropertyListener) listeners[i];
listener.propertyChanged(this, propId);
}
}
示例6: openModule
import org.eclipse.ui.IPropertyListener; //导入依赖的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
}
}
});
}
示例7: openEntryEditor
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
private EntryEditor openEntryEditor(TreeNode en) throws PartInitException {
final EditorInput input = new EditorInput(this, en);
final IWorkbenchPage activePage = Helper.getActiveWBPage();
IEditorPart editor = activePage.findEditor(input);
if(editor != null && editor instanceof IReusableEditor) {
editor.setFocus();
return (EntryEditor)editor;
}
else {
editor = activePage.openEditor(input, EntryEditor.ID);
final IEditorPart entryEditor = editor;
editor.addPropertyListener(new IPropertyListener() {
@Override
public void propertyChanged(Object source, int propId) {
if(propId == EntryEditor.PROP_DIRTY) {
if(entryEditor.isDirty()) {
markDirty();
}
firePropertyChange(PROP_DIRTY);
}
}
});
if(editor instanceof EntryEditor) {
((EntryEditor)editor).initExpand();
}
return (EntryEditor)editor;
}
}
示例8: firePropertyChange
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void firePropertyChange(final int propertyId) {
final Object[] allListeners = _propertyListeners.getListeners();
for (final Object allListener : allListeners) {
final IPropertyListener listener = (IPropertyListener) allListener;
listener.propertyChanged(TourDatabase.this, propertyId);
}
}
示例9: addPropertyListener
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void addPropertyListener(IPropertyListener l) {
if (tagStyleManager != null) {
tagStyleManager.setTagStyle(TagStyle.curStyle);
autoResize();
refresh();
}
super.addPropertyListener(l);
}
示例10: firePropertyChange
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
/**
* Fires a property changed event.
*
* @param propertyId
* the id of the property that changed
*/
protected void firePropertyChange(final int propertyId) {
Object[] array = getListeners();
for (int nX = 0; nX < array.length; nX++) {
final IPropertyListener l = (IPropertyListener) array[nX];
try {
l.propertyChanged(WorkbenchPart.this, propertyId);
} catch (RuntimeException e) {
WorkbenchPlugin.log(e);
}
}
}
示例11: editPageFunction
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
private void editPageFunction(final UIComponent uic, final String functionMarker, final String propertyName) {
final PageComponent page = uic.getPage();
try {
// Refresh project resources for editor
String projectName = page.getProject().getName();
IProject project = ConvertigoPlugin.getDefault().getProjectPluginResource(projectName);
project.refreshLocal(IResource.DEPTH_INFINITE, null);
// Close editor and Reopen it after file has been rewritten
String relativePath = page.getProject().getMobileBuilder().getFunctionTempTsRelativePath(page);
IFile file = project.getFile(relativePath);
closeComponentFileEditor(file);
page.getProject().getMobileBuilder().writeFunctionTempTsFile(page, functionMarker);
file.refreshLocal(IResource.DEPTH_ZERO, null);
// Open file in editor
if (file.exists()) {
IEditorInput input = new ComponentFileEditorInput(file, uic);
if (input != null) {
IEditorDescriptor desc = PlatformUI
.getWorkbench()
.getEditorRegistry()
.getDefaultEditor(file.getName());
IWorkbenchPage activePage = PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
String editorId = desc.getId();
IEditorPart editorPart = activePage.openEditor(input, editorId);
editorPart.addPropertyListener(new IPropertyListener() {
boolean isFirstChange = false;
@Override
public void propertyChanged(Object source, int propId) {
if (source instanceof ITextEditor) {
if (propId == IEditorPart.PROP_DIRTY) {
if (!isFirstChange) {
isFirstChange = true;
return;
}
isFirstChange = false;
ITextEditor editor = (ITextEditor)source;
IDocumentProvider dp = editor.getDocumentProvider();
IDocument doc = dp.getDocument(editor.getEditorInput());
String marker = MobileBuilder.getMarker(doc.get(), functionMarker);
String beginMarker = "/*Begin_c8o_" + functionMarker + "*/";
String endMarker = "/*End_c8o_" + functionMarker + "*/";
String content = marker.replace(beginMarker+ System.lineSeparator(), "")
.replace("\t\t"+endMarker, "") // for validator
.replace("\t"+endMarker, ""); // for action
FormatedContent formated = new FormatedContent(content);
MobileUIComponentTreeObject.this.setPropertyValue(propertyName, formated);
}
}
}
});
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to edit function for page '" + page.getName() + "'!");
}
}
示例12: editAppComponentTsFile
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void editAppComponentTsFile() {
final ApplicationComponent application = getObject();
try {
// Refresh project resource
String projectName = application.getProject().getName();
IProject project = ConvertigoPlugin.getDefault().getProjectPluginResource(projectName);
project.refreshLocal(IResource.DEPTH_INFINITE, null);
// Get filepath of application.component.ts file
String filePath = application.getProject().getMobileBuilder().getTempTsRelativePath(application);
IFile file = project.getFile(filePath);
file.refreshLocal(IResource.DEPTH_ZERO, null);
// Open file in editor
if (file.exists()) {
IEditorInput input = new ComponentFileEditorInput(file, application);
if (input != null) {
IEditorDescriptor desc = PlatformUI
.getWorkbench()
.getEditorRegistry()
.getDefaultEditor(file.getName());
IWorkbenchPage activePage = PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
String editorId = desc.getId();
IEditorPart editorPart = activePage.openEditor(input, editorId);
editorPart.addPropertyListener(new IPropertyListener() {
boolean isFirstChange = false;
@Override
public void propertyChanged(Object source, int propId) {
if (source instanceof ITextEditor) {
if (propId == IEditorPart.PROP_DIRTY) {
if (!isFirstChange) {
isFirstChange = true;
return;
}
isFirstChange = false;
ITextEditor editor = (ITextEditor)source;
IDocumentProvider dp = editor.getDocumentProvider();
IDocument doc = dp.getDocument(editor.getEditorInput());
FormatedContent componentScriptContent = new FormatedContent(MobileBuilder.getMarkers(doc.get()));
MobileApplicationComponentTreeObject.this.setPropertyValue("componentScriptContent", componentScriptContent);
}
}
}
});
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to open typescript file for page '" + application.getName() + "'!");
}
}
示例13: editPageTsFile
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
public void editPageTsFile() {
final PageComponent page = (PageComponent)getObject();
try {
// Refresh project resource
String projectName = page.getProject().getName();
IProject project = ConvertigoPlugin.getDefault().getProjectPluginResource(projectName);
project.refreshLocal(IResource.DEPTH_INFINITE, null);
// Get filepath of page's temporary TypeScript file
String filePath = page.getProject().getMobileBuilder().getTempTsRelativePath(page);
IFile file = project.getFile(filePath);
file.refreshLocal(IResource.DEPTH_ZERO, null);
// Open file in editor
if (file.exists()) {
IEditorInput input = new ComponentFileEditorInput(file, page);
if (input != null) {
IEditorDescriptor desc = PlatformUI
.getWorkbench()
.getEditorRegistry()
.getDefaultEditor(file.getName());
IWorkbenchPage activePage = PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
String editorId = desc.getId();
IEditorPart editorPart = activePage.openEditor(input, editorId);
editorPart.addPropertyListener(new IPropertyListener() {
boolean isFirstChange = false;
@Override
public void propertyChanged(Object source, int propId) {
if (source instanceof ITextEditor) {
if (propId == IEditorPart.PROP_DIRTY) {
if (!isFirstChange) {
isFirstChange = true;
return;
}
isFirstChange = false;
ITextEditor editor = (ITextEditor)source;
IDocumentProvider dp = editor.getDocumentProvider();
IDocument doc = dp.getDocument(editor.getEditorInput());
FormatedContent scriptContent = new FormatedContent(MobileBuilder.getMarkers(doc.get()));
MobilePageComponentTreeObject.this.setPropertyValue("scriptContent", scriptContent);
}
}
}
});
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to open typescript file for page '" + page.getName() + "'!");
}
}
示例14: removePropertyListener
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
@Override
public void removePropertyListener(IPropertyListener l) {
if (listenerList != null) {
listenerList.remove(l);
}
}
示例15: addPropertyListener
import org.eclipse.ui.IPropertyListener; //导入依赖的package包/类
@Override
public void addPropertyListener(IPropertyListener listener) {
}