CloneSet842


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
28260.964class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12852
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/OpenCloseWorkingSetAction.java
22883
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/OpenCloseWorkingSetAction.java
Clone Instance
1
Line Count
28
Source Line
52
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/OpenCloseWorkingSetAction.java

        private static final class CloseWorkingSetAction extends OpenCloseWorkingSetAction {
                private IAction fProjectAction;

                private CloseWorkingSetAction(IWorkbenchSite site, String label) {
                        super(site, label);
                        IActionBars actionBars = getActionBars();
                        if (actionBars != null) {
                                fProjectAction = actionBars.getGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId());
                        }
                }

                protected boolean validate(IProject project) {
                        return project.isOpen();
                }

                protected void performOperation(IProject project, IProgressMonitor monitor) throws CoreException {
                        project.close(monitor);
                }

                protected void connectToActionBar(IActionBars actionBars) {
                        actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId(), this );
                        actionBars.updateActionBars();
                }

                protected void disconnectFromActionBar(IActionBars actionBars) {
                        actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId(), fProjectAction);
                        actionBars.updateActionBars();
                }

                protected String getErrorTitle() {
                        return WorkingSetMessages.OpenCloseWorkingSetAction_close_error_title;
                }

                protected String getErrorMessage() {
                        return WorkingSetMessages.OpenCloseWorkingSetAction_close_error_message;
                }
        }


Clone Instance
2
Line Count
28
Source Line
83
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/OpenCloseWorkingSetAction.java

        private static final class OpenWorkingSetAction extends OpenCloseWorkingSetAction {
                private IAction fProjectAction;

                private OpenWorkingSetAction(IWorkbenchSite site, String label) {
                        super(site, label);
                        IActionBars actionBars = getActionBars();
                        if (actionBars != null) {
                                fProjectAction = actionBars.getGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId());
                        }
                }

                protected boolean validate(IProject project) {
                        return !project.isOpen();
                }

                protected void performOperation(IProject project, IProgressMonitor monitor) throws CoreException {
                        project.open(monitor);
                }

                protected void connectToActionBar(IActionBars actionBars) {
                        actionBars.setGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId(), this );
                        actionBars.updateActionBars();
                }

                protected void disconnectFromActionBar(IActionBars actionBars) {
                        actionBars.setGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId(), fProjectAction);
                        actionBars.updateActionBars();
                }

                protected String getErrorTitle() {
                        return WorkingSetMessages.OpenCloseWorkingSetAction_open_error_title;
                }

                protected String getErrorMessage() {
                        return WorkingSetMessages.OpenCloseWorkingSetAction_open_error_message;
                }
        }


Clone AbstractionParameter Count: 6Parameter Bindings

private static final class [[#variable587bd1a0]]extends OpenCloseWorkingSetAction {
  private IAction fProjectAction;

  private [[#variable587bd1a0]](IWorkbenchSite site, String label) {
    super(site, label);
    IActionBars actionBars = getActionBars();
    if (actionBars != null) {
      fProjectAction = actionBars.getGlobalActionHandler(IDEActionFactory. [[#variable587bd100]].getId());
    }
  }

  protected boolean validate(IProject project) {
    return [[#variable587bd060]];
  }

  protected void performOperation(IProject project, IProgressMonitor monitor) throws CoreException {
    project. [[#variable587bcfe0]](monitor);
  }

  protected void connectToActionBar(IActionBars actionBars) {
    actionBars.setGlobalActionHandler(IDEActionFactory. [[#variable587bd100]].getId(), this );
    actionBars.updateActionBars();
  }

  protected void disconnectFromActionBar(IActionBars actionBars) {
    actionBars.setGlobalActionHandler(IDEActionFactory. [[#variable587bd100]].getId(), fProjectAction);
    actionBars.updateActionBars();
  }

  protected String getErrorTitle() {
    return WorkingSetMessages. [[#variable587bcf40]];
  }

  protected String getErrorMessage() {
    return WorkingSetMessages. [[#variable587bce80]];
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#587bd1a0]]
CloseWorkingSetAction 
12[[#587bd1a0]]
OpenWorkingSetAction 
21[[#587bd100]]
CLOSE_PROJECT 
22[[#587bd100]]
OPEN_PROJECT 
31[[#587bd060]]
project.isOpen() 
32[[#587bd060]]
!project.isOpen() 
41[[#587bcfe0]]
close 
42[[#587bcfe0]]
open 
51[[#587bcf40]]
OpenCloseWorkingSetAction_close_error_title 
52[[#587bcf40]]
OpenCloseWorkingSetAction_open_error_title 
61[[#587bce80]]
OpenCloseWorkingSetAction_close_error_message 
62[[#587bce80]]
OpenCloseWorkingSetAction_open_error_message