Example usage for javax.swing.event AncestorEvent getSource

List of usage examples for javax.swing.event AncestorEvent getSource

Introduction

In this page you can find the example usage for javax.swing.event AncestorEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:com.digitalgeneralists.assurance.ui.components.ScanHistoryPanel.java

private void initializeComponent() {
    if (!this.initialized) {
        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        GridBagConstraints existingScansPanelConstraints = new GridBagConstraints();
        existingScansPanelConstraints.anchor = GridBagConstraints.WEST;
        existingScansPanelConstraints.fill = GridBagConstraints.BOTH;
        existingScansPanelConstraints.gridx = 0;
        existingScansPanelConstraints.gridy = 0;
        existingScansPanelConstraints.weightx = 1.0;
        existingScansPanelConstraints.weighty = 1.0;
        existingScansPanelConstraints.gridheight = 1;
        existingScansPanelConstraints.gridwidth = 1;
        existingScansPanelConstraints.insets = new Insets(0, 0, 0, 0);

        this.existingScansListPanel = new ListInputPanel<Scan>(this, this, true, true);
        this.add(this.existingScansListPanel, existingScansPanelConstraints);

        this.addAncestorListener(new AncestorListener() {
            public void ancestorAdded(AncestorEvent event) {
                applicationDelegate.addEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScansLoadedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanDeletedEvent.class,
                        (IEventObserver) event.getSource());

                applicationDelegate.loadScans();
            }/*from   w w w.  j  av  a 2 s .  c  om*/

            public void ancestorRemoved(AncestorEvent event) {
                applicationDelegate.removeEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScansLoadedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanDeletedEvent.class,
                        (IEventObserver) event.getSource());
            }

            public void ancestorMoved(AncestorEvent event) {
            }
        });

        this.initialized = true;
    }
}

From source file:com.digitalgeneralists.assurance.ui.components.ScanLaunchPanel.java

private void initializeComponent() {
    if (!this.initialized) {
        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        GridBagConstraints existingScansPanelConstraints = new GridBagConstraints();
        existingScansPanelConstraints.anchor = GridBagConstraints.WEST;
        existingScansPanelConstraints.fill = GridBagConstraints.BOTH;
        existingScansPanelConstraints.gridx = 0;
        existingScansPanelConstraints.gridy = 0;
        existingScansPanelConstraints.weightx = 1.0;
        existingScansPanelConstraints.weighty = 1.0;
        existingScansPanelConstraints.gridheight = 2;
        existingScansPanelConstraints.gridwidth = 1;
        existingScansPanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel existingScansPanel = new JPanel();
        GridBagLayout panelGridbag = new GridBagLayout();
        existingScansPanel.setLayout(panelGridbag);
        this.add(existingScansPanel, existingScansPanelConstraints);

        GridBagConstraints existingScansListConstraints = new GridBagConstraints();
        existingScansListConstraints.anchor = GridBagConstraints.WEST;
        existingScansListConstraints.fill = GridBagConstraints.BOTH;
        existingScansListConstraints.gridx = 0;
        existingScansListConstraints.gridy = 0;
        existingScansListConstraints.weightx = 1.0;
        existingScansListConstraints.weighty = 0.9;
        existingScansListConstraints.gridheight = 1;
        existingScansListConstraints.gridwidth = 2;
        existingScansListConstraints.insets = new Insets(5, 5, 5, 5);

        GridBagConstraints existingScanDefinitionsListConstraints = new GridBagConstraints();
        existingScanDefinitionsListConstraints.anchor = GridBagConstraints.WEST;
        existingScanDefinitionsListConstraints.fill = GridBagConstraints.BOTH;
        existingScanDefinitionsListConstraints.gridx = 0;
        existingScanDefinitionsListConstraints.gridy = 0;
        existingScanDefinitionsListConstraints.weightx = 1.0;
        existingScanDefinitionsListConstraints.weighty = 0.9;
        existingScanDefinitionsListConstraints.gridheight = 1;
        existingScanDefinitionsListConstraints.gridwidth = 2;
        existingScanDefinitionsListConstraints.insets = new Insets(5, 5, 5, 5);

        this.existingScanDefinitionsListPanel = new ListInputPanel<ScanDefinition>(this, this);
        existingScansPanel.add(this.existingScanDefinitionsListPanel, existingScanDefinitionsListConstraints);

        GridBagConstraints scanButtonConstraints = new GridBagConstraints();
        scanButtonConstraints.anchor = GridBagConstraints.NORTHEAST;
        scanButtonConstraints.fill = GridBagConstraints.BOTH;
        scanButtonConstraints.gridx = 1;
        scanButtonConstraints.gridy = 0;
        scanButtonConstraints.weightx = 1.0;
        scanButtonConstraints.weighty = 1.0;

        this.startScanButton.setActionCommand(AssuranceActions.scanAction);

        this.add(this.startScanButton, scanButtonConstraints);

        GridBagConstraints scanAndMergeButtonConstraints = new GridBagConstraints();
        scanAndMergeButtonConstraints.anchor = GridBagConstraints.SOUTHEAST;
        scanAndMergeButtonConstraints.fill = GridBagConstraints.BOTH;
        scanAndMergeButtonConstraints.gridx = 1;
        scanAndMergeButtonConstraints.gridy = 1;
        scanAndMergeButtonConstraints.weightx = 1.0;
        scanAndMergeButtonConstraints.weighty = 1.0;

        this.startScanAndMergeButton.setActionCommand(AssuranceActions.scanAndMergeAction);

        this.add(this.startScanAndMergeButton, scanAndMergeButtonConstraints);

        this.startScanAndMergeButton.addActionListener(this);
        this.startScanButton.addActionListener(this);

        this.startScanButton.setEnabled(false);
        this.startScanAndMergeButton.setEnabled(false);

        this.addAncestorListener(new AncestorListener() {
            public void ancestorAdded(AncestorEvent event) {
                applicationDelegate.addEventObserver(ScanStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanDefinitionDeletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanDefinitionSavedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanDefinitionsLoadedEvent.class,
                        (IEventObserver) event.getSource());
            }/*from   ww w.  jav a 2 s  . c o  m*/

            public void ancestorRemoved(AncestorEvent event) {
                applicationDelegate.removeEventObserver(ScanStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanDefinitionDeletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanDefinitionSavedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanDefinitionsLoadedEvent.class,
                        (IEventObserver) event.getSource());
            }

            public void ancestorMoved(AncestorEvent event) {
            }
        });

        this.initialized = true;
    }
}

From source file:com.digitalgeneralists.assurance.ui.components.ResultsPanel.java

private void initializeComponent() {
    if (!this.initialized) {
        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        ((DefaultTableCellRenderer) resultsTable.getTableHeader().getDefaultRenderer())
                .setHorizontalAlignment(JLabel.CENTER);
        this.resultsTable.setRowHeight(150);

        ListSelectionModel selectionModel = this.resultsTable.getSelectionModel();

        selectionModel.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                applicationDelegate.fireEvent(new SetScanResultsMenuStateEvent(false));
                resultsTable.editCellAt(resultsTable.getSelectedRow(), 0);
            }/*from  w  w w  .  j  ava  2 s .c  om*/
        });

        GridBagConstraints resultsLabelConstraints = new GridBagConstraints();
        resultsLabelConstraints.anchor = GridBagConstraints.WEST;
        resultsLabelConstraints.fill = GridBagConstraints.BOTH;
        resultsLabelConstraints.gridx = 0;
        resultsLabelConstraints.gridy = 0;
        resultsLabelConstraints.weightx = 1.0;
        resultsLabelConstraints.weighty = 0.1;
        resultsLabelConstraints.gridheight = 1;
        resultsLabelConstraints.gridwidth = 1;
        resultsLabelConstraints.insets = new Insets(5, 5, 5, 5);

        this.progressIndicatorConstraints.anchor = GridBagConstraints.WEST;
        this.progressIndicatorConstraints.fill = GridBagConstraints.BOTH;
        this.progressIndicatorConstraints.gridx = 0;
        this.progressIndicatorConstraints.gridy = 1;
        this.progressIndicatorConstraints.weightx = 1.0;
        this.progressIndicatorConstraints.weighty = 0.1;
        this.progressIndicatorConstraints.gridheight = 1;
        this.progressIndicatorConstraints.gridwidth = 1;
        this.progressIndicatorConstraints.insets = new Insets(5, 5, 5, 5);

        this.progressIndicator.setIndeterminate(true);

        this.resultsListConstraints.anchor = GridBagConstraints.WEST;
        this.resultsListConstraints.fill = GridBagConstraints.BOTH;
        this.resultsListConstraints.gridx = 0;
        this.resultsListConstraints.gridy = 2;
        this.resultsListConstraints.weightx = 1.0;
        this.resultsListConstraints.weighty = 0.9;
        this.resultsListConstraints.gridheight = 1;
        this.resultsListConstraints.gridwidth = 1;
        this.resultsListConstraints.insets = new Insets(5, 5, 5, 5);

        this.add(this.resultsLabel, resultsLabelConstraints);
        this.add(this.resultsScrollPane, this.resultsListConstraints);

        this.addAncestorListener(new AncestorListener() {
            public void ancestorAdded(AncestorEvent event) {
                resultsTable.setDefaultRenderer(ComparisonResult.class, comparisonResultListRenderer);
                resultsTable.setDefaultEditor(ComparisonResult.class, comparisonResultListRenderer);

                applicationDelegate.addEventObserver(ScanStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ComparisonResultAddedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanResultsLoadedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(SelectedScanChangedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanProgressEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ResultMergeCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanMergeStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanMergeProgressEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(ScanMergeCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.addEventObserver(DeletedItemRestoreCompletedEvent.class,
                        (IEventObserver) event.getSource());
            }

            public void ancestorRemoved(AncestorEvent event) {
                applicationDelegate.removeEventObserver(ScanStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ComparisonResultAddedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanResultsLoadedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(SelectedScanChangedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanProgressEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ResultMergeCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanMergeStartedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanMergeProgressEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(ScanMergeCompletedEvent.class,
                        (IEventObserver) event.getSource());
                applicationDelegate.removeEventObserver(DeletedItemRestoreCompletedEvent.class,
                        (IEventObserver) event.getSource());
            }

            public void ancestorMoved(AncestorEvent event) {
            }
        });

        this.initialized = true;
    }
}

From source file:com.digitalgeneralists.assurance.ui.components.ComparisonResultPanel.java

protected void initializeComponent(ComparisonResult result) {
    if (!this.initialized) {
        this.merging = false;
        this.numberOfLines = 0;

        this.setOpaque(true);

        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        this.basePanelConstraints.anchor = GridBagConstraints.WEST;
        this.basePanelConstraints.fill = GridBagConstraints.BOTH;
        this.basePanelConstraints.gridx = 0;
        this.basePanelConstraints.gridy = 0;
        this.basePanelConstraints.weightx = 1.0;
        this.basePanelConstraints.weighty = 1.0;
        this.basePanelConstraints.gridheight = 1;
        this.basePanelConstraints.gridwidth = 1;
        this.basePanelConstraints.insets = new Insets(0, 0, 0, 0);

        this.standardPanel.setOpaque(false);
        GridBagLayout basePanelGridbag = new GridBagLayout();
        this.standardPanel.setLayout(basePanelGridbag);
        this.add(this.standardPanel, this.basePanelConstraints);

        GridBagConstraints sourcePanelConstraints = new GridBagConstraints();
        sourcePanelConstraints.anchor = GridBagConstraints.WEST;
        sourcePanelConstraints.fill = GridBagConstraints.BOTH;
        sourcePanelConstraints.gridx = 0;
        sourcePanelConstraints.gridy = 0;
        sourcePanelConstraints.weightx = 0.4;
        sourcePanelConstraints.weighty = 1.0;
        sourcePanelConstraints.gridheight = 1;
        sourcePanelConstraints.gridwidth = 1;
        sourcePanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel sourcePanel = new JPanel();
        sourcePanel.setOpaque(false);// ww  w  .j ava2  s.  c o  m
        GridBagLayout sourcePanelGridbag = new GridBagLayout();
        sourcePanel.setLayout(sourcePanelGridbag);
        this.standardPanel.add(sourcePanel, sourcePanelConstraints);

        GridBagConstraints sourceFileLabelConstraints = new GridBagConstraints();
        sourceFileLabelConstraints.anchor = GridBagConstraints.WEST;
        sourceFileLabelConstraints.gridx = 0;
        sourceFileLabelConstraints.gridy = 0;
        sourceFileLabelConstraints.weightx = 1.0;
        sourceFileLabelConstraints.weighty = 1.0;
        sourceFileLabelConstraints.gridheight = 1;
        sourceFileLabelConstraints.gridwidth = 1;
        sourceFileLabelConstraints.insets = new Insets(5, 5, 5, 5);

        String sourcePath = "No File Specified";
        if ((result != null) && (result.getSource() != null)) {
            File sourceFile = result.getSource().getFile();
            if ((sourceFile == null) || (!sourceFile.exists())) {
                sourcePath = "File does not exist in source location.";
            } else {
                sourcePath = sourceFile.getPath();
            }
            sourceFile = null;
        }
        JLabel sourceFileLabel = new JLabel(sourcePath);
        sourcePath = null;
        sourcePanel.add(sourceFileLabel, sourceFileLabelConstraints);

        GridBagConstraints sourceAttributesPanelConstraints = new GridBagConstraints();
        sourceAttributesPanelConstraints.anchor = GridBagConstraints.WEST;
        sourceAttributesPanelConstraints.fill = GridBagConstraints.BOTH;
        sourceAttributesPanelConstraints.gridx = 0;
        sourceAttributesPanelConstraints.gridy = 1;
        sourceAttributesPanelConstraints.weightx = 1.0;
        sourceAttributesPanelConstraints.weighty = 1.0;
        sourceAttributesPanelConstraints.gridheight = 1;
        sourceAttributesPanelConstraints.gridwidth = 1;
        sourceAttributesPanelConstraints.insets = new Insets(0, 0, 0, 0);

        FileReference sourceReference = null;
        if (result != null) {
            sourceReference = result.getSource();
        }

        FileReference targetReference = null;
        if (result != null) {
            targetReference = result.getTarget();
        }

        JPanel sourceAttributesPanel = this.createFileAttributesPanel(sourceReference, targetReference,
                GridBagConstraints.WEST);
        sourcePanel.add(sourceAttributesPanel, sourceAttributesPanelConstraints);

        this.moreSourceAttributesButton.setHorizontalAlignment(SwingConstants.LEFT);
        this.moreSourceAttributesButton.setBorderPainted(false);
        this.moreSourceAttributesButton.setOpaque(false);
        this.moreSourceAttributesButton.setForeground(Color.blue);

        if (this.editable) {
            this.moreSourceAttributesButton.setText("All attributes...");
            this.moreSourceAttributesButton.addActionListener(this);
            this.moreSourceAttributesButton.setEnabled(true);
        } else {
            this.moreSourceAttributesButton.setText(" ");
            this.moreSourceAttributesButton.setEnabled(false);
        }
        this.moreSourceAttributesButton.setActionCommand(AssuranceActions.sourceAttributesAction);

        GridBagConstraints moreSourceAttributesButtonConstraints = new GridBagConstraints();
        moreSourceAttributesButtonConstraints.anchor = GridBagConstraints.WEST;
        moreSourceAttributesButtonConstraints.fill = GridBagConstraints.BOTH;
        moreSourceAttributesButtonConstraints.gridx = 0;
        moreSourceAttributesButtonConstraints.gridy = 2;
        moreSourceAttributesButtonConstraints.weightx = 1.0;
        moreSourceAttributesButtonConstraints.weighty = 1.0;
        moreSourceAttributesButtonConstraints.gridheight = 1;
        moreSourceAttributesButtonConstraints.gridwidth = 1;
        moreSourceAttributesButtonConstraints.insets = new Insets(0, 0, 0, 0);
        sourcePanel.add(this.moreSourceAttributesButton, moreSourceAttributesButtonConstraints);

        this.buildMergePanel(result);

        GridBagConstraints targetPanelConstraints = new GridBagConstraints();
        targetPanelConstraints.anchor = GridBagConstraints.EAST;
        targetPanelConstraints.fill = GridBagConstraints.BOTH;
        targetPanelConstraints.gridx = 2;
        targetPanelConstraints.gridy = 0;
        targetPanelConstraints.weightx = 0.4;
        targetPanelConstraints.weighty = 1.0;
        targetPanelConstraints.gridheight = 1;
        targetPanelConstraints.gridwidth = 1;
        targetPanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel targetPanel = new JPanel();
        GridBagLayout targetPanelGridbag = new GridBagLayout();
        targetPanel.setOpaque(false);
        targetPanel.setLayout(targetPanelGridbag);
        this.standardPanel.add(targetPanel, targetPanelConstraints);

        GridBagConstraints targetFileLabelConstraints = new GridBagConstraints();
        targetFileLabelConstraints.anchor = GridBagConstraints.EAST;
        targetFileLabelConstraints.fill = GridBagConstraints.BOTH;
        targetFileLabelConstraints.gridx = 0;
        targetFileLabelConstraints.gridy = 0;
        targetFileLabelConstraints.weightx = 1.0;
        targetFileLabelConstraints.weighty = 1.0;
        targetFileLabelConstraints.gridheight = 1;
        targetFileLabelConstraints.gridwidth = 1;
        targetFileLabelConstraints.insets = new Insets(5, 5, 5, 5);

        // Create a label to put messages during an action event.
        String targetPath = "No File Specified";
        if ((result != null) && (result.getTarget() != null)) {
            File targetFile = result.getTarget().getFile();
            if ((targetFile == null) || (!targetFile.exists())) {
                targetPath = "File does not exist in target location.";
            } else {
                targetPath = targetFile.getPath();
            }
            targetFile = null;
        }
        JLabel targetFileLabel = new JLabel(targetPath);
        targetPath = null;
        targetPanel.add(targetFileLabel, targetFileLabelConstraints);

        GridBagConstraints targetAttributesPanelConstraints = new GridBagConstraints();
        targetAttributesPanelConstraints.anchor = GridBagConstraints.EAST;
        targetAttributesPanelConstraints.fill = GridBagConstraints.BOTH;
        targetAttributesPanelConstraints.gridx = 0;
        targetAttributesPanelConstraints.gridy = 1;
        targetAttributesPanelConstraints.weightx = 1.0;
        targetAttributesPanelConstraints.weighty = 1.0;
        targetAttributesPanelConstraints.gridheight = 1;
        targetAttributesPanelConstraints.gridwidth = 1;
        targetAttributesPanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel targetAttributesPanel = this.createFileAttributesPanel(targetReference, sourceReference,
                GridBagConstraints.EAST);
        targetPanel.add(targetAttributesPanel, targetAttributesPanelConstraints);

        sourceReference = null;
        targetReference = null;

        this.moreTargetAttributesButton.setHorizontalAlignment(SwingConstants.RIGHT);
        this.moreTargetAttributesButton.setBorderPainted(false);
        this.moreTargetAttributesButton.setOpaque(false);
        this.moreTargetAttributesButton.setForeground(Color.blue);

        if (this.editable) {
            this.moreTargetAttributesButton.setText("All attributes...");
            this.moreTargetAttributesButton.addActionListener(this);
            this.moreTargetAttributesButton.setEnabled(true);
        } else {
            this.moreTargetAttributesButton.setText(" ");
            this.moreTargetAttributesButton.setEnabled(false);
        }
        this.moreTargetAttributesButton.setActionCommand(AssuranceActions.targetAttributesAction);

        GridBagConstraints moreTargetAttributesButtonConstraints = new GridBagConstraints();
        moreTargetAttributesButtonConstraints.anchor = GridBagConstraints.EAST;
        moreTargetAttributesButtonConstraints.fill = GridBagConstraints.BOTH;
        moreTargetAttributesButtonConstraints.gridx = 0;
        moreTargetAttributesButtonConstraints.gridy = 2;
        moreTargetAttributesButtonConstraints.weightx = 1.0;
        moreTargetAttributesButtonConstraints.weighty = 1.0;
        moreTargetAttributesButtonConstraints.gridheight = 1;
        moreTargetAttributesButtonConstraints.gridwidth = 1;
        moreTargetAttributesButtonConstraints.insets = new Insets(0, 0, 0, 0);
        targetPanel.add(this.moreTargetAttributesButton, moreTargetAttributesButtonConstraints);

        GridBagLayout mergingPanelGridbag = new GridBagLayout();
        this.mergingPanel.setLayout(mergingPanelGridbag);

        GridBagConstraints mergingLabelConstraints = new GridBagConstraints();
        mergingLabelConstraints.anchor = GridBagConstraints.NORTH;
        mergingLabelConstraints.fill = GridBagConstraints.BOTH;
        mergingLabelConstraints.gridx = 0;
        mergingLabelConstraints.gridy = 0;
        mergingLabelConstraints.weightx = 1.0;
        mergingLabelConstraints.weighty = 1.0;
        mergingLabelConstraints.gridheight = 1;
        mergingLabelConstraints.gridwidth = 1;
        mergingLabelConstraints.insets = new Insets(10, 10, 10, 10);

        this.mergingLabel.setHorizontalAlignment(JLabel.CENTER);
        mergingPanel.add(this.mergingLabel, mergingLabelConstraints);

        GridBagConstraints mergingStatusIndicatorConstraints = new GridBagConstraints();
        mergingStatusIndicatorConstraints.anchor = GridBagConstraints.SOUTH;
        mergingStatusIndicatorConstraints.fill = GridBagConstraints.BOTH;
        mergingStatusIndicatorConstraints.gridx = 0;
        mergingStatusIndicatorConstraints.gridy = 1;
        mergingStatusIndicatorConstraints.weightx = 1.0;
        mergingStatusIndicatorConstraints.weighty = 1.0;
        mergingStatusIndicatorConstraints.gridheight = 1;
        mergingStatusIndicatorConstraints.gridwidth = 1;
        mergingStatusIndicatorConstraints.insets = new Insets(10, 10, 10, 10);

        this.mergingProgressIndicator.setIndeterminate(true);

        mergingPanel.add(this.mergingProgressIndicator, mergingStatusIndicatorConstraints);

        this.addAncestorListener(new AncestorListener() {
            public void ancestorAdded(AncestorEvent event) {
                if (applicationDelegate != null) {
                    applicationDelegate.addEventObserver(ResultMergeStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(ResultMergeProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(ResultMergeCompletedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreCompletedEvent.class,
                            (IEventObserver) event.getSource());
                }
            }

            public void ancestorRemoved(AncestorEvent event) {
                if (applicationDelegate != null) {
                    applicationDelegate.removeEventObserver(ResultMergeStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(ResultMergeProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(ResultMergeCompletedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreCompletedEvent.class,
                            (IEventObserver) event.getSource());
                }
            }

            public void ancestorMoved(AncestorEvent event) {
            }
        });

        this.initialized = true;
    }
}