Package uk.gov.nationalarchives.droid.gui

Examples of uk.gov.nationalarchives.droid.gui.ProfileForm


     * @param profile
     *            the active profile form.
     */
    @Override
    public void fireEvent(final ProfileInstance profile) {
        final ProfileForm activeProfile = context.getSelectedProfile();
        if (activeProfile == null || activeProfile.getProfile() == null) {
            setEnabled(saveAsAction, false); // save as - N
            setEnabled(saveAction, false); // save - N
            setEnabled(loadAction, true); // load - Y
            setEnabled(createAction, true); // new - Y
            setEnabled(runAction, false); // run - N
            setEnabled(stopAction, false); // stop - N
            setEnabled(resourceEditing, false); // add resource - N
            setEnabled(closeAction, false); // close - N
            setEnabled(exportAction, false); // export - N
            setEnabled(filterAction, false); // filter - N
            setEnabled(filterEnabledAction, false); // filter enabled - N
            setEnabled(reportAction, false); // report - N
        } else if (activeProfile.getProfile().equals(profile)) {
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    ProfileStateMachine state = states.get(profile.getState());
                    if (state != null) {
View Full Code Here


     * @param selectedFiles the files to add
     * @param recursive if any directories should be conisdered as recursive profile spec resources.
     */
    public void add(Collection<File> selectedFiles, boolean recursive) {
       
        ProfileForm selectedProfile = droidContext.getSelectedProfile();
        DefaultTreeModel treeModel = selectedProfile.getTreeModel();
        ProfileInstance profile = selectedProfile.getProfile();
        ProfileSpec profileSpec = profile.getProfileSpec();
       
        DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
        for (File selectedFile : selectedFiles) {
            AbstractProfileResource newResource;
View Full Code Here

        if (errorStrings.size() > 0) {
            JOptionPane.showMessageDialog(filterDialog, errorStrings.toArray());
        } else {
            filterDialog.getDroidContext().getSelectedProfile().getProfile().setDirty(true);
//            filterDialog.getDroidContext().getSelectedProfile().onResourceChanged();
            ProfileForm profileToFilter = filterDialog.getDroidContext().getSelectedProfile();
            ApplyFilterToTreeTableAction applyFilterToTreeAction =
                new ApplyFilterToTreeTableAction(profileToFilter, filterDialog.getProfileManager());
            applyFilterToTreeAction.applyFilter();
            filterDialog.dispatchEvent(new WindowEvent(filterDialog,  WindowEvent.WINDOW_CLOSING));
        }
View Full Code Here

    /**
     * Removes the selected items.
     */
    public void remove() {

        ProfileForm selectedProfile = droidContext.getSelectedProfile();

        DefaultTreeModel treeMdl = selectedProfile.getTreeModel();
        Outline outline = selectedProfile.getResultsOutline();
        ProfileInstance profile = selectedProfile.getProfile();

        int[] selectedRows = outline.getSelectedRows();

        for (int i = selectedRows.length; i > 0; i--) {
            // remove node from profile spec
            int index = selectedRows[i - 1];

            DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline
                    .getValueAt(index, 0);
            ProfileResourceNode prn = (ProfileResourceNode) treeNode
                    .getUserObject();
            if (profile.removeResource(prn.getUri())) {
                treeMdl.removeNodeFromParent(treeNode);
            }
        }

        profileManager.updateProfileSpec(
                selectedProfile.getProfile().getUuid(), profile
                        .getProfileSpec());
//        if (profile.isDirty()) {
//            selectedProfile.onResourceChanged();
//        }

View Full Code Here

        //FilterImpl filter = droidContext.getSelectedProfile().getProfile().getFilter();
        droidContext.getSelectedProfile().getProfile().setFilter(filterContext);
       
        if (applyValuesToContext()) {
            getDroidContext().getSelectedProfile().getProfile().setDirty(true);
            ProfileForm profileToFilter = getDroidContext().getSelectedProfile();
            ApplyFilterToTreeTableAction applyFilterToTreeAction =
                new ApplyFilterToTreeTableAction(profileToFilter, getProfileManager());
            applyFilterToTreeAction.applyFilter();
            dispatchEvent(new WindowEvent(this,  WindowEvent.WINDOW_CLOSING));
        }
View Full Code Here

    /**
     * Stops the profile.
     */
    public void stop() {
        ProfileForm selectedProfile = droidContext.getSelectedProfile();
        profileManager.stop(selectedProfile.getProfile().getUuid());
    }
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.gui.ProfileForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.