=====================================================================
Found a 149 line (249 tokens) duplication in the following files:
Starting at line 109 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SRadioButton.java
Starting at line 109 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SCheckBox.java
public SCheckBox(Icon icon) {
super(icon);
scopeInit();
}
private void scopeInit() {
setEnabled(false);
Pointer variablePointer = PointerFactory.getVariablePointer(SELECTED_PROPERTY
+ ComponentSupport.POINTER_VARIABLE_SUFFIX);
setEnabledPointer(variablePointer.append(ModelAccessWrapper.READ_ONLY_PATH));
}
/**
* {@inheritDoc}
*
* @return The type of the view
*/
public String getViewType() {
return SwingSupport.VIEW_TYPE;
}
// ------------------- Delegate to Binding -------------------
/**
* INTERNAL
* {@inheritDoc}
*
* @return The model wrapper
*/
public final ModelWrapper getModelWrapper() {
return _componentSupport.getModelWrapper();
}
/**
* Gets the pointer used to identity the value in the model representing the selected state of the checkbox.
*
* @return A pointer.
*/
public final Pointer getSelectedPointer() {
return _componentSupport.getPointerForBinding(SELECTED_PROPERTY);
}
/**
* Gets the pointer used to identity the value in the model representing the enabled state of the checkbox.
*
* @return A pointer.
*/
public final Pointer getEnabledPointer() {
return _componentSupport.getPointerForBinding(ENABLED_PROPERTY);
}
/**
* Gets the action Id
*
* @return The actionId value
*/
public final String getActionID() {
return _componentSupport.getActionSupport(SELECTION_CHANGED_ACTION)
.getActionID();
}
/**
* {@inheritDoc}
*
* @return The controller value
*/
public Controller getController() {
return _componentSupport.getController();
}
/**
* Set the id of the ActionEvent that will be issued when Enter key is pressed
* in this SCheckBox. If null no ActionEvent will be issued.
*
* @param actionId The new actionId value
*/
public final void setActionID(String actionId) {
_componentSupport.getActionSupport(SELECTION_CHANGED_ACTION)
.setActionID(actionId);
}
/**
* Sets the pointer used to identity the value in the model representing the selected state of the checkbox.
*
* @param pointer The new pointer to use
*/
public final void setSelectedPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(SELECTED_PROPERTY, pointer);
}
/**
* Sets the pointer used to identity the value in the model representing the enabled state of the checkbox.
*
* @param pointer The new pointer to use
*/
public final void setEnabledPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(ENABLED_PROPERTY, pointer);
}
/**
* INTERNAL
* {@inheritDoc}
*
* @param modelWrapper The new modelWrapper value
*
* @throws ModelException if the new model wrapper could not be set
*/
public void setModelWrapper(ModelWrapper modelWrapper)
throws ModelException {
_componentSupport.setModelWrapper(modelWrapper);
}
/**
* Sets the controller for this view.
* If you don't set explicitely a controller, then this view will use the
* controller from its parent view.
*
* @param controller The new controller
*/
public void setController(Controller controller) {
_componentSupport.setController(controller);
}
// ------------------ Refreshable -------------------------
/**
* {@inheritDoc}
* This method is called automatically when calling refresh() on the parent component
*/
public void refresh() {
_componentSupport.refresh();
}
/**
* {@inheritDoc}
* This method is called automatically after some user action on the
* component.
*/
public void commitViewState() {
_componentSupport.commitViewState();
}
/**
* {@inheritDoc}
* @return a string representation of this object
*/
public String toString() {
=====================================================================
Found a 145 line (244 tokens) duplication in the following files:
Starting at line 118 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextField.java
Starting at line 118 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SPasswordField.java
public SPasswordField(int columns) {
super(columns);
setEnabled(false);
Pointer variablePointer = PointerFactory.getVariablePointer(TEXT_PROPERTY
+ ComponentSupport.POINTER_VARIABLE_SUFFIX);
setEnabledPointer(variablePointer.append(ModelAccessWrapper.READ_ONLY_PATH));
}
/**
* {@inheritDoc}
*
* @return The type of the view
*/
public String getViewType() {
return SwingSupport.VIEW_TYPE;
}
// ------------------- Delegate to Binding -------------------
/**
* INTERNAL
* {@inheritDoc}
*
* @return The model wrapper
*/
public final ModelWrapper getModelWrapper() {
return _componentSupport.getModelWrapper();
}
/**
* Gets the pointer used to identity the value in the model representing the text of the field.
*
* @return A pointer.
*/
public final Pointer getTextPointer() {
return _componentSupport.getPointerForBinding(TEXT_PROPERTY);
}
/**
* Gets the pointer used to identity the value in the model representing the enabled state of the field.
*
* @return A pointer.
*/
public final Pointer getEnabledPointer() {
return _componentSupport.getPointerForBinding(ENABLED_PROPERTY);
}
/**
* Gets the action Id
*
* @return The actionId value
*/
public final String getActionID() {
return _componentSupport.getActionSupport(COMMIT_CHANGE_ACTION)
.getActionID();
}
/**
* {@inheritDoc}
*
* @return The controller value
*/
public Controller getController() {
return _componentSupport.getController();
}
/**
* Set the id of the ActionEvent that will be issued when Enter key is pressed
* in this SPasswordField. If null no ActionEvent will be issued.
*
* @param actionId The new actionId value
*/
public final void setActionID(String actionId) {
_componentSupport.getActionSupport(COMMIT_CHANGE_ACTION)
.setActionID(actionId);
}
/**
* Sets the pointer used to identity the value in the model representing the text of the field.
*
* @param pointer The new pointer to use
*/
public final void setTextPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(TEXT_PROPERTY, pointer);
}
/**
* Sets the pointer used to identity the value in the model representing the enabled state of the field.
*
* @param pointer The new pointer to use
*/
public final void setEnabledPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(ENABLED_PROPERTY, pointer);
}
/**
* INTERNAL
* {@inheritDoc}
*
* @param modelWrapper The new modelWrapper value
*
* @throws ModelException if the new model wrapper could not be set
*/
public void setModelWrapper(ModelWrapper modelWrapper)
throws ModelException {
_componentSupport.setModelWrapper(modelWrapper);
}
/**
* Sets the controller for this view.
* If you don't set explicitely a controller, then this view will use the
* controller from its parent view.
*
* @param controller The new controller
*/
public void setController(Controller controller) {
_componentSupport.setController(controller);
}
// ------------------ Refreshable -------------------------
/**
* {@inheritDoc}
* This method is called automatically when calling refresh() on the parent component
*/
public void refresh() {
_componentSupport.refresh();
}
/**
* {@inheritDoc}
* This method is called automatically after some user action on the
* component.
*/
public void commitViewState() {
_componentSupport.commitViewState();
}
/**
* {@inheritDoc}
* @return a string representation of this object
*/
public String toString() {
=====================================================================
Found a 144 line (232 tokens) duplication in the following files:
Starting at line 82 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextArea.java
Starting at line 119 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextField.java
super(columns);
setEnabled(false);
Pointer variablePointer = PointerFactory.getVariablePointer(TEXT_PROPERTY
+ ComponentSupport.POINTER_VARIABLE_SUFFIX);
setEnabledPointer(variablePointer.append(ModelAccessWrapper.READ_ONLY_PATH));
}
/**
* {@inheritDoc}
*
* @return The type of the view
*/
public String getViewType() {
return SwingSupport.VIEW_TYPE;
}
// ------------------- Delegate to Binding -------------------
/**
* INTERNAL
* {@inheritDoc}
*
* @return The model wrapper
*/
public final ModelWrapper getModelWrapper() {
return _componentSupport.getModelWrapper();
}
/**
* Gets the pointer used to identity the value in the model representing the text of the field.
*
* @return A pointer.
*/
public final Pointer getTextPointer() {
return _componentSupport.getPointerForBinding(TEXT_PROPERTY);
}
/**
* Gets the pointer used to identity the value in the model representing the enabled state of the field.
*
* @return A pointer.
*/
public final Pointer getEnabledPointer() {
return _componentSupport.getPointerForBinding(ENABLED_PROPERTY);
}
/**
* Gets the action Id
*
* @return The actionId value
*/
public final String getActionID() {
return _componentSupport.getActionSupport(COMMIT_CHANGE_ACTION)
.getActionID();
}
/**
* {@inheritDoc}
*
* @return The controller value
*/
public Controller getController() {
return _componentSupport.getController();
}
/**
* Set the id of the ActionEvent that will be issued when Enter key is pressed
* in this STextField. If null no ActionEvent will be issued.
*
* @param actionId The new actionId value
*/
public final void setActionID(String actionId) {
_componentSupport.getActionSupport(COMMIT_CHANGE_ACTION)
.setActionID(actionId);
}
/**
* Sets the pointer used to identity the value in the model representing the text of the field.
*
* @param pointer The new pointer to use
*/
public final void setTextPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(TEXT_PROPERTY, pointer);
}
/**
* Sets the pointer used to identity the value in the model representing the enabled state of the field.
*
* @param pointer The new pointer to use
*/
public final void setEnabledPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(ENABLED_PROPERTY, pointer);
}
/**
* INTERNAL
* {@inheritDoc}
*
* @param modelWrapper The new modelWrapper value
*
* @throws ModelException if the new model wrapper could not be set
*/
public void setModelWrapper(ModelWrapper modelWrapper)
throws ModelException {
_componentSupport.setModelWrapper(modelWrapper);
}
/**
* Sets the controller for this view.
* If you don't set explicitely a controller, then this view will use the
* controller from its parent view.
*
* @param controller The new controller
*/
public void setController(Controller controller) {
_componentSupport.setController(controller);
}
// ------------------ Refreshable -------------------------
/**
* {@inheritDoc}
* This method is called automatically when calling refresh() on the parent component
*/
public void refresh() {
_componentSupport.refresh();
}
/**
* {@inheritDoc}
* This method is called automatically after some user action on the
* component.
*/
public void commitViewState() {
_componentSupport.commitViewState();
}
/**
* {@inheritDoc}
* @return a string representation of this object
*/
public String toString() {
=====================================================================
Found a 48 line (185 tokens) duplication in the following files:
Starting at line 66 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/impl/view/swing/thread/SwingWorkerThreadSupport.java
Starting at line 69 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/impl/view/swing/thread/FoxtrotThreadSupport.java
public FoxtrotThreadSupport() {
super();
}
/**
* Execute the operation by taking into acount the threading options for this operation
*
* @param operation The operation to execute
*
* @throws ViewException if the operation cannot be executed
*/
protected void execute(ExecuteOperation operation)
throws ViewException {
if ((operation.getThreadFlags() & APP_THREAD_FLAG) == 0) {
// Run in Swing event thread
if (SwingUtilities.isEventDispatchThread()) {
operation.executeNow();
} else {
if ((operation.getThreadFlags() & SYNC_THREAD_FLAG) == 0) {
// Asynchronous
SwingUtilities.invokeLater((Runnable) operation);
} else {
try {
// Synchronous
SwingUtilities.invokeAndWait((Runnable) operation);
} catch (InterruptedException e1) {
ViewException viewException = new ViewException(
this, CANNOT_EXECUTE_OPERATION_MSG,
operation.getMethod());
viewException.initCause(e1);
throw viewException;
} catch (InvocationTargetException e2) {
if (e2.getCause() instanceof ViewException) {
throw (ViewException) e2.getCause();
}
ViewException viewException = new ViewException(
this, CANNOT_EXECUTE_OPERATION_MSG,
operation.getMethod());
viewException.initCause(e2);
throw viewException;
}
}
}
} else {
if (SwingUtilities.isEventDispatchThread()) {
=====================================================================
Found a 61 line (160 tokens) duplication in the following files:
Starting at line 61 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SPasswordFieldBeanInfo.java
Starting at line 53 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextAreaBeanInfo.java
Starting at line 61 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextFieldBeanInfo.java
super(STextField.class);
}
/**
* Gets the property descriptors
*
* @return The propertyDescriptors value
*/
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor actionId = new PropertyDescriptor(
"actionID", getBeanClass(), "getActionID",
"setActionID");
actionId.setDisplayName("The action ID");
actionId.setShortDescription("The id of the ActionEvent that issued when the text is changed. "
+ "If null no ActionEvent will be fired.");
PropertyDescriptor pointer = new PropertyDescriptor(
"textPointer", getBeanClass(), "getTextPointer",
"setTextPointer");
pointer.setDisplayName("The pointer for the text property");
pointer.setShortDescription("The pointer identifying the value in the model containing the "
+ "text to display");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
actionId,
pointer
};
return pds;
} catch (IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
/**
* Gets the additional bean info
*
* @return The additionalBeanInfo value
*/
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = getBeanClass()
.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
return new BeanInfo[] {
superBeanInfo
};
} catch (IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
=====================================================================
Found a 79 line (105 tokens) duplication in the following files:
Starting at line 188 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SLabel.java
Starting at line 118 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SList.java
}
// ---------- Implement View by delegation to SListModel and SListSelectionModel ----------
/**
* {@inheritDoc}
* @return the view type
*/
public String getViewType() {
return SwingSupport.VIEW_TYPE;
}
/**
* {@inheritDoc}
* @return the controller
*/
public Controller getController() {
return _componentSupport.getController();
}
/**
* {@inheritDoc}
* @param controller The new controller to use
*/
public void setController(Controller controller) {
_componentSupport.setController(controller);
}
/**
* INTERNAL
* {@inheritDoc}
* @return the component support
*/
public ComponentSupport getComponentSupport() {
return _componentSupport;
}
/**
* INTERNAL
* {@inheritDoc}
* @return the model wrapper
*/
public ModelWrapper getModelWrapper() {
return _componentSupport.getModelWrapper();
}
/**
* INTERNAL
* {@inheritDoc}
* @param modelWrapper The model wrapper
*
* @throws ModelException if the new model wrapper could not be set
*/
public void setModelWrapper(ModelWrapper modelWrapper)
throws ModelException {
_componentSupport.setModelWrapper(modelWrapper);
}
/**
* Not really needed as the label cannot be modified by the user.
*/
public void commitViewState() {
_componentSupport.commitViewState();
}
/**
* {@inheritDoc}
*/
public void refresh() {
_componentSupport.refresh();
}
/**
* Gets the name of the variable, defined in the index pointer, and used to select one by one
* the items in the list. Default is i.
*
* @return the indexVarName.
*/
public String getIndexVarName() {
=====================================================================
Found a 55 line (102 tokens) duplication in the following files:
Starting at line 196 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/SRadioButton.java
Starting at line 162 of /home/tom/pmd/pmd-web/src/scopemvc2/src/org/scopemvc/view/swing/STextArea.java
_componentSupport.setPointerForBinding(TEXT_PROPERTY, pointer);
}
/**
* Sets the pointer used to identity the value in the model representing
* the enabled state of the field.
*
* @param pointer
* The new pointer to use
*/
public final void setEnabledPointer(Pointer pointer) {
_componentSupport.setPointerForBinding(ENABLED_PROPERTY, pointer);
}
/**
* @see org.scopemvc.impl.view.ViewSPI#setModelWrapper(org.scopemvc.impl.model.ModelWrapper)
*/
public void setModelWrapper(ModelWrapper modelWrapper) throws ModelException {
_componentSupport.setModelWrapper(modelWrapper);
}
/**
* @see org.scopemvc.View#setController(org.scopemvc.Controller)
*/
public void setController(Controller controller) {
_componentSupport.setController(controller);
}
/**
* @see org.scopemvc.view.RefreshableView#refresh()
*/
public void refresh() {
_componentSupport.refresh();
}
/**
* @see org.scopemvc.view.RefreshableView#commitViewState()
*/
public void commitViewState() {
_componentSupport.commitViewState();
}
/**
* @see org.scopemvc.impl.view.swing.SwingComponentView#getComponentSupport()
*/
public ComponentSupport getComponentSupport() {
return _componentSupport;
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return new ToStringBuilder(this)
.append("textPointer", Pointer.asString(getTextPointer()))