Java 类org.eclipse.ui.IPropertyListener 实例源码

项目:convertigo-eclipse    文件:XslRuleEditor.java   
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());
        }
    }
}
项目:PDFReporter-Studio    文件:MultiPageToolbarEditorPart.java   
/**
 * 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);
}
项目:Runway-SDK    文件:ReferenceObservableValue.java   
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);
}
项目:convertigo-eclipse    文件:XMLSequenceEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:XMLSequenceStepEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:XMLTransactionEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:XMLTransactionStepEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:JscriptStepEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:JscriptStatementEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:JscriptTransactionEditor.java   
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);
    }
}
项目:convertigo-eclipse    文件:JscriptTreeFunctionEditor.java   
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);
    }
}
项目:tlaplus    文件:OpenModuleHandler.java   
/**
 * 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

            } 
        }
    });

}
项目:hssd    文件:HSSDEditor.java   
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;
    }
}
项目:mytourbook    文件:TourDatabase.java   
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);
    }
}
项目:translationstudio8    文件:XLIFFEditorImplWithNatTable.java   
public void addPropertyListener(IPropertyListener l) {
    if (tagStyleManager != null) {
        tagStyleManager.setTagStyle(TagStyle.curStyle);
        autoResize();
        refresh();
    }
    super.addPropertyListener(l);
}
项目:gef-gwt    文件:WorkbenchPart.java   
/**
 * 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);
        }
    }
}
项目:tmxeditor8    文件:XLIFFEditorImplWithNatTable.java   
public void addPropertyListener(IPropertyListener l) {
    if (tagStyleManager != null) {
        tagStyleManager.setTagStyle(TagStyle.curStyle);
        autoResize();
        refresh();
    }
    super.addPropertyListener(l);
}
项目:convertigo-eclipse    文件:MobileUIComponentTreeObject.java   
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() + "'!");
    }
}
项目:convertigo-eclipse    文件:MobileApplicationComponentTreeObject.java   
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() + "'!");
    }
}
项目:convertigo-eclipse    文件:MobilePageComponentTreeObject.java   
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() + "'!");
    }
}
项目:convertigo-eclipse    文件:XMLSequenceEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:XMLSequenceStepEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:XMLTransactionEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:XMLTransactionStepEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:JscriptStepEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:JscriptStatementEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:JscriptTransactionEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:JscriptTreeFunctionEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:convertigo-eclipse    文件:XslRuleEditor.java   
@Override
public void removePropertyListener(IPropertyListener l) {
    if (listenerList != null) {
        listenerList.remove(l);
    }
}
项目:Hydrograph    文件:HydrographJavaCompletionProcessor.java   
@Override
public void addPropertyListener(IPropertyListener listener) {
}
项目:Hydrograph    文件:HydrographJavaCompletionProcessor.java   
@Override
public void removePropertyListener(IPropertyListener listener) {
}
项目:eclemma    文件:ExecutionDataContent.java   
public ExecutionDataContent() {
  clear();
  listeners = new ArrayList<IPropertyListener>();
}
项目:eclemma    文件:ExecutionDataContent.java   
public void addPropertyListener(IPropertyListener listener) {
  if (!listeners.contains(listener)) {
    listeners.add(listener);
  }
}
项目:eclemma    文件:ExecutionDataContent.java   
public void removePropertyListener(IPropertyListener listener) {
  listeners.remove(listener);
}
项目:eclemma    文件:ExecutionDataContent.java   
private void fireChangedEvent() {
  for (final IPropertyListener l : listeners) {
    l.propertyChanged(this, 0);
  }
}
项目:subclipse    文件:SVNLocalCompareInput.java   
public void removePropertyListener(IPropertyListener listener) {
}
项目:subclipse    文件:SVNLocalBaseCompareInput.java   
public void removePropertyListener(IPropertyListener listener) {
}
项目:subclipse    文件:SVNLocalBranchTagCompareInput.java   
public void removePropertyListener(IPropertyListener listener) {
}
项目:subclipse    文件:SVNCompareRevisionsInput.java   
public void removePropertyListener(IPropertyListener listener) {
}
项目:subclipse    文件:SVNLocalCompareSummaryInput.java   
public void removePropertyListener(IPropertyListener listener) {
}