Package org.nbgit

Examples of org.nbgit.StatusInfo


                        continue;
                    }
                    status = StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY;
                }

                files.put(file, new StatusInfo(status, null, false));
            }

        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here


                if (entry != null) {
                    continue;
                }
                int status = StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY;
                File file = new File(root, path);
                files.put(file, new StatusInfo(status, null, false));
            }

        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

        int share = SharabilityQuery.getSharability(file.getParentFile());
        if (share == SharabilityQuery.NOT_SHARABLE ||
                (share == SharabilityQuery.MIXED &&
                SharabilityQuery.getSharability(file) == SharabilityQuery.NOT_SHARABLE)) {
            return new StatusInfo(StatusInfo.STATUS_NOTVERSIONED_EXCLUDED, null, false);
        }
        int status = StatusInfo.STATUS_UNKNOWN;
        String name = getRelative(root, file);

        try {
            index = new IndexDiff(repo);
            index.diff();
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
            return new StatusInfo(status, null, false);
        }

        if (index.getAdded().contains(name)) {
            status = StatusInfo.STATUS_VERSIONED_ADDEDLOCALLY;
        } else if (index.getRemoved().contains(name)) {
            status = StatusInfo.STATUS_VERSIONED_REMOVEDLOCALLY;
        } else if (index.getMissing().contains(name)) {
            status = StatusInfo.STATUS_VERSIONED_DELETEDLOCALLY;
        } else if (index.getChanged().contains(name)) {
            status = StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY;
        } else if (index.getModified().contains(name)) {
            status = StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY;
        } else {
            status = StatusInfo.STATUS_VERSIONED_UPTODATE;
        }
        StatusInfo info = new StatusInfo(status, null, false);

        return info;
    }
View Full Code Here

        boolean allLocallyDeleted = true;
        StatusCache cache = Git.getInstance().getStatusCache();
        Set<File> files = GitUtils.getCurrentContext(null).getRootFiles();

        for (File file : files) {
            StatusInfo info = cache.getStatus(file);
            if (info.getStatus() != StatusInfo.STATUS_VERSIONED_DELETEDLOCALLY && info.getStatus() != StatusInfo.STATUS_VERSIONED_REMOVEDLOCALLY) {
                allLocallyDeleted = false;
            }
        }
        if (allLocallyDeleted) {
            item = menu.add(new RevertModificationsAction(loc.getString("CTL_PopupMenuItem_RevertDelete"), context));
View Full Code Here

            super(new JComboBox());
        }

        @Override
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            StatusInfo info = tableModel.getNode(sorter.modelIndex(row)).getInformation();
            int fileStatus = info.getStatus();
            JComboBox combo = (JComboBox) editorComponent;
            if (fileStatus == StatusInfo.STATUS_VERSIONED_DELETEDLOCALLY || fileStatus == StatusInfo.STATUS_VERSIONED_REMOVEDLOCALLY) {
                combo.setModel(new DefaultComboBoxModel(removeOptions));
            } else if ((fileStatus & StatusInfo.STATUS_IN_REPOSITORY) == 0) {
                if (info.isDirectory()) {
                    combo.setModel(new DefaultComboBoxModel(dirAddOptions));
                } else {
                    combo.setModel(new DefaultComboBoxModel(addOptions));
                }
            } else {
View Full Code Here

    }

    private boolean affectsView(PropertyChangeEvent event) {
        StatusCache.ChangedEvent changedEvent = (StatusCache.ChangedEvent) event.getNewValue();
        File file = changedEvent.getFile();
        StatusInfo oldInfo = changedEvent.getOldInfo();
        StatusInfo newInfo = changedEvent.getNewInfo();
        if (oldInfo == null) {
            if ((newInfo.getStatus() & displayStatuses) == 0) {
                return false;
            }
        } else {
            if ((oldInfo.getStatus() & displayStatuses) + (newInfo.getStatus() & displayStatuses) == 0) {
                return false;
            }
        }
        return context == null ? false : context.contains(file);
    }
View Full Code Here

TOP

Related Classes of org.nbgit.StatusInfo

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.