Ignore:
Timestamp:
12/06/13 11:02:53 (10 years ago)
Author:
jts21
Message:

Get WebParsing via URL working. Kinda. (requires a JfxBrowser widget to have been loaded before it will work, and uses the wrong width for the page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Misc.java

    r575 r577  
    3636import org.expeditee.importer.FrameDNDTransferHandler;
    3737import org.expeditee.io.JavaWriter;
     38import org.expeditee.io.WebParser;
    3839import org.expeditee.io.flowlayout.XGroupItem;
    3940import org.expeditee.items.Item;
     
    13121313                }
    13131314        }
     1315       
     1316        public static void parsePage(Item text) throws Exception {
     1317                if (!(text instanceof Text) || !FreeItems.textOnlyAttachedToCursor()) {
     1318                        MessageBay.errorMessage("Must provide a text item.");
     1319                        return;
     1320                }
     1321                if(text.getLink() != null) {                                            // text item can't already have a link
     1322                        MessageBay.errorMessage("Text item already has link.");
     1323                        return;
     1324                }
     1325               
     1326                // Create JfxBrowser widget on a new frame
     1327                Frame frame = FrameIO.CreateNewFrame(text);                     // create new frame for browser
     1328                text.setLink("" + frame.getNumber());                           // link this text item to new frame
     1329                frame.addText(100, 100, "test", null);
     1330               
     1331                WebParser.parseURL(text.getText(), frame);
     1332                System.out.println(text.getText());
     1333        }
    13141334}
Note: See TracChangeset for help on using the changeset viewer.