Ignore:
Timestamp:
08/31/20 16:26:59 (4 years ago)
Author:
bnemhaus
Message:

New feature: when creating a frameset, if the item being used is linked and you hold shift, it will use the items on the linked frame to populate the zero frame of the new frameset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1505 r1532  
    816816                        // create the new frameset
    817817                        Frame one = FrameIO.CreateFrameset(DELETED_FRAMES, toDelete
    818                                         .getPath());
     818                                        .getPath(), null);
    819819                        framePath = one.getPath();
    820820                        lastNumber = 0;
     
    10151015         * @param frameset
    10161016         *            The name of the Frameset to create
     1017         * @param zeroFrameItems TODO
    10171018         * @return The first Frame of the new Frameset (Frame.1)
    10181019         */
    1019         public static Frame CreateFrameset(String frameset, String path)
     1020        public static Frame CreateFrameset(String frameset, String path, Collection<Item> zeroFrameItems)
    10201021                        throws Exception {
    1021                 return CreateFrameset(frameset, path, false);
     1022                return CreateFrameset(frameset, path, false, zeroFrameItems);
    10221023        }
    10231024
     
    12571258                                } catch (RuntimeException e) {
    12581259                                        try {
    1259                                                 CreateFrameset(oldFramesetName, toSave.getPath());
     1260                                                CreateFrameset(oldFramesetName, toSave.getPath(), null);
    12601261                                                nextnum = 1;
    12611262                                        } catch (Exception e1) {
     
    15841585         * @param name
    15851586         *            The Frameset name to use
     1587         * @param zeroFrameItems TODO
    15861588         * @return The name of the first Frame in the newly created Frameset (the .1
    15871589         *         frame)
    15881590         */
    1589         public static Frame CreateNewFrameset(String name) throws Exception {
     1591        public static Frame CreateNewFrameset(String name, Collection<Item> zeroFrameItems) throws Exception {
    15901592                String path = DisplayController.getCurrentFrame().getPath();
    15911593
     
    15951597                }
    15961598
    1597                 Frame newFrame = FrameIO.CreateFrameset(name, path);
     1599                Frame newFrame = FrameIO.CreateFrameset(name, path, zeroFrameItems);
    15981600
    15991601                if (newFrame == null) {
    16001602                        // Cant create directories if the path is readonly or there is no
    16011603                        // space available
    1602                         newFrame = FrameIO.CreateFrameset(name, FrameIO.FRAME_PATH);
     1604                        newFrame = FrameIO.CreateFrameset(name, FrameIO.FRAME_PATH, zeroFrameItems);
    16031605                }
    16041606
     
    16101612        }
    16111613       
    1612         public static Frame CreateNewGroup(String name) {
     1614        public static Frame CreateNewGroup(String name, Collection<Item> zeroFrameItems) {
    16131615                try {
    1614                         Frame oneFrame = FrameIO.CreateFrameset(name, FrameIO.GROUP_PATH);
     1616                        Frame oneFrame = FrameIO.CreateFrameset(name, FrameIO.GROUP_PATH, zeroFrameItems);
    16151617                        oneFrame.setPermission(new PermissionTriple(UserAppliedPermission.full, UserAppliedPermission.none, UserAppliedPermission.none));
    16161618                       
     
    16941696        }
    16951697
    1696         public static Frame CreateFrameset(String frameset, String path, boolean recreate) throws InvalidFramesetNameException, ExistingFramesetException {
     1698        public static Frame CreateFrameset(String frameset, String path, boolean recreate, Collection<Item> zeroFrameItems) throws InvalidFramesetNameException, ExistingFramesetException {
    16971699                String conversion = frameset + " --> ";
    16981700
     
    17721774                base.setPath(path);
    17731775                base.change();
     1776                if (zeroFrameItems != null) {
     1777                        base.addAllItems(zeroFrameItems);
     1778                }
    17741779                SaveFrame(base, false);
    17751780
Note: See TracChangeset for help on using the changeset viewer.