Source Code Cross Referenced for DomProvider.java in  » IDE-Netbeans » visualweb.api.designer » org » netbeans » modules » visualweb » api » designer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » org.netbeans.modules.visualweb.api.designer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:
042:        package org.netbeans.modules.visualweb.api.designer;
043:
044:        import java.awt.Dimension;
045:        import java.awt.Graphics2D;
046:        import java.awt.Point;
047:        import java.awt.datatransfer.DataFlavor;
048:        import java.awt.datatransfer.Transferable;
049:        import java.net.URL;
050:        import java.util.EventListener;
051:        import javax.swing.JComponent;
052:        import org.netbeans.modules.visualweb.api.designer.Designer.Box;
053:        import org.netbeans.modules.visualweb.api.designer.DomProvider.DomPosition.Bias;
054:        import org.netbeans.modules.visualweb.spi.designer.Decoration;
055:        import org.netbeans.spi.palette.PaletteController;
056:        import org.w3c.dom.Document;
057:        import org.w3c.dom.DocumentFragment;
058:        import org.w3c.dom.Element;
059:        import org.w3c.dom.Node;
060:
061:        /**
062:         *
063:         * @author Peter Zavadsky
064:         */
065:        public interface DomProvider {
066:
067:            //    public interface DomProviderListener extends EventListener {
068:            //        public void modelChanged();
069:            //        public void modelRefreshed();
070:            //        public void nodeChanged(Node rendered, Node parent, boolean wasMove);
071:            //        public void nodeRemoved(Node previouslyRendered, Node parent);
072:            //        public void nodeInserted(Node rendered, Node parent);
073:            //        public void updateErrorsInComponent();
074:            //        public void gridModeUpdated(boolean gridMode);
075:            //        public void documentReplaced();
076:            //        public void showDropMatch(MarkupDesignBean markupDesignBean, MarkupMouseRegion markupMouseRegion, int dropType);
077:            //        public void showDropMatch(Element componentRootElement, Element regionElement, int dropType);
078:            //        public void clearDropMatch();
079:            //        public void select(DesignBean designBean);
080:            //        public void select(Element componentRootElement);
081:            //        public void refreshForm(boolean deep);
082:            //        public void inlineEdit(DesignBean[] designBeans);
083:            //        public void inlineEdit(Element[] componentRootElements);
084:            //        public void designContextActivated(DesignContext designContext);
085:            //        public void designContextDeactivated(DesignContext designContext);
086:            //        public void designContextChanged(DesignContext designContext);
087:            //        public void designBeanCreated(DesignBean designBean);
088:            //        public void designBeanDeleted(DesignBean designBean);
089:            //        public void designBeanMoved(DesignBean designBean, DesignBean designBean0, Position position);
090:            //        public void designBeanContextActivated(DesignBean designBean);
091:            //        public void designBeanContextDeactivated(DesignBean designBean);
092:            //        public void designBeanNameChanged(DesignBean designBean, String string);
093:            //        public void designBeanChanged(DesignBean designBean);
094:            //        public void designPropertyChanged(DesignProperty designProperty, Object object);
095:            //        public void designEventChanged(DesignEvent designEvent);
096:            // XXX Better name, better design needed.
097:            //        public void designContextGenerationChanged();
098:            //    } // End of DomProviderListener.
099:
100:            //    public void addDomProviderListener(DomProviderListener l);
101:            //    public void removeDomProviderListener(DomProviderListener l);
102:
103:            /** Gets html document. */
104:            public Document getHtmlDom();
105:
106:            //    /** XXX Gets html document fragment. Containing the 'rendered' tree.
107:            //     * FIXME This should be in the document directly. */
108:            //    public DocumentFragment getHtmlDocumentFragment();
109:
110:            /** XXX Gets the body element. */
111:            public Element getHtmlBody();
112:
113:            /** Gets <code>PaletteController</code> associated with this <code>DomProvider</code>. */
114:            public PaletteController getPaletteController();
115:
116:            //    //////
117:            //    // XXX Revise these methods
118:            //    public void requestRefresh();
119:            //    public void refreshModel(boolean deep);
120:            //    public void refreshProject();
121:            //    public void destroyDomSynchronizer();
122:            //    /** Until all modification stuff is moved to designer/jsf (from designer). */
123:            //    public void setUpdatesSuspended(MarkupDesignBean markupDesignBean, boolean suspend);
124:            //    public boolean isRefreshPending();
125:            //    public void attachContext();
126:            //    public void detachContext();
127:            //    public DocumentFragment createSourceFragment(MarkupDesignBean bean);
128:            //    public void requestChange(MarkupDesignBean bean);
129:            //    public void beanChanged(MarkupDesignBean bean);
130:            //    public void requestTextUpdate(MarkupDesignBean bean);
131:            //    // XXX
132:            //    //////
133:
134:            // >>> DnD
135:            //    public DataFlavor getImportFlavor(DataFlavor[] flavors);
136:            public boolean canImport(JComponent comp,
137:                    DataFlavor[] transferFlavors, Transferable transferable);
138:
139:            //    public DesignBean[] pasteBeans(Transferable t, DesignBean parent, MarkupPosition pos, Point location, CoordinateTranslator coordinateTranslator);
140:            //    public Element[] pasteComponents(Transferable t, Element parentComponentRootElement, Point location);
141:            //    public void importData(JComponent comp, Transferable t, Object transferData, Dimension dimension, Location location, CoordinateTranslator coordinateTranslator, int dropAction);
142:            //    public void importString(String string, Location location, CoordinateTranslator coordinateTranslator);
143:            //    public DesignBean findHtmlContainer(DesignBean parent);
144:            //    public String[] getClassNames(DisplayItem[] displayItems);
145:            //    public boolean importBean(DisplayItem[] items, DesignBean origParent, int nodePos, String facet, List createdBeans, Location location, CoordinateTranslator coordinateTranslator) throws IOException;
146:            //    public MarkupPosition getDefaultPositionUnderParent(DesignBean parent);
147:            //    public int computeActions(DesignBean droppee, Transferable transferable, boolean searchUp, int nodePos);
148:            public int computeActions(Element dropeeComponentRootElement,
149:                    Transferable transferable);
150:
151:            //    public DesignBean findParent(String className, DesignBean droppee, Node parentNode, boolean searchUp);
152:            //    public int processLinks(Element origElement, Class[] classes, List beans, boolean selectFirst, boolean handleLinks, boolean showLinkTarget);
153:            public int processLinks(Element origElement,
154:                    Element componentRootElement);
155:
156:            //    public boolean setDesignProperty(DesignBean bean, String attribute, int length);
157:            //    // XXX
158:            //    public boolean isBraveheartPage();
159:            //    // XXX
160:            //    public boolean isWoodstockPage();
161:
162:            //    public boolean canPasteTransferable(Transferable trans);
163:
164:            //    public void updateGridMode();
165:            public boolean isGridMode();
166:
167:            //    // XXX
168:            //    public interface CoordinateTranslator {
169:            //        public Point translateCoordinates(Element parent, int x, int y);
170:            //        public int snapX(int x);
171:            //        public int snapY(int y);
172:            //    }
173:
174:            //    // XXX
175:            //    public static class Location {
176:            //        public DesignBean droppee;
177:            //
178:            //        /** If true, the droppee was deliberately chosen rather than having been
179:            //         * inferred from for example a drop point in the canvas. This is typically
180:            //         * the case when you point at a bean in the application outline. */
181:            //
182:            //        //boolean droppeeChosen;
183:            //        public String facet;
184:            ////        RaveElement droppeeElement;
185:            //        public Element droppeeElement;
186:            //        public MarkupPosition pos;
187:            //        public Point coordinates;
188:            //        public Dimension size;
189:            //    }
190:            // <<< DnD
191:
192:            //    /** XXX TEMP. */
193:            //    public FacesModel getFacesModel();
194:
195:            //    public boolean isFragment();
196:            //    public boolean isPortlet();
197:
198:            //    public DataObject getJspDataObject();
199:
200:            public URL getBaseUrl();
201:
202:            public URL resolveUrl(String urlString);
203:
204:            //    public DocumentFragment renderHtmlForMarkupDesignBean(MarkupDesignBean markupDesignBean);
205:
206:            //    public Document getJspDom();
207:
208:            //    public void clearHtml();
209:
210:            //    // XXX
211:            //    public List<FileObject> getWebPageFileObjectsInThisProject();
212:
213:            //    // XXX
214:            ////    public boolean editEventHandlerForDesignBean(DesignBean designBean);
215:            //    public boolean editEventHandlerForComponent(Element componentRootElement);
216:
217:            //    public boolean canDropDesignBeansAtNode(DesignBean[] designBeans, Node node);
218:            public boolean canDropComponentsAtNode(
219:                    Element[] componentRootElements, Node node);
220:
221:            //    public boolean handleMouseClickForElement(Element element, int clickCount);
222:
223:            // XXX
224:            //    public boolean isNormalAndHasFacesBean(MarkupDesignBean markupDesignBean);
225:            //    public boolean isNormalAndHasFacesComponent(Element componentRootElement);
226:
227:            //    public boolean canHighlightMarkupDesignBean(MarkupDesignBean markupDesignBean);
228:
229:            //    public DesignBean createBean(String className, Node parent, Node before);
230:            //    // XXX Get rid of this too, there may not be any explicit modification in designer.
231:            //    /** @return Source element! */
232:            //    public Element createComponent(String className, Node parent, Node before);
233:
234:            //    public boolean isFormBean(DesignBean designBean);
235:
236:            //    // XXX Returns source element, get rid of it.
237:            //    public Element getDefaultParentMarkupBeanElement();
238:
239:            //    public boolean moveBean(DesignBean bean, Node parentNode, Node before);
240:
241:            //    public boolean setPrerenderedBean(MarkupDesignBean markupDesignBean, DocumentFragment documentFragment);
242:
243:            //    // XXX
244:            //    public MarkupDesignBean getMarkupDesignBeanEquivalentTo(MarkupDesignBean oldBean);
245:
246:            //    public org.openide.nodes.Node getRootBeanNode();
247:
248:            //    public void deleteBean(DesignBean designBean);
249:            //    public void deleteComponent(Element componentRootElement);
250:
251:            //    public boolean canCreateBean(String className, DesignBean parent, Position pos);
252:
253:            //    public DesignBean getDefaultParentBean();
254:            //    public Element getDefaultParentComponent();
255:
256:            //    // XXX
257:            //    public Exception getRenderFailure();
258:            //    public MarkupDesignBean getRenderFailureMarkupDesignBean();
259:            //    // XXX
260:            //    public void setRenderFailedValues(MarkupDesignBean renderFailureComponent, Exception renderFailureException);
261:            //    public void setRenderFailureValues();
262:            //    public boolean hasRenderFailure();
263:            //    public Exception getRenderFailureException();
264:            //    public MarkupDesignBean getRenderFailureComponent();
265:            //    public boolean hasRenderingErrors();
266:
267:            // XXX  Bad architecture, model itself should take care of its consistency.
268:            //    public void syncModel();
269:            //    public boolean isModelValid();
270:            //    public boolean isModelBusted();
271:
272:            //    // XXX  Bad architecture, model itself should take care of its consistency.
273:            //    public boolean isSourceDirty();
274:
275:            //    public Transferable copyBeans(DesignBean[] beans);
276:            //    public Transferable copyComponents(Element[] componentRootElements);
277:
278:            //    // XXX ErrorPanels
279:            //    // FIXME There should be cleaner mechanism provided.
280:            //    public ErrorPanel getErrorPanel(ErrorPanelCallback errorPanelCallback);
281:            //
282:            //    // XXX
283:            //    public interface ErrorPanel {
284:            //        public void updateErrors();
285:            //    } // End of  ErrorPanel.
286:            //    // XXX Hack for the impls. Ged rid of this.
287:            //    public interface ErrorPanelCallback {
288:            //        public void updateTopComponentForErrors();
289:            //        public void setRenderFailureShown(boolean shown);
290:            ////        public Exception getRenderFailure();
291:            ////        public MarkupDesignBean getRenderFailureComponent();
292:            //        public void handleRefresh(boolean showErrors);
293:            //    } // End of ErrorPanelCallback.
294:
295:            // XXX Lock hack
296:            //    public WriteLock writeLock(String message);
297:            //    public void writeUnlock(WriteLock writeLock);
298:            //    public boolean isWriteLocked();
299:            //    public interface WriteLock {
300:            //    }
301:            // XXX There should be no locking here, the designer is not thread safe (it should run in AWT thread only).
302:            //    public void readLock();
303:            //    public void readUnlock();
304:
305:            //    // XXX Get rid of this.
306:            //    public void setModelActivated(boolean activated);
307:
308:            //    public UndoRedo getUndoManager();
309:
310:            //    public DesignBean[] getBeansOfType(Class clazz);
311:
312:            //    public Project getProject();
313:
314:            //    // XXX Get rid of this.
315:            //    public Class getBeanClass(String className) throws ClassNotFoundException;
316:
317:            //    public boolean isPage();
318:
319:            //    public boolean isAlive();
320:
321:            //    // XXX Designer shoudn't know about class names at all.
322:            //    public String getImageComponentClassName();
323:
324:            //    // XXX Suspicous this way, provide better interface.
325:            //    public void paintVirtualForms(Graphics2D g, RenderContext renderContext);
326:            //    
327:            //    /** XXX Render Context. */
328:            //    public interface RenderContext {
329:            ////        public DesignBean[] getBeansOfType(Class clazz);
330:            //        public Dimension getVieportDimension();
331:            //        public Point getViewportPosition();
332:            //        public int getNonTabbedTextWidth(char[] s, int offset, int length, FontMetrics metrics);
333:            ////        public Rectangle getBoundsForDesignBean(DesignBean designBean);
334:            //        public Rectangle getBoundsForComponent(Element componentRootElement);
335:            //    } // End of RenderContext.
336:
337:            public boolean isFormComponent(Element componentRootElement);
338:
339:            // XXX
340:            /** State indicating that a drop is not allowed */
341:            public static final int DROP_DENIED = 0;
342:            /** State indicating that the drop is allowed and will cause a link */
343:            public static final int DROP_PARENTED = 1;
344:            /** State indicating that the drop is allowed and the bean will be
345:             *  parented by one of the beans under the cursor */
346:            public static final int DROP_LINKED = 2;
347:
348:            // XXX
349:            public int getDropType(
350:                    /*DesignBean origDroppee,*/Element origDropeeComponentRootElement,
351:                    Element droppeeElement, Transferable t, boolean linkOnly);
352:
353:            //    public int getDropTypeForClassNames(DesignBean origDroppee, Element droppeeElement, String[] classNames, DesignBean[] beans, boolean linkOnly);
354:            public int getDropTypeForComponent(
355:                    /*DesignBean origDroppee,*/Element origDropeeComponentRootElement,
356:                    Element droppeeElement, Element componentRootElement,
357:                    boolean linkOnly);
358:
359:            public Element getComponentRootElementEquivalentTo(
360:                    Element oldComponentRootElement);
361:
362:            public boolean canHighlightComponentRootElmenet(
363:                    Element componentRootElement);
364:
365:            public boolean moveComponent(Element componentRootElement,
366:                    Node parentNode, Node before);
367:
368:            //    // XXX Get rid of this (after all modifications of model are out of designer).
369:            //    public void setUpdatesSuspended(Element componentRootElement, boolean suspend);
370:
371:            // XXX TEMP How to provide the inline editing correctly.
372:            public InlineEditorSupport createInlineEditorSupport(
373:                    Element componentRootElement, String propertyName,
374:                    String xpath);
375:
376:            //    public void dumpHtmlMarkupForNode(org.openide.nodes.Node node);
377:
378:            public void importString(Designer designer, String string,
379:                    Point canvasPos, Node documentPosNode,
380:                    int documentPosOffset, Dimension dimension, boolean isGrid,
381:                    Element droppeeElement, Element dropeeComponentRootElement/*, Element defaultParentComponentRootElement, DomProvider.CoordinateTranslator coordinateTranslator*/);
382:
383:            public boolean importData(
384:                    Designer designer,
385:                    JComponent comp,
386:                    Transferable t, /*Object transferData,*/
387:                    Point canvasPos,
388:                    Node documentPosNode,
389:                    int documentPosOffset,
390:                    Dimension dimension,
391:                    boolean isGrid,
392:                    Element droppeeElement,
393:                    Element dropeeComponentRootElement/*, Element defaultParentComponentRootElement, DomProvider.CoordinateTranslator coordinateTranslator*/,
394:                    int dropAction);
395:
396:            // XXX
397:            public Designer[] getExternalDesigners(URL url);
398:
399:            public boolean hasCachedExternalFrames();
400:
401:            // XXX TEMP How to provide the inline editing correctly.
402:            public interface InlineEditorSupport {
403:                public String getValueSource();
404:
405:                public boolean isEditingAllowed();
406:
407:                public void unset();
408:
409:                public void setValue(String value);
410:
411:                public String getName();
412:
413:                //        public DocumentFragment createSourceFragment();
414:                public String expandHtmlEntities(String value, boolean warn);
415:
416:                public Element getRenderedElement();
417:
418:                public DomPosition getBeginPosition();
419:
420:                public DomPosition getEndPosition();
421:
422:                public DocumentFragment getFragment();
423:
424:                public Node getText();
425:
426:                // XXX AttributeInlineEditor only.
427:                public boolean prepareAttributeInlineEditor(boolean selectText);
428:
429:                public void cleanAttributeInlineEditor(boolean cancel);
430:
431:                public String getSpecialInitValue();
432:
433:                //        public String getValue();
434:                //        public String getDisplayName();
435:                //        public Method getWriteMethod();
436:                //        public void setViaWriteMethod(String value);
437:                public boolean isEscaped();
438:
439:                //        public void handleEvent(Event e);
440:                //        public void beanChanged();
441:                //        public void requestChange();
442:                //        public void clearPrerendered();
443:                //        public boolean setPrerendered(DocumentFragment fragment);
444:                //        public void setStyleParent(DocumentFragment fragment);
445:                //        // XXX For now it attaches it to the source document, it should change to the rendered document.
446:                //        public DocumentFragment renderDomFragment();
447:                //        public void setEndPosition(DomPosition endPosition);
448:
449:                // XXX FormComponentEditor only.
450:                public Node findXPathNodeForComponentRootElement(
451:                        Element componentRootElement);
452:            } // End of InlineEditorSupport.
453:
454:            ///////////////////
455:            // Text support >>>
456:            //    public DomDocument getDomDocument();
457:
458:            // XXX For now in its original bad state
459:            public interface DomDocument {
460:                public void addDomDocumentListener(DomDocumentListener listener);
461:
462:                public void removeDomDocumentListener(
463:                        DomDocumentListener listener);
464:
465:                //        public void insertString(DomPosition domPosition, String content);
466:                public boolean insertString(Designer designer,
467:                        DomRange domRange, String content);
468:
469:                public boolean deleteRangeContents(DomRange domRange);
470:
471:                //        public boolean reparentComponent(Element componentRootElement, DomPosition pos);
472:
473:                public boolean deleteNextChar(Designer designer,
474:                        DomRange domRange);
475:
476:                public boolean deletePreviousChar(Designer designer,
477:                        DomRange domRange);
478:
479:                public void deleteComponents(Element[] componentRootElements);
480:
481:                public String getRangeText(DomRange domRange);
482:
483:                // TODO Designer should provide listener, informing about user changes.
484:                public void moveComponents(Designer designer, Box[] boxes,
485:                        Point[] offstePoints, DomPosition pos, int newX,
486:                        int newY, boolean snapEnabled);
487:
488:                //        public void moveComponentTo(Box box, int x, int y);
489:
490:                public void resizeComponent(Designer designer,
491:                        Element componentRootElement, int newX, boolean xMoved,
492:                        int newY, boolean yMoved, int newWidth,
493:                        boolean widthChanged, int newHeight,
494:                        boolean heightChanged, Box box, boolean snapEnabled);
495:
496:                public void frontComponents(Box[] boxes);
497:
498:                public void backComponents(Box[] boxes);
499:            } // End of DomDocument.
500:
501:            public interface DomPosition {
502:
503:                public final DomPosition NONE = new NoneDomPosition();
504:
505:                public enum Bias {
506:                    FORWARD, BACKWARD
507:                }
508:
509:                public Node getNode();
510:
511:                public int getOffset();
512:
513:                public Bias getBias();
514:
515:                public boolean isEarlierThan(DomPosition domPosition);
516:
517:                public boolean isLaterThan(DomPosition domPosition);
518:
519:                public boolean isStrictlyEarlierThan(DomPosition domPosition);
520:
521:                public Element getTargetElement();
522:
523:                public boolean isInside(Element targetSourceElement);
524:
525:                // XXX Get rid of this, there should be rendered positions only.
526:                public boolean isRenderedPosition();
527:
528:                public DomPosition getRenderedPosition();
529:
530:                public boolean isSourcePosition();
531:
532:                public DomPosition getSourcePosition();
533:
534:                static class NoneDomPosition implements  DomPosition {
535:
536:                    private NoneDomPosition() {
537:                    }
538:
539:                    public Node getNode() {
540:                        return null;
541:                    }
542:
543:                    public int getOffset() {
544:                        return -1;
545:                    }
546:
547:                    public Bias getBias() {
548:                        return Bias.FORWARD;
549:                    }
550:
551:                    public boolean isEarlierThan(DomPosition domPosition) {
552:                        return false;
553:                    }
554:
555:                    public boolean isLaterThan(DomPosition domPosition) {
556:                        return false;
557:                    }
558:
559:                    public boolean isStrictlyEarlierThan(DomPosition domPosition) {
560:                        return false;
561:                    }
562:
563:                    public Element getTargetElement() {
564:                        return null;
565:                    }
566:
567:                    public boolean isInside(Element targetElement) {
568:                        return false;
569:                    }
570:
571:                    public boolean isRenderedPosition() {
572:                        return false;
573:                    }
574:
575:                    public DomPosition getRenderedPosition() {
576:                        return this ;
577:                    }
578:
579:                    public boolean isSourcePosition() {
580:                        return false;
581:                    }
582:
583:                    public DomPosition getSourcePosition() {
584:                        return this ;
585:                    }
586:                }; // End of NoneDomPosition.
587:
588:            } // End of DomPosition.
589:
590:            public interface DomRange {
591:
592:                public static final DomRange NONE = new NoneDomRange();
593:
594:                public DomPosition getDot();
595:
596:                public DomPosition getMark();
597:
598:                public void setDot(Node node, int offset, DomPosition.Bias bias);
599:
600:                public void setMark(Node node, int offset, DomPosition.Bias bias);
601:
602:                public void setRange(Node dotNode, int dotOffset,
603:                        Node markNode, int markOffset);
604:
605:                public void detach();
606:
607:                public DomPosition getFirstPosition();
608:
609:                public DomPosition getLastPosition();
610:
611:                public boolean isDot(DomPosition dot);
612:
613:                public boolean isEmpty();
614:
615:                public boolean isReadOnlyRegion();
616:
617:                static class NoneDomRange implements  DomRange {
618:                    public DomPosition getDot() {
619:                        return DomPosition.NONE;
620:                    }
621:
622:                    public DomPosition getMark() {
623:                        return DomPosition.NONE;
624:                    }
625:
626:                    public void setDot(Node node, int offset, Bias bias) {
627:                    }
628:
629:                    public void setMark(Node node, int offset, Bias bias) {
630:                    }
631:
632:                    public void setRange(Node dotNode, int dotOffset,
633:                            Node markNode, int markOffset) {
634:                    }
635:
636:                    public void detach() {
637:                    }
638:
639:                    public DomPosition getFirstPosition() {
640:                        return DomPosition.NONE;
641:                    }
642:
643:                    public DomPosition getLastPosition() {
644:                        return DomPosition.NONE;
645:                    }
646:
647:                    public boolean isDot(DomPosition dot) {
648:                        return dot == DomPosition.NONE;
649:                    }
650:
651:                    public boolean isEmpty() {
652:                        return true;
653:                    }
654:
655:                    public boolean isReadOnlyRegion() {
656:                        return true;
657:                    }
658:
659:                } // End of NoneDomRange.
660:            } // End of DomRange.
661:
662:            public interface DomDocumentListener extends EventListener {
663:                public void insertUpdate(DomDocumentEvent evt);
664:
665:                public void componentMoved(DomDocumentEvent evt);
666:
667:                public void componentsMoved(DomDocumentEvent evt);
668:
669:                public void componentMovedTo(DomDocumentEvent evt);
670:            } // End of DomDocumentListener.
671:
672:            public interface DomDocumentEvent {
673:                public DomDocument getDomDocument();
674:
675:                public DomPosition getDomPosition();
676:            } // End of DomDocumentEvent.
677:
678:            public DomDocument getDomDocument();
679:
680:            public int compareBoundaryPoints(Node endPointA, int offsetA,
681:                    Node endPointB, int offsetB);
682:
683:            public DomPosition createDomPosition(Node node, int offset,
684:                    DomPosition.Bias bias);
685:
686:            public DomPosition createDomPosition(Node node, boolean after);
687:
688:            public DomRange createDomRange(Node dotNode, int dotOffset,
689:                    Node markNode, int markOffset);
690:
691:            public DomPosition first(DomPosition dot, DomPosition mark);
692:
693:            public DomPosition last(DomPosition dot, DomPosition mark);
694:
695:            // Text support <<<
696:            ///////////////////
697:
698:            //    public void reuseCssStyle(DomProvider domProvider);
699:
700:            // XXX Get rid of this. There should be only rendered nodes here.
701:            public boolean isRenderedNode(Node node);
702:
703:            // XXX Temp till the TopComp move is cleaned up.
704:            //    public void tcUpdateErrors(Designer designer);
705:            //    public void tcDesignContextGenerationChanged(Designer designer);
706:            //    public void tcRequestActive(Designer designer);
707:
708:            // XXX
709:            //    public void tcEnableCutCopyDelete(Designer designer);
710:            //    public void tcDisableCutCopyDelete(Designer designer);
711:            //    public void tcSetActivatedNodes(Designer designer, org.openide.nodes.Node[] nodes);
712:            //    public org.openide.nodes.Node[] tcGetActivatedNodes(Designer designer);
713:            //    public void tcShowPopupMenu(Designer designer, int x, int y);
714:            //    public void tcShowPopupMenu(Designer designer, JPopupMenu popup, int x, int y);
715:            //    public void tcShowPopupMenuForEvent(Designer designer, MouseEvent evt);
716:
717:            //    public boolean tcImportComponentData(Designer designer, JComponent comp, Transferable t);
718:            //    public Point tcGetPastePosition(Designer designer);
719:            //    public void tcRepaint(Designer designer);
720:            //    public boolean tcSeenEscape(Designer designer, ActionEvent evt);
721:
722:            //    public void tcDeleteSelection(Designer designer);
723:
724:            // XXX
725:            public void paintDesignerDecorations(Graphics2D g, Designer designer);
726:
727:            // Decorations
728:            // XXX Provider corresponding property in the designer.
729:            public Decoration getDecoration(Element element);
730:
731:            // Preferences
732:            //    // XXX Rather provide corresponding properties in the Designer.
733:            //    public boolean isShowDecorations();
734:            //    public int getDefaultFontSize();
735:            //    public int getPageSizeWidth();
736:            //    public int getPageSizeHeight();
737:            //    public boolean isGridShow();
738:            //    public boolean isGridSnap();
739:            //    public int getGridWidth();
740:            //    public int getGridHeight();
741:            // XXX GridHandler?
742:            //    public int getGridTraceWidth();
743:            //    public int getGridTraceHeight();
744:            //    public int getGridOffset();
745:
746:            // XXX
747:            public DomProviderService getDomProviderService();
748:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.