CloneSet22


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
85210.986class_body_declarations[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
185162
E:/TSE/Projects-CloneDR/jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java
285141
E:/TSE/Projects-CloneDR/jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java
Next
Last
Clone Instance
1
Line Count
85
Source Line
162
Source File
E:/TSE/Projects-CloneDR/jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java

public void setEditEnabled(boolean enabled) {
  if (editMenu != null) {
    editMenu.setEnabled(enabled);
  }
}

public void setEditAddMenu(JMenu menu) {
  // If the Add menu already exists, remove it.
  if (edit_add != null) {
    editMenu.remove(edit_add);
  }
  // Insert the Add menu as the first menu item in the Edit menu.
  edit_add = menu;
  editMenu.insert(edit_add, 0);
}

public void setEditMenu(JPopupMenu menu) {
  if (menu != null) {
    editMenu.removeAll();
    Component[] comps = menu.getComponents();
    for (int i = 0; i < comps.length; i++) {
      editMenu.add(comps[i]);
    }
    editMenu.setEnabled(true);
  }
  else {
    editMenu.setEnabled(false);
  }
}

public void setEditAddEnabled(boolean enabled) {
  // There was a NPE being thrown without the null check here.. JKB
  if (edit_add != null) {
    edit_add.setEnabled(enabled);
  }
  // If we are enabling the Edit-->Add menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Add menu item and the
    // Edit-->Remove menu item is disabled, then we also need to
    // disable the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_remove.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

public void setEditRemoveEnabled(boolean enabled) {
  edit_remove.setEnabled(enabled);
  // If we are enabling the Edit-->Remove menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Remove menu item and the
    // Edit-->Add menu item is disabled, then we also need to disable
    // the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_add.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

/**
 * Creates the MenuBar for this application. I believe in my heart that this
 * should be defined in a file somewhere, but that is for later.
 */
public void createMenuBar() {
  makeFileMenu();
  makeEditMenu();
  makeRunMenu();
  makeOptionsMenu();
  makeHelpMenu();
  this.add(fileMenu);
  this.add(editMenu);
  this.add(runMenu);
  this.add(optionsMenu);
  this.add(helpMenu);
}


First
Previous
Clone Instance
2
Line Count
85
Source Line
141
Source File
E:/TSE/Projects-CloneDR/jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java

public void setEditEnabled(boolean enabled) {
  if (editMenu != null) {
    editMenu.setEnabled(enabled);
  }
}

public void setEditAddMenu(JMenu menu) {
  // If the Add menu already exists, remove it.
  if (edit_add != null) {
    editMenu.remove(edit_add);
  }
  // Insert the Add menu as the first menu item in the Edit menu.
  edit_add = menu;
  editMenu.insert(edit_add, 0);
}

public void setEditMenu(JPopupMenu menu) {
  if (menu != null) {
    editMenu.removeAll();
    Component[] comps = menu.getComponents();
    for (int i = 0; i < comps.length; i++) {
      editMenu.add(comps[i]);
    }
    editMenu.setEnabled(true);
  }
  else {
  // editMenu.setEnabled(false);
  }
}

public void setEditAddEnabled(boolean enabled) {
  // There was a NPE being thrown without the null check here.. JKB
  if (edit_add != null) {
    edit_add.setEnabled(enabled);
  }
  // If we are enabling the Edit-->Add menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Add menu item and the
    // Edit-->Remove menu item is disabled, then we also need to
    // disable the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_remove.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

public void setEditRemoveEnabled(boolean enabled) {
  edit_remove.setEnabled(enabled);
  // If we are enabling the Edit-->Remove menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Remove menu item and the
    // Edit-->Add menu item is disabled, then we also need to disable
    // the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_add.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

/**
 * Creates the MenuBar for this application. I believe in my heart that this
 * should be defined in a file somewhere, but that is for later.
 */
public void createMenuBar() {
  makeFileMenu();
  makeEditMenu();
  makeRunMenu();
  makeOptionsMenu();
  makeHelpMenu();
  this.add(fileMenu);
  this.add(editMenu);
  this.add(runMenu);
  this.add(optionsMenu);
  this.add(helpMenu);
}


Clone AbstractionParameter Count: 1Parameter Bindings

public void setEditEnabled(boolean enabled) {
  if (editMenu != null) {
    editMenu.setEnabled(enabled);
  }
}

public void setEditAddMenu(JMenu menu) {
  // If the Add menu already exists, remove it.
  if (edit_add != null) {
    editMenu.remove(edit_add);
  }
  // Insert the Add menu as the first menu item in the Edit menu.
  edit_add = menu;
  editMenu.insert(edit_add, 0);
}

public void setEditMenu(JPopupMenu menu) {
  if (menu != null) {
    editMenu.removeAll();
    Component[] comps = menu.getComponents();
    for (int i = 0; i < comps.length; i++) {
      editMenu.add(comps[i]);
    }
    editMenu.setEnabled(true);
  }
  else
     [[#variabledf01700]]
}

public void setEditAddEnabled(boolean enabled) {
  // There was a NPE being thrown without the null check here.. JKB
  if (edit_add != null) {
    edit_add.setEnabled(enabled);
  }
  // If we are enabling the Edit-->Add menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Add menu item and the
    // Edit-->Remove menu item is disabled, then we also need to
    // disable the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_remove.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

public void setEditRemoveEnabled(boolean enabled) {
  edit_remove.setEnabled(enabled);
  // If we are enabling the Edit-->Remove menu item, then we also need to
  // enable the Edit menu. The Edit menu may already be enabled, but
  // there's no harm it trying to enable it again.
  if (enabled) {
    setEditEnabled(true);
  }
  else {
    // If we are disabling the Edit-->Remove menu item and the
    // Edit-->Add menu item is disabled, then we also need to disable
    // the Edit menu.
    // The Java Look and Feel Guidelines say to disable a menu if all
    // menu items are disabled.
    if ( !edit_add.isEnabled()) {
      editMenu.setEnabled(false);
    }
  }
}

/**
         * Creates the MenuBar for this application. I believe in my heart that this
         * should be defined in a file somewhere, but that is for later.
         */
public void createMenuBar() {
  makeFileMenu();
  makeEditMenu();
  makeRunMenu();
  makeOptionsMenu();
  makeHelpMenu();
  this.add(fileMenu);
  this.add(editMenu);
  this.add(runMenu);
  this.add(optionsMenu);
  this.add(helpMenu);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#df01700]]
{
  editMenu.setEnabled(false);
} 
12[[#df01700]]
{
// editMenu.setEnabled(false);
}