CloneSet707


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
46230.993class_body
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14634
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaSourcePreviewerUpdater.java
24691
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PropertiesFileEditorPreferencePage.java
Clone Instance
1
Line Count
46
Source Line
34
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaSourcePreviewerUpdater.java

                                 {

        /**
         * Creates a Java source preview updater for the given viewer, configuration and preference store.
         *
         * @param viewer the viewer
         * @param configuration the configuration
         * @param preferenceStore the preference store
         */
        JavaSourcePreviewerUpdater( final SourceViewer viewer, final JavaSourceViewerConfiguration configuration, final IPreferenceStore preferenceStore) {
                Assert.isNotNull(viewer);
                Assert.isNotNull(configuration);
                Assert.isNotNull(preferenceStore);
                final IPropertyChangeListener fontChangeListener = new IPropertyChangeListener() {
                         /*
                          * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                          */
                         public void propertyChange(PropertyChangeEvent event) {
                                 if (event.getProperty().equals(PreferenceConstants.EDITOR_TEXT_FONT)) {
                                         Font font = JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
                                         viewer.getTextWidget().setFont(font);
                                 }
                         }
                                                                   };
                final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
                         /*
                          * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                          */
                         public void propertyChange(PropertyChangeEvent event) {
                                 if (configuration.affectsTextPresentation(event)) {
                                         configuration.handlePropertyChangeEvent(event);
                                         viewer.invalidateTextPresentation();
                                 }
                         }
                                                                       };
                viewer.getTextWidget().addDisposeListener(new DisposeListener() {
                        /*
                         * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
                         */
                        public void widgetDisposed(DisposeEvent e) {
                                preferenceStore.removePropertyChangeListener(propertyChangeListener);
                                JFaceResources.getFontRegistry().removeListener(fontChangeListener);
                        }
                                                          } );
                JFaceResources.getFontRegistry().addListener(fontChangeListener);
                preferenceStore.addPropertyChangeListener(propertyChangeListener);
        }
                                 }


Clone Instance
2
Line Count
46
Source Line
91
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PropertiesFileEditorPreferencePage.java

                                                    {

                /**
                 * Creates a Java source preview updater for the given viewer, configuration and preference store.
                 *
                 * @param viewer the viewer
                 * @param configuration the configuration
                 * @param preferenceStore the preference store
                 */
                SourcePreviewerUpdater( final SourceViewer viewer, final PropertiesFileSourceViewerConfiguration configuration, final IPreferenceStore preferenceStore) {
                        Assert.isNotNull(viewer);
                        Assert.isNotNull(configuration);
                        Assert.isNotNull(preferenceStore);
                        final IPropertyChangeListener fontChangeListener = new IPropertyChangeListener() {
                                 /*
                                  * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                  */
                                 public void propertyChange(PropertyChangeEvent event) {
                                         if (event.getProperty().equals(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT)) {
                                                 Font font = JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT);
                                                 viewer.getTextWidget().setFont(font);
                                         }
                                 }
                                                                           };
                        final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
                                 /*
                                  * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                  */
                                 public void propertyChange(PropertyChangeEvent event) {
                                         if (configuration.affectsTextPresentation(event)) {
                                                 configuration.handlePropertyChangeEvent(event);
                                                 viewer.invalidateTextPresentation();
                                         }
                                 }
                                                                               };
                        viewer.getTextWidget().addDisposeListener(new DisposeListener() {
                                /*
                                 * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
                                 */
                                public void widgetDisposed(DisposeEvent e) {
                                        preferenceStore.removePropertyChangeListener(propertyChangeListener);
                                        JFaceResources.getFontRegistry().removeListener(fontChangeListener);
                                }
                                                                  } );
                        JFaceResources.getFontRegistry().addListener(fontChangeListener);
                        preferenceStore.addPropertyChangeListener(propertyChangeListener);
                }
                                                    }


Clone AbstractionParameter Count: 3Parameter Bindings

{
   [[#variable594e9c20]]( final SourceViewer viewer, final [[#variable594e9bc0]] configuration, final IPreferenceStore preferenceStore) {
    Assert.isNotNull(viewer);
    Assert.isNotNull(configuration);
    Assert.isNotNull(preferenceStore);
    final IPropertyChangeListener fontChangeListener = new IPropertyChangeListener() {
                                                         /*
                                                                                          * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                                                                          */
                                                         /*
                                                                                  * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                                                                  */
                                                         public void propertyChange(PropertyChangeEvent event) {
                                                           if (event.getProperty().equals(PreferenceConstants. [[#variable594e98e0]])) {
                                                             Font font = JFaceResources.getFont(PreferenceConstants. [[#variable594e98e0]]);
                                                             viewer.getTextWidget().setFont(font);
                                                           }
                                                         }
                                                       };
    final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
                                                             /*
                                                                                              * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                                                                              */
                                                             /*
                                                                                      * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
                                                                                      */
                                                             public void propertyChange(PropertyChangeEvent event) {
                                                               if (configuration.affectsTextPresentation(event)) {
                                                                 configuration.handlePropertyChangeEvent(event);
                                                                 viewer.invalidateTextPresentation();
                                                               }
                                                             }
                                                           };
    viewer.getTextWidget().addDisposeListener(new DisposeListener() {
                                                /*
                                                                                 * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
                                                                                 */
                                                /*
                                                                         * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
                                                                         */
                                                public void widgetDisposed(DisposeEvent e) {
                                                  preferenceStore.removePropertyChangeListener(propertyChangeListener);
                                                  JFaceResources.getFontRegistry().removeListener(fontChangeListener);
                                                }
                                              } );
    JFaceResources.getFontRegistry().addListener(fontChangeListener);
    preferenceStore.addPropertyChangeListener(propertyChangeListener);
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#594e9c20]]
/**
 * Creates a Java source preview updater for the given viewer, configuration and preference store.
 *
 * @param viewer the viewer
 * @param configuration the configuration
 * @param preferenceStore the preference store
 */
SourcePreviewerUpdater 
12[[#594e9c20]]
/**
 * Creates a Java source preview updater for the given viewer, configuration and preference store.
 *
 * @param viewer the viewer
 * @param configuration the configuration
 * @param preferenceStore the preference store
 */
JavaSourcePreviewerUpdater 
21[[#594e9bc0]]
PropertiesFileSourceViewerConfiguration 
22[[#594e9bc0]]
JavaSourceViewerConfiguration 
31[[#594e98e0]]
PROPERTIES_FILE_EDITOR_TEXT_FONT 
32[[#594e98e0]]
EDITOR_TEXT_FONT