├── README ├── README.md ├── RichVisualForceEditor ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── icons │ ├── Thumbs.db │ ├── apexhelp.png │ ├── attribute.gif │ ├── developerhelp.png │ ├── editicon.png │ ├── editicon1.gif │ ├── git.png │ ├── gitcommit.png │ ├── gitpush.png │ ├── html.png │ ├── sample.gif │ ├── tag.gif │ └── xml.png ├── lib │ ├── jsch-0.1.8.jar │ └── org.eclipse.jgit-2.1.0.201209190230-r.jar ├── plugin.xml └── src │ └── com │ └── vf │ └── apex │ ├── Activator.java │ └── editor │ ├── ColorManager.java │ ├── IXMLColorConstants.java │ ├── NonRuleBasedDamagerRepairer.java │ ├── RichVisualForceEditor.java │ ├── TagRule.java │ ├── XMLConfiguration.java │ ├── XMLDocumentProvider.java │ ├── XMLDoubleClickStrategy.java │ ├── XMLPartitionScanner.java │ ├── XMLScanner.java │ ├── XMLTagScanner.java │ ├── XMLWhitespaceDetector.java │ ├── actions │ ├── ApexCodeHelpAction.java │ ├── DeveloperDocsHelpAction.java │ ├── GitCommitAction.java │ └── GitPushAction.java │ ├── assist │ ├── Attribute.java │ ├── ForceTagAssistProcessor.java │ ├── HTMLFourTagDefination.java │ ├── Tag.java │ ├── TagDefinations.java │ ├── VisualForceTagDefinition.java │ ├── apex.json │ └── old.tags │ ├── handlers │ └── ContextHelpKeyHandler.java │ ├── helper │ └── Helper.java │ ├── preferences │ ├── PreferenceConstants.java │ ├── PreferenceInitializer.java │ └── RichVisualForcePreferencePage.java │ ├── rules │ ├── CDataRule.java │ ├── EscapedCharRule.java │ ├── NonMatchingRule.java │ ├── StartTagRule.java │ ├── TagRule.java │ └── XMLTextPredicateRule.java │ └── scanners │ ├── CDataScanner.java │ ├── XMLPartitionScanner.java │ ├── XMLScanner.java │ ├── XMLTagScanner.java │ └── XMLTextScanner.java ├── RichVisualForceEditorFeature ├── .project ├── build.properties └── feature.xml └── RichVisualForceEditorUpdateSite ├── .project ├── artifacts.jar ├── content.jar ├── features ├── RichVisualForceEditorFeature_1.0.0.201111031623.jar ├── RichVisualForceEditorFeature_1.0.2.jar ├── RichVisualForceEditorFeature_1.0.3.5.jar ├── RichVisualForceEditorFeature_1.0.3.6.jar └── RichVisualForceEditorFeature_1.0.3.jar ├── index.html ├── plugins ├── RichVisualForceEditor_1.0.0.201111031623.jar ├── RichVisualForceEditor_1.0.2.jar ├── RichVisualForceEditor_1.0.3.5.jar ├── RichVisualForceEditor_1.0.3.6.jar └── RichVisualForceEditor_1.0.3.jar ├── site.xml └── web ├── site.css └── site.xsl /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/README -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Visual Force Editor Plugin # 2 | 3 | ### DOWNLOAD LINK 4 | you can download this plugin from following locations. 5 | http://goo.gl/psPsC 6 | 7 | ## Features ## 8 | * Html4 tag and attribute assistance 9 | * VisualForce tag and attribute assistance 10 | 11 | ## What I am planing for : ## 12 | * HTML5 tag support will be added to future versions 13 | * Only applicable tags will be visible inside tags like apex:param will only be visible for applicable parent tags 14 | * Display validation errors for apex and html tags 15 | * Used attributes will be removed from the suggestion box. 16 | * Suggestion box will also show some mark to show that tag is related to APEX, or HTML4, or HTML5 17 | * Proper Tag, Attribute, Text, Comment color scheme 18 | * Context sensitive help within IDE on pressing a hot key for visualforce tags. 19 | * Support for “plugin update site” for all known pros. 20 | * Support for dynamic update of tags and attributes, as per new Salesforce releases. 21 | 22 | ## How to install : ## 23 | 24 | * Copy VisualForce editor plugin jar to eclipse/plugin/ folder and restart your eclipse. 25 | 26 | ## How to use ## 27 | * plugin will automatically attach with .page (visualforce) pages and if not then open visualforce page with this editor. 28 | * Plugin will add a new Visualforce page editor option to your editor's list. 29 | * Open your apex visualforce file with VisualForce page editor 30 | * If you are creating a new visualforce file then please add at least one tag as top level parent tag. 31 | 32 | ## example ## 33 | 34 | <apex:page> 35 | <[press ctrl+space] ** 36 | </apex:page> 37 | 38 | -------------------------------------------------------------------------------- /RichVisualForceEditor/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RichVisualForceEditor/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | RichVisualForceEditor 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /RichVisualForceEditor/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Oct 24 15:25:40 IST 2012 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 5 | org.eclipse.jdt.core.compiler.compliance=1.5 6 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 8 | org.eclipse.jdt.core.compiler.source=1.5 9 | -------------------------------------------------------------------------------- /RichVisualForceEditor/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: RichVisualForceEditor 4 | Bundle-SymbolicName: RichVisualForceEditor; singleton:=true 5 | Bundle-Version: 1.0.0.qualifier 6 | Bundle-Activator: com.vf.apex.Activator 7 | Require-Bundle: org.eclipse.ui, 8 | org.eclipse.core.runtime, 9 | org.eclipse.jface.text, 10 | org.eclipse.ui.editors, 11 | org.eclipse.core.resources;bundle-version="3.5.2", 12 | org.eclipse.jgit 13 | Bundle-ActivationPolicy: lazy 14 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 15 | -------------------------------------------------------------------------------- /RichVisualForceEditor/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | icons/,\ 7 | 8 | jars.compile.order = lib/org.eclipse.jgit-2.1.0.201209190230-r.jar,\ 9 | lib/ 10 | bin.excludes = lib/org.eclipse.jgit-2.1.0.201209190230-r.jar 11 | 12 | -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/Thumbs.db -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/apexhelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/apexhelp.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/attribute.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/attribute.gif -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/developerhelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/developerhelp.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/editicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/editicon.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/editicon1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/editicon1.gif -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/git.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/gitcommit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/gitcommit.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/gitpush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/gitpush.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/html.png -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/sample.gif -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/tag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/tag.gif -------------------------------------------------------------------------------- /RichVisualForceEditor/icons/xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/icons/xml.png -------------------------------------------------------------------------------- /RichVisualForceEditor/lib/jsch-0.1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/lib/jsch-0.1.8.jar -------------------------------------------------------------------------------- /RichVisualForceEditor/lib/org.eclipse.jgit-2.1.0.201209190230-r.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditor/lib/org.eclipse.jgit-2.1.0.201209190230-r.jar -------------------------------------------------------------------------------- /RichVisualForceEditor/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 40 | 41 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 | 71 | 76 | 77 | 78 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 103 | 104 | 105 | 112 | 113 | 114 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/Activator.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex; 2 | 3 | import java.io.IOException; 4 | 5 | import org.eclipse.core.commands.Command; 6 | import org.eclipse.core.commands.ExecutionEvent; 7 | import org.eclipse.core.commands.ExecutionException; 8 | import org.eclipse.core.commands.IExecutionListener; 9 | import org.eclipse.core.commands.NotHandledException; 10 | import org.eclipse.jface.dialogs.MessageDialog; 11 | import org.eclipse.jface.resource.ImageDescriptor; 12 | import org.eclipse.jface.resource.ImageRegistry; 13 | import org.eclipse.jface.util.IPropertyChangeListener; 14 | import org.eclipse.jface.util.PropertyChangeEvent; 15 | import org.eclipse.jgit.api.Git; 16 | import org.eclipse.jgit.errors.ConfigInvalidException; 17 | import org.eclipse.jgit.lib.Repository; 18 | import org.eclipse.jgit.lib.StoredConfig; 19 | import org.eclipse.jgit.storage.file.FileRepository; 20 | import org.eclipse.ui.PlatformUI; 21 | import org.eclipse.ui.commands.ICommandService; 22 | import org.eclipse.ui.plugin.AbstractUIPlugin; 23 | import org.osgi.framework.BundleContext; 24 | 25 | import com.vf.apex.editor.actions.GitPushAction; 26 | import com.vf.apex.editor.preferences.PreferenceConstants; 27 | 28 | /** 29 | * The activator class controls the plug-in life cycle 30 | */ 31 | public class Activator extends AbstractUIPlugin{ 32 | 33 | // The plug-in ID 34 | public static final String PLUGIN_ID = "RichVisualForceEditor"; 35 | 36 | // The shared instance 37 | private static Activator plugin; 38 | 39 | //Image Registry 40 | private ImageRegistry registry = new ImageRegistry(); 41 | 42 | public static final String ICON_HTML = "_icon_html"; 43 | public static final String ICON_TAG = "_icon_tag"; 44 | public static final String ICON_ATTR = "_icon_attribute"; 45 | 46 | 47 | /** 48 | * The constructor 49 | */ 50 | public Activator() { 51 | } 52 | 53 | /* 54 | * (non-Javadoc) 55 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) 56 | */ 57 | public void start(BundleContext context) throws Exception { 58 | super.start(context); 59 | plugin = this; 60 | registry.put(ICON_HTML,ImageDescriptor.createFromURL(getBundle().getEntry("icons/html.png"))); 61 | registry.put(ICON_TAG,ImageDescriptor.createFromURL(getBundle().getEntry("icons/tag.gif"))); 62 | registry.put(ICON_ATTR,ImageDescriptor.createFromURL(getBundle().getEntry("icons/attribute.gif"))); 63 | 64 | getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener(){ 65 | public void propertyChange(PropertyChangeEvent event) { 66 | if(event.getProperty().startsWith("REPOSITORY")){ 67 | String repoPath = event.getNewValue().toString(); 68 | try { 69 | 70 | Git git = new Git( new FileRepository(repoPath + "/.git")); 71 | Repository repository = git.getRepository(); 72 | 73 | String head = repository.getFullBranch(); 74 | if (head!=null && head.startsWith("refs/heads/")) { 75 | System.out.println("Current branch is " + repository.getBranch()); 76 | //Map allRefs = repository.getAllRefs(); 77 | //Set additionalHaves = repository.getAdditionalHaves(); 78 | StoredConfig config = repository.getConfig(); 79 | config.load(); 80 | //RepositoryState repositoryState = repository.getRepositoryState(); 81 | //Map tags = repository.getTags(); 82 | System.out.println("GIT COnfig: " + config); 83 | }else{ 84 | MessageDialog.openError(getDefault().getWorkbench().getActiveWorkbenchWindow().getShell() , "Project Git Repository is not a valid repository", "Project Git Repository is not a valid repository. \n ProjectName: " + event.getProperty() + "\n Path: " + event.getNewValue()); 85 | } 86 | 87 | } catch (IOException e) { 88 | e.printStackTrace(); 89 | } catch (ConfigInvalidException e) { 90 | // TODO Auto-generated catch block 91 | e.printStackTrace(); 92 | } 93 | 94 | } 95 | 96 | } 97 | }); 98 | 99 | earlyStartup(); 100 | } 101 | 102 | /* 103 | * (non-Javadoc) 104 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) 105 | */ 106 | public void stop(BundleContext context) throws Exception { 107 | plugin = null; 108 | super.stop(context); 109 | } 110 | 111 | /** 112 | * Returns the shared instance 113 | * 114 | * @return the shared instance 115 | */ 116 | public static Activator getDefault() { 117 | return plugin; 118 | } 119 | 120 | /** 121 | * Returns an image descriptor for the image file at the given 122 | * plug-in relative path 123 | * 124 | * @param path the path 125 | * @return the image descriptor 126 | */ 127 | public static ImageDescriptor getImageDescriptor(String path) { 128 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 129 | } 130 | 131 | @Override 132 | public ImageRegistry getImageRegistry() { 133 | return registry; 134 | } 135 | 136 | public void earlyStartup() { 137 | // TODO Auto-generated method stub 138 | String commandId = "org.eclipse.ui.file.save"; 139 | ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class); 140 | Command command = service.getCommand(commandId); 141 | command.addExecutionListener(new IExecutionListener() { 142 | 143 | public void preExecute(String commandId, ExecutionEvent event) { 144 | // TODO Auto-generated method stub 145 | 146 | } 147 | 148 | public void postExecuteSuccess(String commandId, Object returnValue) { 149 | Boolean isCommitEnable = Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.ENABLE_GIT_COMMIT); 150 | if(isCommitEnable){ 151 | GitPushAction action = new GitPushAction(); 152 | action.run(null); 153 | } 154 | } 155 | 156 | public void postExecuteFailure(String commandId, ExecutionException exception) { 157 | // TODO Auto-generated method stub 158 | 159 | } 160 | 161 | public void notHandled(String commandId, NotHandledException exception) { 162 | // TODO Auto-generated method stub 163 | 164 | } 165 | }); 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/ColorManager.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.Map; 6 | 7 | import org.eclipse.swt.graphics.Color; 8 | import org.eclipse.swt.graphics.RGB; 9 | import org.eclipse.swt.widgets.Display; 10 | 11 | public class ColorManager { 12 | 13 | protected Map fColorTable = new HashMap(10); 14 | 15 | public void dispose() { 16 | Iterator e = fColorTable.values().iterator(); 17 | while (e.hasNext()) 18 | ((Color) e.next()).dispose(); 19 | } 20 | public Color getColor(RGB rgb) { 21 | Color color = (Color) fColorTable.get(rgb); 22 | if (color == null) { 23 | color = new Color(Display.getCurrent(), rgb); 24 | fColorTable.put(rgb, color); 25 | } 26 | return color; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/IXMLColorConstants.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.swt.graphics.RGB; 4 | 5 | public interface IXMLColorConstants { 6 | RGB XML_COMMENT = new RGB(128, 0, 0); 7 | RGB PROC_INSTR = new RGB(128, 128, 128); 8 | RGB STRING = new RGB(0, 128, 0); 9 | RGB DEFAULT = new RGB(0, 0, 0); 10 | RGB TAG = new RGB(0, 0, 128); 11 | RGB CDATA = new RGB(0, 0, 128); 12 | RGB ESCAPED_CHAR = new RGB(0, 0, 128); 13 | RGB CDATA_TEXT = new RGB(0, 0, 128); 14 | RGB DOCTYPE = new RGB(0, 128, 0); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/NonRuleBasedDamagerRepairer.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.BadLocationException; 4 | import org.eclipse.jface.text.DocumentEvent; 5 | import org.eclipse.jface.text.IDocument; 6 | import org.eclipse.jface.text.IRegion; 7 | import org.eclipse.jface.text.ITypedRegion; 8 | import org.eclipse.jface.text.Region; 9 | import org.eclipse.jface.text.TextAttribute; 10 | import org.eclipse.jface.text.TextPresentation; 11 | import org.eclipse.jface.text.presentation.IPresentationDamager; 12 | import org.eclipse.jface.text.presentation.IPresentationRepairer; 13 | import org.eclipse.core.runtime.Assert; 14 | import org.eclipse.swt.custom.StyleRange; 15 | 16 | public class NonRuleBasedDamagerRepairer 17 | implements IPresentationDamager, IPresentationRepairer { 18 | 19 | /** The document this object works on */ 20 | protected IDocument fDocument; 21 | /** The default text attribute if non is returned as data by the current token */ 22 | protected TextAttribute fDefaultTextAttribute; 23 | 24 | /** 25 | * Constructor for NonRuleBasedDamagerRepairer. 26 | */ 27 | public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) { 28 | Assert.isNotNull(defaultTextAttribute); 29 | 30 | fDefaultTextAttribute = defaultTextAttribute; 31 | } 32 | 33 | /** 34 | * @see IPresentationRepairer#setDocument(IDocument) 35 | */ 36 | public void setDocument(IDocument document) { 37 | fDocument = document; 38 | } 39 | 40 | /** 41 | * Returns the end offset of the line that contains the specified offset or 42 | * if the offset is inside a line delimiter, the end offset of the next line. 43 | * 44 | * @param offset the offset whose line end offset must be computed 45 | * @return the line end offset for the given offset 46 | * @exception BadLocationException if offset is invalid in the current document 47 | */ 48 | protected int endOfLineOf(int offset) throws BadLocationException { 49 | 50 | IRegion info = fDocument.getLineInformationOfOffset(offset); 51 | if (offset <= info.getOffset() + info.getLength()) 52 | return info.getOffset() + info.getLength(); 53 | 54 | int line = fDocument.getLineOfOffset(offset); 55 | try { 56 | info = fDocument.getLineInformation(line + 1); 57 | return info.getOffset() + info.getLength(); 58 | } catch (BadLocationException x) { 59 | return fDocument.getLength(); 60 | } 61 | } 62 | 63 | /** 64 | * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean) 65 | */ 66 | public IRegion getDamageRegion( 67 | ITypedRegion partition, 68 | DocumentEvent event, 69 | boolean documentPartitioningChanged) { 70 | if (!documentPartitioningChanged) { 71 | try { 72 | 73 | IRegion info = 74 | fDocument.getLineInformationOfOffset(event.getOffset()); 75 | int start = Math.max(partition.getOffset(), info.getOffset()); 76 | 77 | int end = 78 | event.getOffset() 79 | + (event.getText() == null 80 | ? event.getLength() 81 | : event.getText().length()); 82 | 83 | if (info.getOffset() <= end 84 | && end <= info.getOffset() + info.getLength()) { 85 | // optimize the case of the same line 86 | end = info.getOffset() + info.getLength(); 87 | } else 88 | end = endOfLineOf(end); 89 | 90 | end = 91 | Math.min( 92 | partition.getOffset() + partition.getLength(), 93 | end); 94 | return new Region(start, end - start); 95 | 96 | } catch (BadLocationException x) { 97 | } 98 | } 99 | 100 | return partition; 101 | } 102 | 103 | /** 104 | * @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion) 105 | */ 106 | public void createPresentation( 107 | TextPresentation presentation, 108 | ITypedRegion region) { 109 | addRange( 110 | presentation, 111 | region.getOffset(), 112 | region.getLength(), 113 | fDefaultTextAttribute); 114 | } 115 | 116 | /** 117 | * Adds style information to the given text presentation. 118 | * 119 | * @param presentation the text presentation to be extended 120 | * @param offset the offset of the range to be styled 121 | * @param length the length of the range to be styled 122 | * @param attr the attribute describing the style of the range to be styled 123 | */ 124 | protected void addRange( 125 | TextPresentation presentation, 126 | int offset, 127 | int length, 128 | TextAttribute attr) { 129 | if (attr != null) 130 | presentation.addStyleRange( 131 | new StyleRange( 132 | offset, 133 | length, 134 | attr.getForeground(), 135 | attr.getBackground(), 136 | attr.getStyle())); 137 | } 138 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/RichVisualForceEditor.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.ui.editors.text.TextEditor; 4 | 5 | public class RichVisualForceEditor extends TextEditor { 6 | 7 | private ColorManager colorManager; 8 | 9 | public RichVisualForceEditor() { 10 | super(); 11 | colorManager = new ColorManager(); 12 | setSourceViewerConfiguration(new XMLConfiguration(colorManager)); 13 | setDocumentProvider(new XMLDocumentProvider()); 14 | } 15 | public void dispose() { 16 | colorManager.dispose(); 17 | super.dispose(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/TagRule.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.rules.*; 4 | 5 | public class TagRule extends MultiLineRule { 6 | 7 | public TagRule(IToken token) { 8 | super("<", ">", token); 9 | } 10 | protected boolean sequenceDetected( 11 | ICharacterScanner scanner, 12 | char[] sequence, 13 | boolean eofAllowed) { 14 | int c = scanner.read(); 15 | if (sequence[0] == '<') { 16 | if (c == '?') { 17 | // processing instruction - abort 18 | scanner.unread(); 19 | return false; 20 | } 21 | if (c == '!') { 22 | scanner.unread(); 23 | // comment - abort 24 | return false; 25 | } 26 | } else if (sequence[0] == '>') { 27 | scanner.unread(); 28 | } 29 | return super.sequenceDetected(scanner, sequence, eofAllowed); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.IDocument; 4 | import org.eclipse.jface.text.ITextDoubleClickStrategy; 5 | import org.eclipse.jface.text.TextAttribute; 6 | import org.eclipse.jface.text.contentassist.ContentAssistant; 7 | import org.eclipse.jface.text.contentassist.IContentAssistant; 8 | import org.eclipse.jface.text.presentation.IPresentationReconciler; 9 | import org.eclipse.jface.text.presentation.PresentationReconciler; 10 | import org.eclipse.jface.text.rules.DefaultDamagerRepairer; 11 | import org.eclipse.jface.text.rules.Token; 12 | import org.eclipse.jface.text.source.ISourceViewer; 13 | import org.eclipse.jface.text.source.SourceViewerConfiguration; 14 | 15 | import com.vf.apex.editor.assist.ForceTagAssistProcessor; 16 | import com.vf.apex.editor.scanners.XMLPartitionScanner; 17 | import com.vf.apex.editor.scanners.XMLScanner; 18 | import com.vf.apex.editor.scanners.XMLTagScanner; 19 | 20 | public class XMLConfiguration extends SourceViewerConfiguration { 21 | private XMLDoubleClickStrategy doubleClickStrategy; 22 | private XMLTagScanner tagScanner; 23 | private XMLScanner scanner; 24 | private ColorManager colorManager; 25 | 26 | public XMLConfiguration(ColorManager colorManager) { 27 | this.colorManager = colorManager; 28 | } 29 | public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { 30 | return new String[] { 31 | IDocument.DEFAULT_CONTENT_TYPE, 32 | XMLPartitionScanner.XML_COMMENT, 33 | XMLPartitionScanner.XML_TAG }; 34 | } 35 | public ITextDoubleClickStrategy getDoubleClickStrategy( 36 | ISourceViewer sourceViewer, 37 | String contentType) { 38 | if (doubleClickStrategy == null) 39 | doubleClickStrategy = new XMLDoubleClickStrategy(); 40 | return doubleClickStrategy; 41 | } 42 | 43 | protected XMLScanner getXMLScanner() { 44 | if (scanner == null) { 45 | scanner = new XMLScanner(colorManager); 46 | scanner.setDefaultReturnToken( 47 | new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.DEFAULT)))); 48 | } 49 | return scanner; 50 | } 51 | protected XMLTagScanner getXMLTagScanner() { 52 | if (tagScanner == null) { 53 | tagScanner = new XMLTagScanner(colorManager); 54 | tagScanner.setDefaultReturnToken( 55 | new Token( 56 | new TextAttribute( 57 | colorManager.getColor(IXMLColorConstants.TAG)))); 58 | } 59 | return tagScanner; 60 | } 61 | 62 | public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { 63 | PresentationReconciler reconciler = new PresentationReconciler(); 64 | 65 | DefaultDamagerRepairer dr = 66 | new DefaultDamagerRepairer(getXMLTagScanner()); 67 | reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG); 68 | reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG); 69 | 70 | dr = new DefaultDamagerRepairer(getXMLScanner()); 71 | reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); 72 | reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); 73 | 74 | NonRuleBasedDamagerRepairer ndr = 75 | new NonRuleBasedDamagerRepairer( 76 | new TextAttribute( 77 | colorManager.getColor(IXMLColorConstants.XML_COMMENT))); 78 | reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT); 79 | reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT); 80 | 81 | return reconciler; 82 | } 83 | 84 | public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) 85 | { 86 | 87 | ContentAssistant assistant = new ContentAssistant(); 88 | 89 | //assistant.setContentAssistProcessor(new TagContentAssistProcessor(getXMLTagScanner()), XMLPartitionScanner.XML_START_TAG); 90 | assistant.setContentAssistProcessor(new ForceTagAssistProcessor(), XMLPartitionScanner.XML_TAG); 91 | assistant.enableAutoActivation(true); 92 | assistant.setAutoActivationDelay(100); 93 | assistant.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW); 94 | assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW); 95 | return assistant; 96 | 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLDocumentProvider.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.core.runtime.CoreException; 4 | import org.eclipse.jface.text.IDocument; 5 | import org.eclipse.jface.text.IDocumentPartitioner; 6 | import org.eclipse.jface.text.rules.FastPartitioner; 7 | import org.eclipse.ui.editors.text.FileDocumentProvider; 8 | 9 | import com.vf.apex.editor.scanners.XMLPartitionScanner; 10 | 11 | public class XMLDocumentProvider extends FileDocumentProvider { 12 | 13 | protected IDocument createDocument(Object element) throws CoreException { 14 | IDocument document = super.createDocument(element); 15 | if (document != null) { 16 | IDocumentPartitioner partitioner = 17 | new FastPartitioner( 18 | new XMLPartitionScanner(), 19 | new String[] { 20 | XMLPartitionScanner.XML_TAG, 21 | XMLPartitionScanner.XML_COMMENT }); 22 | partitioner.connect(document); 23 | document.setDocumentPartitioner(partitioner); 24 | } 25 | return document; 26 | } 27 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLDoubleClickStrategy.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.*; 4 | 5 | public class XMLDoubleClickStrategy implements ITextDoubleClickStrategy { 6 | protected ITextViewer fText; 7 | 8 | public void doubleClicked(ITextViewer part) { 9 | int pos = part.getSelectedRange().x; 10 | 11 | if (pos < 0) 12 | return; 13 | 14 | fText = part; 15 | 16 | if (!selectComment(pos)) { 17 | selectWord(pos); 18 | } 19 | } 20 | protected boolean selectComment(int caretPos) { 21 | IDocument doc = fText.getDocument(); 22 | int startPos, endPos; 23 | 24 | try { 25 | int pos = caretPos; 26 | char c = ' '; 27 | 28 | while (pos >= 0) { 29 | c = doc.getChar(pos); 30 | if (c == '\\') { 31 | pos -= 2; 32 | continue; 33 | } 34 | if (c == Character.LINE_SEPARATOR || c == '\"') 35 | break; 36 | --pos; 37 | } 38 | 39 | if (c != '\"') 40 | return false; 41 | 42 | startPos = pos; 43 | 44 | pos = caretPos; 45 | int length = doc.getLength(); 46 | c = ' '; 47 | 48 | while (pos < length) { 49 | c = doc.getChar(pos); 50 | if (c == Character.LINE_SEPARATOR || c == '\"') 51 | break; 52 | ++pos; 53 | } 54 | if (c != '\"') 55 | return false; 56 | 57 | endPos = pos; 58 | 59 | int offset = startPos + 1; 60 | int len = endPos - offset; 61 | fText.setSelectedRange(offset, len); 62 | return true; 63 | } catch (BadLocationException x) { 64 | } 65 | 66 | return false; 67 | } 68 | protected boolean selectWord(int caretPos) { 69 | 70 | IDocument doc = fText.getDocument(); 71 | int startPos, endPos; 72 | 73 | try { 74 | 75 | int pos = caretPos; 76 | char c; 77 | 78 | while (pos >= 0) { 79 | c = doc.getChar(pos); 80 | if (!Character.isJavaIdentifierPart(c)) 81 | break; 82 | --pos; 83 | } 84 | 85 | startPos = pos; 86 | 87 | pos = caretPos; 88 | int length = doc.getLength(); 89 | 90 | while (pos < length) { 91 | c = doc.getChar(pos); 92 | if (!Character.isJavaIdentifierPart(c)) 93 | break; 94 | ++pos; 95 | } 96 | 97 | endPos = pos; 98 | selectRange(startPos, endPos); 99 | return true; 100 | 101 | } catch (BadLocationException x) { 102 | } 103 | 104 | return false; 105 | } 106 | 107 | private void selectRange(int startPos, int stopPos) { 108 | int offset = startPos + 1; 109 | int length = stopPos - offset; 110 | fText.setSelectedRange(offset, length); 111 | } 112 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLPartitionScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.rules.*; 4 | 5 | public class XMLPartitionScanner extends RuleBasedPartitionScanner { 6 | public final static String XML_COMMENT = "__xml_comment"; 7 | public final static String XML_TAG = "__xml_tag"; 8 | 9 | public XMLPartitionScanner() { 10 | 11 | IToken xmlComment = new Token(XML_COMMENT); 12 | IToken tag = new Token(XML_TAG); 13 | 14 | IPredicateRule[] rules = new IPredicateRule[2]; 15 | 16 | rules[0] = new MultiLineRule("", xmlComment); 17 | rules[1] = new TagRule(tag); 18 | 19 | setPredicateRules(rules); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.rules.*; 4 | import org.eclipse.jface.text.*; 5 | 6 | public class XMLScanner extends RuleBasedScanner { 7 | 8 | public XMLScanner(ColorManager manager) { 9 | IToken procInstr = 10 | new Token( 11 | new TextAttribute( 12 | manager.getColor(IXMLColorConstants.PROC_INSTR))); 13 | 14 | IRule[] rules = new IRule[2]; 15 | //Add rule for processing instructions 16 | rules[0] = new SingleLineRule("", procInstr); 17 | // Add generic whitespace rule. 18 | rules[1] = new WhitespaceRule(new XMLWhitespaceDetector()); 19 | 20 | setRules(rules); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLTagScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.*; 4 | import org.eclipse.jface.text.rules.*; 5 | 6 | public class XMLTagScanner extends RuleBasedScanner { 7 | 8 | public XMLTagScanner(ColorManager manager) { 9 | IToken string = 10 | new Token( 11 | new TextAttribute(manager.getColor(IXMLColorConstants.STRING))); 12 | 13 | IRule[] rules = new IRule[3]; 14 | 15 | // Add rule for double quotes 16 | rules[0] = new SingleLineRule("\"", "\"", string, '\\'); 17 | // Add a rule for single quotes 18 | rules[1] = new SingleLineRule("'", "'", string, '\\'); 19 | // Add generic whitespace rule. 20 | rules[2] = new WhitespaceRule(new XMLWhitespaceDetector()); 21 | 22 | setRules(rules); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/XMLWhitespaceDetector.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor; 2 | 3 | import org.eclipse.jface.text.rules.IWhitespaceDetector; 4 | 5 | public class XMLWhitespaceDetector implements IWhitespaceDetector { 6 | 7 | public boolean isWhitespace(char c) { 8 | return (c == ' ' || c == '\t' || c == '\n' || c == '\r'); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/actions/ApexCodeHelpAction.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.actions; 2 | 3 | import java.net.MalformedURLException; 4 | import java.net.URL; 5 | 6 | import org.eclipse.jface.action.IAction; 7 | import org.eclipse.jface.viewers.ISelection; 8 | import org.eclipse.ui.IWorkbenchWindow; 9 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; 10 | import org.eclipse.ui.PartInitException; 11 | import org.eclipse.ui.PlatformUI; 12 | import org.eclipse.ui.browser.IWebBrowser; 13 | import org.eclipse.ui.browser.IWorkbenchBrowserSupport; 14 | 15 | /** 16 | * Our sample action implements workbench action delegate. 17 | * The action proxy will be created by the workbench and 18 | * shown in the UI. When the user tries to use the action, 19 | * this delegate will be created and execution will be 20 | * delegated to it. 21 | * @see IWorkbenchWindowActionDelegate 22 | */ 23 | public class ApexCodeHelpAction implements IWorkbenchWindowActionDelegate { 24 | private IWorkbenchWindow window; 25 | /** 26 | * The constructor. 27 | */ 28 | public ApexCodeHelpAction() { 29 | } 30 | 31 | /** 32 | * The action has been activated. The argument of the 33 | * method represents the 'real' action sitting 34 | * in the workbench UI. 35 | * @see IWorkbenchWindowActionDelegate#run 36 | */ 37 | public void run(IAction action) { 38 | 39 | //System.out.println("action.getText---" + action.getText()); 40 | 41 | IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport(); 42 | IWebBrowser browser; 43 | try { 44 | 45 | 46 | browser = support.createBrowser(""+System.currentTimeMillis()); 47 | browser.openURL(new URL("http://www.salesforce.com/us/developer/docs/apexcode/index.htm")); 48 | } catch (PartInitException e) { 49 | // TODO Auto-generated catch block 50 | e.printStackTrace(); 51 | } catch (MalformedURLException e) { 52 | // TODO Auto-generated catch block 53 | e.printStackTrace(); 54 | } 55 | 56 | } 57 | 58 | /** 59 | * Selection in the workbench has been changed. We 60 | * can change the state of the 'real' action here 61 | * if we want, but this can only happen after 62 | * the delegate has been created. 63 | * @see IWorkbenchWindowActionDelegate#selectionChanged 64 | */ 65 | public void selectionChanged(IAction action, ISelection selection) { 66 | } 67 | 68 | /** 69 | * We can use this method to dispose of any system 70 | * resources we previously allocated. 71 | * @see IWorkbenchWindowActionDelegate#dispose 72 | */ 73 | public void dispose() { 74 | } 75 | 76 | /** 77 | * We will cache window object in order to 78 | * be able to provide parent shell for the message dialog. 79 | * @see IWorkbenchWindowActionDelegate#init 80 | */ 81 | public void init(IWorkbenchWindow window) { 82 | this.window = window; 83 | } 84 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/actions/DeveloperDocsHelpAction.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.actions; 2 | 3 | import java.net.MalformedURLException; 4 | import java.net.URL; 5 | 6 | import org.eclipse.jface.action.IAction; 7 | import org.eclipse.jface.viewers.ISelection; 8 | import org.eclipse.ui.IWorkbenchWindow; 9 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; 10 | import org.eclipse.ui.PartInitException; 11 | import org.eclipse.ui.PlatformUI; 12 | import org.eclipse.ui.browser.IWebBrowser; 13 | import org.eclipse.ui.browser.IWorkbenchBrowserSupport; 14 | 15 | /** 16 | * Our sample action implements workbench action delegate. 17 | * The action proxy will be created by the workbench and 18 | * shown in the UI. When the user tries to use the action, 19 | * this delegate will be created and execution will be 20 | * delegated to it. 21 | * @see IWorkbenchWindowActionDelegate 22 | */ 23 | public class DeveloperDocsHelpAction implements IWorkbenchWindowActionDelegate { 24 | private IWorkbenchWindow window; 25 | /** 26 | * The constructor. 27 | */ 28 | public DeveloperDocsHelpAction() { 29 | } 30 | 31 | /** 32 | * The action has been activated. The argument of the 33 | * method represents the 'real' action sitting 34 | * in the workbench UI. 35 | * @see IWorkbenchWindowActionDelegate#run 36 | */ 37 | public void run(IAction action) { 38 | 39 | //System.out.println("action.getText---" + action.getText()); 40 | 41 | IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport(); 42 | IWebBrowser browser; 43 | try { 44 | 45 | 46 | browser = support.createBrowser(""+System.currentTimeMillis()); 47 | browser.openURL(new URL("http://www.salesforce.com/us/developer/docs/pages/index.htm")); 48 | } catch (PartInitException e) { 49 | // TODO Auto-generated catch block 50 | e.printStackTrace(); 51 | } catch (MalformedURLException e) { 52 | // TODO Auto-generated catch block 53 | e.printStackTrace(); 54 | } 55 | 56 | } 57 | 58 | /** 59 | * Selection in the workbench has been changed. We 60 | * can change the state of the 'real' action here 61 | * if we want, but this can only happen after 62 | * the delegate has been created. 63 | * @see IWorkbenchWindowActionDelegate#selectionChanged 64 | */ 65 | public void selectionChanged(IAction action, ISelection selection) { 66 | } 67 | 68 | /** 69 | * We can use this method to dispose of any system 70 | * resources we previously allocated. 71 | * @see IWorkbenchWindowActionDelegate#dispose 72 | */ 73 | public void dispose() { 74 | } 75 | 76 | /** 77 | * We will cache window object in order to 78 | * be able to provide parent shell for the message dialog. 79 | * @see IWorkbenchWindowActionDelegate#init 80 | */ 81 | public void init(IWorkbenchWindow window) { 82 | this.window = window; 83 | } 84 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/actions/GitCommitAction.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.actions; 2 | 3 | import java.io.File; 4 | import java.text.DateFormat; 5 | 6 | import org.eclipse.core.resources.IProject; 7 | import org.eclipse.core.resources.ResourcesPlugin; 8 | import org.eclipse.jface.action.IAction; 9 | import org.eclipse.jface.dialogs.MessageDialog; 10 | import org.eclipse.jface.viewers.ISelection; 11 | import org.eclipse.jgit.api.Git; 12 | import org.eclipse.jgit.lib.Repository; 13 | import org.eclipse.ui.IWorkbenchWindow; 14 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; 15 | 16 | import com.vf.apex.Activator; 17 | import com.vf.apex.editor.helper.Helper; 18 | 19 | 20 | public class GitCommitAction implements IWorkbenchWindowActionDelegate { 21 | private IWorkbenchWindow window; 22 | /** 23 | * The constructor. 24 | */ 25 | public GitCommitAction() { 26 | } 27 | 28 | /** 29 | * The action has been activated. The argument of the 30 | * method represents the 'real' action sitting 31 | * in the workbench UI. 32 | * @see IWorkbenchWindowActionDelegate#run 33 | */ 34 | public void run(IAction action) { 35 | //System.out.println("action.getText---" + action.getText()); 36 | IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); 37 | Git git = null; 38 | try { 39 | for (IProject iProject : projects) { 40 | if(iProject.isOpen()){ 41 | String absolutePath = iProject.getLocation().toFile().getAbsolutePath(); 42 | String projectName = absolutePath.substring(absolutePath.lastIndexOf(File.separator)+1); 43 | Boolean isCommitEnable = Activator.getDefault().getPreferenceStore().getBoolean("COMMIT_ENABLE_"+projectName); 44 | String repoPath = Activator.getDefault().getPreferenceStore().getString("REPOSITORY_"+projectName); 45 | 46 | git = Git.open(new File(repoPath + "/.git")); 47 | Repository repository = git.getRepository(); 48 | 49 | String head = repository.getFullBranch(); 50 | if (head!=null && head.startsWith("refs/heads/")) { 51 | if(isCommitEnable){ 52 | Helper.copyDirectory(iProject.getLocation().toFile(), new File(repoPath)); 53 | //System.out.println("copying files ........ "); 54 | git.add().addFilepattern(".").call(); 55 | git.commit().setMessage("Auto commit via Rich Visualforce plugin " + DateFormat.getInstance().format(System.currentTimeMillis())).call(); 56 | } 57 | }else{ 58 | MessageDialog.openError(window.getShell() , "Project Git Repository is not a valid repository", 59 | "Project Git Repository is not a valid repository. \n ProjectName: " + projectName + "\n Path: " + repoPath); 60 | } 61 | } 62 | } 63 | } catch (Exception e) { 64 | e.printStackTrace(); 65 | } finally{ 66 | //System.out.println("closing git repo.. "); 67 | } 68 | 69 | } 70 | 71 | /** 72 | * Selection in the workbench has been changed. We 73 | * can change the state of the 'real' action here 74 | * if we want, but this can only happen after 75 | * the delegate has been created. 76 | * @see IWorkbenchWindowActionDelegate#selectionChanged 77 | */ 78 | public void selectionChanged(IAction action, ISelection selection) { 79 | } 80 | 81 | /** 82 | * We can use this method to dispose of any system 83 | * resources we previously allocated. 84 | * @see IWorkbenchWindowActionDelegate#dispose 85 | */ 86 | public void dispose() { 87 | } 88 | 89 | /** 90 | * We will cache window object in order to 91 | * be able to provide parent shell for the message dialog. 92 | * @see IWorkbenchWindowActionDelegate#init 93 | */ 94 | public void init(IWorkbenchWindow window) { 95 | this.window = window; 96 | } 97 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/actions/GitPushAction.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.actions; 2 | 3 | import java.io.File; 4 | import java.text.DateFormat; 5 | 6 | import org.eclipse.core.resources.IProject; 7 | import org.eclipse.core.resources.ResourcesPlugin; 8 | import org.eclipse.core.runtime.IProgressMonitor; 9 | import org.eclipse.jface.action.IAction; 10 | import org.eclipse.jface.dialogs.MessageDialog; 11 | import org.eclipse.jface.dialogs.ProgressMonitorDialog; 12 | import org.eclipse.jface.operation.IRunnableWithProgress; 13 | import org.eclipse.jface.viewers.ISelection; 14 | import org.eclipse.jgit.api.Git; 15 | import org.eclipse.jgit.lib.Repository; 16 | import org.eclipse.ui.IWorkbenchWindow; 17 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; 18 | 19 | import com.vf.apex.Activator; 20 | import com.vf.apex.editor.helper.Helper; 21 | 22 | /** 23 | * Our sample action implements workbench action delegate. 24 | * The action proxy will be created by the workbench and 25 | * shown in the UI. When the user tries to use the action, 26 | * this delegate will be created and execution will be 27 | * delegated to it. 28 | * @see IWorkbenchWindowActionDelegate 29 | */ 30 | public class GitPushAction implements IWorkbenchWindowActionDelegate { 31 | private IWorkbenchWindow window; 32 | /** 33 | * The constructor. 34 | */ 35 | public GitPushAction() { 36 | } 37 | 38 | 39 | private void close(Git git) { 40 | // really close the repository 41 | // decrement the use counter to 0 42 | if(git!=null){ 43 | for (int i = 0; i < 2; i++) { 44 | git.getRepository().close(); 45 | } 46 | } 47 | } 48 | 49 | /** 50 | * The action has been activated. The argument of the 51 | * method represents the 'real' action sitting 52 | * in the workbench UI. 53 | * @see IWorkbenchWindowActionDelegate#run 54 | */ 55 | public void run(IAction action) { 56 | 57 | System.out.println("testing..."); 58 | ProgressMonitorDialog dialog = new ProgressMonitorDialog(Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell()); 59 | try { 60 | dialog.run(true, true, new IRunnableWithProgress() { 61 | public void run(IProgressMonitor monitor) { 62 | //System.out.println("action.getText---" + action.getText()); 63 | IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); 64 | Git git = null; 65 | try { 66 | for (IProject iProject : projects) { 67 | if(iProject.isOpen()){ 68 | String absolutePath = iProject.getLocation().toFile().getAbsolutePath(); 69 | String projectName = absolutePath.substring(absolutePath.lastIndexOf(File.separator)+1); 70 | Boolean isCommitEnable = Activator.getDefault().getPreferenceStore().getBoolean("COMMIT_ENABLE_"+projectName); 71 | String repoPath = Activator.getDefault().getPreferenceStore().getString("REPOSITORY_"+projectName); 72 | 73 | git = Git.open(new File(repoPath + "/.git")); 74 | Repository repository = git.getRepository(); 75 | 76 | String head = repository.getFullBranch(); 77 | if (head!=null && head.startsWith("refs/heads/")) { 78 | if(isCommitEnable){ 79 | //new MyGitThread(new File(repoPath),iProject.getLocation().toFile()); 80 | git = Git.open(new File(repoPath + "/.git")); 81 | Helper.copyDirectory(iProject.getLocation().toFile(), new File(repoPath)); 82 | //System.out.println("copying files ........ "); 83 | git.add().addFilepattern(".").call(); 84 | git.commit().setMessage("Auto commit via Rich Visualforce plugin " + DateFormat.getInstance().format(System.currentTimeMillis())).call(); 85 | git.push().setPushAll().call(); 86 | } 87 | }else{ 88 | MessageDialog.openError(window.getShell() , "Project Git Repository is not a valid repository", 89 | "Project Git Repository is not a valid repository. \n ProjectName: " + projectName + "\n Path: " + repoPath); 90 | } 91 | } 92 | } 93 | } catch (Exception e) { 94 | e.printStackTrace(); 95 | } finally{ 96 | //System.out.println("closing git repo.. "); 97 | close(git); 98 | } 99 | } 100 | }); 101 | }catch(Exception e){ 102 | e.printStackTrace(); 103 | } 104 | 105 | } 106 | 107 | /** 108 | * Selection in the workbench has been changed. We 109 | * can change the state of the 'real' action here 110 | * if we want, but this can only happen after 111 | * the delegate has been created. 112 | * @see IWorkbenchWindowActionDelegate#selectionChanged 113 | */ 114 | public void selectionChanged(IAction action, ISelection selection) { 115 | } 116 | 117 | /** 118 | * We can use this method to dispose of any system 119 | * resources we previously allocated. 120 | * @see IWorkbenchWindowActionDelegate#dispose 121 | */ 122 | public void dispose() { 123 | } 124 | 125 | /** 126 | * We will cache window object in order to 127 | * be able to provide parent shell for the message dialog. 128 | * @see IWorkbenchWindowActionDelegate#init 129 | */ 130 | public void init(IWorkbenchWindow window) { 131 | this.window = window; 132 | } 133 | 134 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/assist/Attribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.vf.apex.editor.assist; 5 | /** 6 | * 7 | * @author eclipse and AjayHada 8 | * 9 | */ 10 | public class Attribute { 11 | 12 | private String name; 13 | private boolean hasValue; 14 | 15 | public Attribute(String attributeName){ 16 | this.name = attributeName; 17 | this.hasValue = true; 18 | } 19 | 20 | public Attribute(String attributeName,boolean hasValue){ 21 | this.name = attributeName; 22 | this.hasValue = hasValue; 23 | } 24 | 25 | public String getName(){ 26 | return this.name; 27 | } 28 | 29 | public boolean hasValue(){ 30 | return this.hasValue; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/assist/ForceTagAssistProcessor.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.assist; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Stack; 6 | 7 | import org.eclipse.jface.text.ITextViewer; 8 | import org.eclipse.jface.text.contentassist.CompletionProposal; 9 | import org.eclipse.jface.text.contentassist.ContextInformation; 10 | import org.eclipse.jface.text.contentassist.ContextInformationValidator; 11 | import org.eclipse.jface.text.contentassist.ICompletionProposal; 12 | import org.eclipse.jface.text.contentassist.IContentAssistProcessor; 13 | import org.eclipse.jface.text.contentassist.IContextInformation; 14 | import org.eclipse.jface.text.contentassist.IContextInformationValidator; 15 | import org.eclipse.swt.graphics.Image; 16 | 17 | import com.vf.apex.Activator; 18 | 19 | /** 20 | * 21 | * @author eclipse 22 | * 23 | */ 24 | public class ForceTagAssistProcessor implements IContentAssistProcessor { 25 | 26 | private char[] chars = {}; 27 | private Image tagImage; 28 | private Image attributeImage; 29 | 30 | 31 | public ForceTagAssistProcessor() { 32 | 33 | tagImage = Activator.getDefault().getImageRegistry().get(Activator.ICON_TAG); 34 | attributeImage = Activator.getDefault().getImageRegistry().get(Activator.ICON_ATTR); 35 | } 36 | 37 | public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, 38 | int documentOffset) { 39 | //System.out.println("computeCompletionProposals -- documentOffset - " + documentOffset); 40 | String text = viewer.getDocument().get().substring(0, documentOffset); 41 | String[] dim = getLastWord(text); 42 | String word = dim[0]; 43 | String prev = dim[1]; 44 | String last = dim[2]; 45 | 46 | List list = new ArrayList(); 47 | List tagList = TagDefinations.getAllTagsDefinationList(); 48 | 49 | if (word.startsWith("<") && !word.equals(""; 58 | position = 1; 59 | } else { 60 | assistKeyword = tagName + "/>"; 61 | position = 2; 62 | } 63 | 64 | 65 | list.add(new CompletionProposal(assistKeyword, 66 | documentOffset - word.length() + 1, 67 | word.length() - 1, tagName.length() + position, 68 | tagImage, tagName, null, null)); 69 | } 70 | } 71 | 72 | } else if (!prev.equals("")) { 73 | String tagName = prev; 74 | for (int i = 0; i < tagList.size(); i++) { 75 | Tag tagInfo = (Tag) tagList.get(i); 76 | if (tagInfo.getTagName().equals(tagName)) { 77 | Attribute[] attrList = tagInfo.getAttributes(); 78 | for (int j = 0; j < attrList.length; j++) { 79 | if (attrList[j].getName().indexOf(word) == 0) { 80 | String assistKeyword = null; 81 | int position = 0; 82 | if (attrList[j].hasValue()) { 83 | assistKeyword = attrList[j].getName() + "=\"\""; 84 | position = 2; 85 | } else { 86 | assistKeyword = attrList[j].getName(); 87 | position = 0; 88 | } 89 | list.add(new CompletionProposal(assistKeyword, 90 | documentOffset - word.length(), word.length(), attrList[j].getName().length() + position, 91 | attributeImage, attrList[j].getName(), 92 | null, null)); 93 | } 94 | } 95 | } 96 | } 97 | 98 | } else if (!last.equals("")) { 99 | String assistKeyword = ""; 100 | int length = 0; 101 | if (word.equals("') { 140 | prevTag = ""; 141 | } 142 | } else { 143 | sb.append(c); 144 | } 145 | } 146 | 147 | if (stack.size() != 0) { 148 | lastTag = (String) stack.pop(); 149 | } 150 | 151 | str = sb.toString(); 152 | // if(str.startsWith("<") && !str.startsWith("' || c == '<' || c == '*' || c == '^' || c == '{' 163 | || c == '}' || c == '[' || c == ']' || c == '"' || c == '\'') { 164 | return true; 165 | } else { 166 | return false; 167 | } 168 | } 169 | 170 | public IContextInformation[] computeContextInformation(ITextViewer viewer, 171 | int documentOffset) { 172 | 173 | ContextInformation[] info = new ContextInformation[0]; 174 | return info; 175 | } 176 | 177 | public char[] getCompletionProposalAutoActivationCharacters() { 178 | return chars; 179 | } 180 | 181 | public char[] getContextInformationAutoActivationCharacters() { 182 | return chars; 183 | } 184 | 185 | public IContextInformationValidator getContextInformationValidator() { 186 | return new ContextInformationValidator(this); 187 | } 188 | 189 | public String getErrorMessage() { 190 | return "Error"; 191 | } 192 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/assist/Tag.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.assist; 2 | 3 | import java.util.ArrayList; 4 | /** 5 | * 6 | * @author eclipse and AjayHada 7 | * 8 | */ 9 | public class Tag { 10 | 11 | private String name; 12 | private boolean hasBody; 13 | private ArrayList attributes = new ArrayList(); 14 | 15 | public Tag(String tagName,boolean hasBody){ 16 | this.name = tagName; 17 | this.hasBody = hasBody; 18 | } 19 | 20 | public Tag(String tagName,boolean hasBody,String[] attributeList){ 21 | this.name = tagName; 22 | this.hasBody = hasBody; 23 | for (String attributeName : attributeList) { 24 | attributes.add(new Attribute(attributeName)); 25 | } 26 | } 27 | 28 | public String getTagName(){ 29 | return this.name; 30 | } 31 | 32 | public boolean hasBody(){ 33 | return this.hasBody; 34 | } 35 | 36 | public void addAttribute(String attribute){ 37 | this.attributes.add(new Attribute(attribute)); 38 | } 39 | 40 | public Attribute[] getAttributes(){ 41 | return (Attribute[])this.attributes.toArray(new Attribute[this.attributes.size()]); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/assist/TagDefinations.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.assist; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class TagDefinations { 7 | 8 | public static List getAllTagsDefinationList() { 9 | ArrayList tagList = new ArrayList(); 10 | tagList.addAll(VisualForceTagDefinition.getTagInfoAsList()); 11 | tagList.addAll(HTMLFourTagDefination.getTagInfoAsList()); 12 | return tagList; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/assist/old.tags: -------------------------------------------------------------------------------- 1 | Tag a = new Tag("a",true); 2 | a.addAttribute(new Attribute("href",true)); 3 | a.addAttribute(new Attribute("name",true)); 4 | a.addAttribute(new Attribute("target",true)); 5 | a.addAttribute(new Attribute("charset",true)); 6 | a.addAttribute(new Attribute("hreflang",true)); 7 | a.addAttribute(new Attribute("methods",true)); 8 | a.addAttribute(new Attribute("rel",true)); 9 | a.addAttribute(new Attribute("rev",true)); 10 | a.addAttribute(new Attribute("type",true)); 11 | a.addAttribute(new Attribute("urn",true)); 12 | a.addAttribute(new Attribute("coords",true)); 13 | a.addAttribute(new Attribute("shape",true)); 14 | a.addAttribute(new Attribute("class",true)); 15 | a.addAttribute(new Attribute("dir",true)); 16 | a.addAttribute(new Attribute("id",true)); 17 | a.addAttribute(new Attribute("lang",true)); 18 | a.addAttribute(new Attribute("style",true)); 19 | a.addAttribute(new Attribute("title",true)); 20 | tagList.add(a); 21 | 22 | Tag abbr = new Tag("abbr",true); 23 | abbr.addAttribute(new Attribute("class",true)); 24 | abbr.addAttribute(new Attribute("dir",true)); 25 | abbr.addAttribute(new Attribute("id",true)); 26 | abbr.addAttribute(new Attribute("lang",true)); 27 | abbr.addAttribute(new Attribute("style",true)); 28 | abbr.addAttribute(new Attribute("title",true)); 29 | tagList.add(abbr); 30 | 31 | Tag acronym = new Tag("acronym",true); 32 | acronym.addAttribute(new Attribute("class",true)); 33 | acronym.addAttribute(new Attribute("dir",true)); 34 | acronym.addAttribute(new Attribute("id",true)); 35 | acronym.addAttribute(new Attribute("lang",true)); 36 | acronym.addAttribute(new Attribute("style",true)); 37 | acronym.addAttribute(new Attribute("title",true)); 38 | tagList.add(acronym); 39 | 40 | Tag address = new Tag("address",true); 41 | address.addAttribute(new Attribute("class",true)); 42 | address.addAttribute(new Attribute("dir",true)); 43 | address.addAttribute(new Attribute("id",true)); 44 | address.addAttribute(new Attribute("lang",true)); 45 | address.addAttribute(new Attribute("style",true)); 46 | address.addAttribute(new Attribute("title",true)); 47 | tagList.add(address); 48 | 49 | Tag applet = new Tag("applet",true); 50 | applet.addAttribute(new Attribute("alt",true)); 51 | applet.addAttribute(new Attribute("archive",true)); 52 | applet.addAttribute(new Attribute("code",true)); 53 | applet.addAttribute(new Attribute("codebase",true)); 54 | applet.addAttribute(new Attribute("align",true)); 55 | applet.addAttribute(new Attribute("height",true)); 56 | applet.addAttribute(new Attribute("hspace",true)); 57 | applet.addAttribute(new Attribute("vspace",true)); 58 | applet.addAttribute(new Attribute("width",true)); 59 | applet.addAttribute(new Attribute("class",true)); 60 | applet.addAttribute(new Attribute("id",true)); 61 | applet.addAttribute(new Attribute("name",true)); 62 | applet.addAttribute(new Attribute("style",true)); 63 | applet.addAttribute(new Attribute("title",true)); 64 | tagList.add(applet); 65 | 66 | Tag area = new Tag("area",false); 67 | area.addAttribute(new Attribute("shape",true)); 68 | area.addAttribute(new Attribute("coords",true)); 69 | area.addAttribute(new Attribute("href",true)); 70 | area.addAttribute(new Attribute("alt",true)); 71 | area.addAttribute(new Attribute("class",true)); 72 | area.addAttribute(new Attribute("dir",true)); 73 | area.addAttribute(new Attribute("id",true)); 74 | area.addAttribute(new Attribute("lang",true)); 75 | area.addAttribute(new Attribute("language",true)); 76 | area.addAttribute(new Attribute("name",true)); 77 | area.addAttribute(new Attribute("style",true)); 78 | area.addAttribute(new Attribute("title",true)); 79 | tagList.add(area); 80 | 81 | Tag b = new Tag("b",true); 82 | b.addAttribute(new Attribute("class",true)); 83 | b.addAttribute(new Attribute("dir",true)); 84 | b.addAttribute(new Attribute("id",true)); 85 | b.addAttribute(new Attribute("lang",true)); 86 | b.addAttribute(new Attribute("style",true)); 87 | b.addAttribute(new Attribute("title",true)); 88 | tagList.add(b); 89 | 90 | Tag base = new Tag("base",false); 91 | base.addAttribute(new Attribute("href",true)); 92 | base.addAttribute(new Attribute("target",true)); 93 | tagList.add(base); 94 | 95 | Tag basefont = new Tag("basefont",false); 96 | base.addAttribute(new Attribute("size",true)); 97 | base.addAttribute(new Attribute("color",true)); 98 | base.addAttribute(new Attribute("face",true)); 99 | base.addAttribute(new Attribute("class",true)); 100 | base.addAttribute(new Attribute("id",true)); 101 | base.addAttribute(new Attribute("lang",true)); 102 | base.addAttribute(new Attribute("style",true)); 103 | tagList.add(basefont); 104 | 105 | Tag bdo = new Tag("bdo",true); 106 | bdo.addAttribute(new Attribute("class",true)); 107 | bdo.addAttribute(new Attribute("dir",true)); 108 | bdo.addAttribute(new Attribute("id",true)); 109 | bdo.addAttribute(new Attribute("lang",true)); 110 | bdo.addAttribute(new Attribute("style",true)); 111 | bdo.addAttribute(new Attribute("title",true)); 112 | tagList.add(bdo); 113 | 114 | Tag bgsound = new Tag("bgsound",false); 115 | bgsound.addAttribute(new Attribute("balance",true)); 116 | bgsound.addAttribute(new Attribute("loop",true)); 117 | bgsound.addAttribute(new Attribute("src",true)); 118 | bgsound.addAttribute(new Attribute("volume",true)); 119 | bgsound.addAttribute(new Attribute("class",true)); 120 | bgsound.addAttribute(new Attribute("id",true)); 121 | bgsound.addAttribute(new Attribute("lang",true)); 122 | bgsound.addAttribute(new Attribute("title",true)); 123 | tagList.add(bgsound); 124 | 125 | Tag big = new Tag("big",true); 126 | big.addAttribute(new Attribute("class",true)); 127 | big.addAttribute(new Attribute("dir",true)); 128 | big.addAttribute(new Attribute("id",true)); 129 | big.addAttribute(new Attribute("lang",true)); 130 | big.addAttribute(new Attribute("style",true)); 131 | big.addAttribute(new Attribute("title",true)); 132 | tagList.add(big); 133 | 134 | Tag blink = new Tag("blink",true); 135 | blink.addAttribute(new Attribute("class",true)); 136 | blink.addAttribute(new Attribute("dir",true)); 137 | blink.addAttribute(new Attribute("id",true)); 138 | blink.addAttribute(new Attribute("lang",true)); 139 | blink.addAttribute(new Attribute("style",true)); 140 | blink.addAttribute(new Attribute("title",true)); 141 | tagList.add(blink); 142 | 143 | Tag blockquote = new Tag("blockquote",true); 144 | blockquote.addAttribute(new Attribute("cite",true)); 145 | blockquote.addAttribute(new Attribute("class",true)); 146 | blockquote.addAttribute(new Attribute("dir",true)); 147 | blockquote.addAttribute(new Attribute("id",true)); 148 | blockquote.addAttribute(new Attribute("lang",true)); 149 | blockquote.addAttribute(new Attribute("style",true)); 150 | blockquote.addAttribute(new Attribute("title",true)); 151 | tagList.add(blockquote); 152 | 153 | Tag body = new Tag("body",true); 154 | body.addAttribute(new Attribute("text",true)); 155 | body.addAttribute(new Attribute("link",true)); 156 | body.addAttribute(new Attribute("vlink",true)); 157 | body.addAttribute(new Attribute("alink",true)); 158 | body.addAttribute(new Attribute("bgcolor",true)); 159 | body.addAttribute(new Attribute("background",true)); 160 | body.addAttribute(new Attribute("marginheight",true)); 161 | body.addAttribute(new Attribute("marginwidth",true)); 162 | body.addAttribute(new Attribute("topmargin",true)); 163 | body.addAttribute(new Attribute("leftmargin",true)); 164 | body.addAttribute(new Attribute("bottommargin",true)); 165 | body.addAttribute(new Attribute("rightmargin",true)); 166 | body.addAttribute(new Attribute("scroll",true)); 167 | body.addAttribute(new Attribute("class",true)); 168 | body.addAttribute(new Attribute("dir",true)); 169 | body.addAttribute(new Attribute("id",true)); 170 | body.addAttribute(new Attribute("lang",true)); 171 | body.addAttribute(new Attribute("style",true)); 172 | body.addAttribute(new Attribute("title",true)); 173 | tagList.add(body); 174 | 175 | Tag br = new Tag("br",false); 176 | br.addAttribute(new Attribute("clear",true)); 177 | br.addAttribute(new Attribute("class",true)); 178 | br.addAttribute(new Attribute("id",true)); 179 | br.addAttribute(new Attribute("language",true)); 180 | br.addAttribute(new Attribute("style",true)); 181 | br.addAttribute(new Attribute("title",true)); 182 | tagList.add(br); 183 | 184 | Tag button = new Tag("button",true); 185 | button.addAttribute(new Attribute("disabled",false)); 186 | button.addAttribute(new Attribute("type",true)); 187 | button.addAttribute(new Attribute("value",true)); 188 | button.addAttribute(new Attribute("class",true)); 189 | button.addAttribute(new Attribute("dir",true)); 190 | button.addAttribute(new Attribute("id",true)); 191 | button.addAttribute(new Attribute("lang",true)); 192 | button.addAttribute(new Attribute("name",true)); 193 | button.addAttribute(new Attribute("style",true)); 194 | button.addAttribute(new Attribute("title",true)); 195 | tagList.add(button); 196 | 197 | Tag caption = new Tag("caption",true); 198 | caption.addAttribute(new Attribute("align",true)); 199 | caption.addAttribute(new Attribute("valign",true)); 200 | caption.addAttribute(new Attribute("class",true)); 201 | caption.addAttribute(new Attribute("dir",true)); 202 | caption.addAttribute(new Attribute("id",true)); 203 | caption.addAttribute(new Attribute("lang",true)); 204 | caption.addAttribute(new Attribute("style",true)); 205 | caption.addAttribute(new Attribute("title",true)); 206 | tagList.add(caption); 207 | 208 | Tag center = new Tag("center",true); 209 | center.addAttribute(new Attribute("class",true)); 210 | center.addAttribute(new Attribute("dir",true)); 211 | center.addAttribute(new Attribute("id",true)); 212 | center.addAttribute(new Attribute("lang",true)); 213 | center.addAttribute(new Attribute("style",true)); 214 | center.addAttribute(new Attribute("title",true)); 215 | tagList.add(center); 216 | 217 | Tag cite = new Tag("cite",true); 218 | cite.addAttribute(new Attribute("class",true)); 219 | cite.addAttribute(new Attribute("dir",true)); 220 | cite.addAttribute(new Attribute("id",true)); 221 | cite.addAttribute(new Attribute("lang",true)); 222 | cite.addAttribute(new Attribute("style",true)); 223 | cite.addAttribute(new Attribute("title",true)); 224 | tagList.add(cite); 225 | 226 | Tag code = new Tag("code",true); 227 | code.addAttribute(new Attribute("class",true)); 228 | code.addAttribute(new Attribute("dir",true)); 229 | code.addAttribute(new Attribute("id",true)); 230 | code.addAttribute(new Attribute("lang",true)); 231 | code.addAttribute(new Attribute("style",true)); 232 | code.addAttribute(new Attribute("title",true)); 233 | tagList.add(code); 234 | 235 | Tag col = new Tag("col",true); 236 | col.addAttribute(new Attribute("align",true)); 237 | col.addAttribute(new Attribute("bgcolor",true)); 238 | col.addAttribute(new Attribute("char",true)); 239 | col.addAttribute(new Attribute("charoff",true)); 240 | col.addAttribute(new Attribute("span",true)); 241 | col.addAttribute(new Attribute("valign",true)); 242 | col.addAttribute(new Attribute("width",true)); 243 | col.addAttribute(new Attribute("class",true)); 244 | col.addAttribute(new Attribute("dir",true)); 245 | col.addAttribute(new Attribute("id",true)); 246 | col.addAttribute(new Attribute("lang",true)); 247 | col.addAttribute(new Attribute("style",true)); 248 | col.addAttribute(new Attribute("title",true)); 249 | tagList.add(col); 250 | 251 | Tag colgroup = new Tag("colgroup",true); 252 | colgroup.addAttribute(new Attribute("align",true)); 253 | colgroup.addAttribute(new Attribute("bgcolor",true)); 254 | colgroup.addAttribute(new Attribute("char",true)); 255 | colgroup.addAttribute(new Attribute("charoff",true)); 256 | colgroup.addAttribute(new Attribute("span",true)); 257 | colgroup.addAttribute(new Attribute("valign",true)); 258 | colgroup.addAttribute(new Attribute("width",true)); 259 | colgroup.addAttribute(new Attribute("class",true)); 260 | colgroup.addAttribute(new Attribute("dir",true)); 261 | colgroup.addAttribute(new Attribute("id",true)); 262 | colgroup.addAttribute(new Attribute("lang",true)); 263 | colgroup.addAttribute(new Attribute("style",true)); 264 | colgroup.addAttribute(new Attribute("title",true)); 265 | tagList.add(colgroup); 266 | 267 | Tag comment = new Tag("comment",true); 268 | comment.addAttribute(new Attribute("id",true)); 269 | comment.addAttribute(new Attribute("lang",true)); 270 | tagList.add(comment); 271 | 272 | Tag dd = new Tag("dd",true); 273 | dd.addAttribute(new Attribute("class",true)); 274 | dd.addAttribute(new Attribute("dir",true)); 275 | dd.addAttribute(new Attribute("id",true)); 276 | dd.addAttribute(new Attribute("lang",true)); 277 | dd.addAttribute(new Attribute("style",true)); 278 | dd.addAttribute(new Attribute("title",true)); 279 | tagList.add(dd); 280 | 281 | Tag del = new Tag("del",true); 282 | del.addAttribute(new Attribute("cite",true)); 283 | del.addAttribute(new Attribute("datetime",true)); 284 | del.addAttribute(new Attribute("class",true)); 285 | del.addAttribute(new Attribute("dir",true)); 286 | del.addAttribute(new Attribute("id",true)); 287 | del.addAttribute(new Attribute("lang",true)); 288 | del.addAttribute(new Attribute("style",true)); 289 | del.addAttribute(new Attribute("title",true)); 290 | tagList.add(del); 291 | 292 | Tag dfn = new Tag("dfn",true); 293 | dfn.addAttribute(new Attribute("class",true)); 294 | dfn.addAttribute(new Attribute("dir",true)); 295 | dfn.addAttribute(new Attribute("id",true)); 296 | dfn.addAttribute(new Attribute("lang",true)); 297 | dfn.addAttribute(new Attribute("style",true)); 298 | dfn.addAttribute(new Attribute("title",true)); 299 | tagList.add(dfn); 300 | 301 | Tag dir = new Tag("dir",true); 302 | dir.addAttribute(new Attribute("compact",false)); 303 | dir.addAttribute(new Attribute("type",true)); 304 | dir.addAttribute(new Attribute("class",true)); 305 | dir.addAttribute(new Attribute("dir",true)); 306 | dir.addAttribute(new Attribute("id",true)); 307 | dir.addAttribute(new Attribute("lang",true)); 308 | dir.addAttribute(new Attribute("style",true)); 309 | dir.addAttribute(new Attribute("title",true)); 310 | tagList.add(dir); 311 | 312 | Tag div = new Tag("div",true); 313 | div.addAttribute(new Attribute("align",false)); 314 | div.addAttribute(new Attribute("class",true)); 315 | div.addAttribute(new Attribute("dir",true)); 316 | div.addAttribute(new Attribute("id",true)); 317 | div.addAttribute(new Attribute("lang",true)); 318 | div.addAttribute(new Attribute("style",true)); 319 | div.addAttribute(new Attribute("title",true)); 320 | tagList.add(div); 321 | 322 | Tag dl = new Tag("dl",true); 323 | dl.addAttribute(new Attribute("compact",false)); 324 | dl.addAttribute(new Attribute("class",true)); 325 | dl.addAttribute(new Attribute("dir",true)); 326 | dl.addAttribute(new Attribute("id",true)); 327 | dl.addAttribute(new Attribute("lang",true)); 328 | dl.addAttribute(new Attribute("style",true)); 329 | dl.addAttribute(new Attribute("title",true)); 330 | tagList.add(dl); 331 | 332 | Tag dt = new Tag("dt",true); 333 | dt.addAttribute(new Attribute("class",true)); 334 | dt.addAttribute(new Attribute("dir",true)); 335 | dt.addAttribute(new Attribute("id",true)); 336 | dt.addAttribute(new Attribute("lang",true)); 337 | dt.addAttribute(new Attribute("style",true)); 338 | dt.addAttribute(new Attribute("title",true)); 339 | tagList.add(dt); 340 | 341 | Tag em = new Tag("em",true); 342 | em.addAttribute(new Attribute("class",true)); 343 | em.addAttribute(new Attribute("dir",true)); 344 | em.addAttribute(new Attribute("id",true)); 345 | em.addAttribute(new Attribute("lang",true)); 346 | em.addAttribute(new Attribute("style",true)); 347 | em.addAttribute(new Attribute("title",true)); 348 | tagList.add(em); 349 | 350 | Tag embed = new Tag("embed",false); 351 | embed.addAttribute(new Attribute("src",true)); 352 | embed.addAttribute(new Attribute("align",true)); 353 | embed.addAttribute(new Attribute("height",true)); 354 | embed.addAttribute(new Attribute("hspace",true)); 355 | embed.addAttribute(new Attribute("vspace",true)); 356 | embed.addAttribute(new Attribute("units",true)); 357 | embed.addAttribute(new Attribute("border",true)); 358 | embed.addAttribute(new Attribute("frameborder",true)); 359 | embed.addAttribute(new Attribute("hidden",true)); 360 | embed.addAttribute(new Attribute("alt",true)); 361 | embed.addAttribute(new Attribute("code",true)); 362 | embed.addAttribute(new Attribute("codebase",true)); 363 | embed.addAttribute(new Attribute("type",true)); 364 | embed.addAttribute(new Attribute("palette",true)); 365 | embed.addAttribute(new Attribute("pluginspace",true)); 366 | embed.addAttribute(new Attribute("pluginurl",true)); 367 | embed.addAttribute(new Attribute("class",true)); 368 | embed.addAttribute(new Attribute("id",true)); 369 | embed.addAttribute(new Attribute("name",true)); 370 | embed.addAttribute(new Attribute("style",true)); 371 | embed.addAttribute(new Attribute("title",true)); 372 | tagList.add(embed); 373 | 374 | Tag fieldset = new Tag("fieldset",true); 375 | fieldset.addAttribute(new Attribute("align",true)); 376 | fieldset.addAttribute(new Attribute("class",true)); 377 | fieldset.addAttribute(new Attribute("dir",true)); 378 | fieldset.addAttribute(new Attribute("id",true)); 379 | fieldset.addAttribute(new Attribute("lang",true)); 380 | fieldset.addAttribute(new Attribute("style",true)); 381 | fieldset.addAttribute(new Attribute("title",true)); 382 | tagList.add(fieldset); 383 | 384 | Tag font = new Tag("font",true); 385 | font.addAttribute(new Attribute("size",true)); 386 | font.addAttribute(new Attribute("color",true)); 387 | font.addAttribute(new Attribute("face",true)); 388 | font.addAttribute(new Attribute("font-weight",true)); 389 | font.addAttribute(new Attribute("point-size",true)); 390 | font.addAttribute(new Attribute("class",true)); 391 | font.addAttribute(new Attribute("dir",true)); 392 | font.addAttribute(new Attribute("id",true)); 393 | font.addAttribute(new Attribute("lang",true)); 394 | font.addAttribute(new Attribute("style",true)); 395 | font.addAttribute(new Attribute("title",true)); 396 | tagList.add(font); 397 | 398 | Tag form = new Tag("form",true); 399 | form.addAttribute(new Attribute("action",true)); 400 | form.addAttribute(new Attribute("method",true)); 401 | form.addAttribute(new Attribute("target",true)); 402 | form.addAttribute(new Attribute("accept",true)); 403 | form.addAttribute(new Attribute("accept-charset",true)); 404 | form.addAttribute(new Attribute("autocomplete",true)); 405 | form.addAttribute(new Attribute("enctype",true)); 406 | form.addAttribute(new Attribute("urn",false)); 407 | form.addAttribute(new Attribute("class",true)); 408 | form.addAttribute(new Attribute("dir",true)); 409 | form.addAttribute(new Attribute("id",true)); 410 | form.addAttribute(new Attribute("lang",true)); 411 | form.addAttribute(new Attribute("name",true)); 412 | form.addAttribute(new Attribute("style",true)); 413 | form.addAttribute(new Attribute("title",true)); 414 | tagList.add(form); 415 | 416 | Tag frame = new Tag("frame",true); 417 | frame.addAttribute(new Attribute("src",true)); 418 | frame.addAttribute(new Attribute("height",true)); 419 | frame.addAttribute(new Attribute("width",true)); 420 | frame.addAttribute(new Attribute("bordercolor",true)); 421 | frame.addAttribute(new Attribute("frameborder",true)); 422 | frame.addAttribute(new Attribute("marginheight",true)); 423 | frame.addAttribute(new Attribute("marginwidth",true)); 424 | frame.addAttribute(new Attribute("noresize",false)); 425 | frame.addAttribute(new Attribute("scrolling",true)); 426 | frame.addAttribute(new Attribute("class",true)); 427 | frame.addAttribute(new Attribute("id",true)); 428 | frame.addAttribute(new Attribute("lang",true)); 429 | frame.addAttribute(new Attribute("language",true)); 430 | frame.addAttribute(new Attribute("name",true)); 431 | frame.addAttribute(new Attribute("style",true)); 432 | frame.addAttribute(new Attribute("title",true)); 433 | tagList.add(frame); 434 | 435 | Tag frameset = new Tag("frameset",true); 436 | frameset.addAttribute(new Attribute("border",true)); 437 | frameset.addAttribute(new Attribute("bordercolor",true)); 438 | frameset.addAttribute(new Attribute("cols",true)); 439 | frameset.addAttribute(new Attribute("frameborder",true)); 440 | frameset.addAttribute(new Attribute("framespacing",true)); 441 | frameset.addAttribute(new Attribute("rows",true)); 442 | frameset.addAttribute(new Attribute("class",true)); 443 | frameset.addAttribute(new Attribute("id",true)); 444 | frameset.addAttribute(new Attribute("lang",true)); 445 | frameset.addAttribute(new Attribute("language",true)); 446 | frameset.addAttribute(new Attribute("name",true)); 447 | frameset.addAttribute(new Attribute("style",true)); 448 | frameset.addAttribute(new Attribute("title",true)); 449 | tagList.add(frameset); 450 | 451 | Tag h1 = new Tag("h1",true); 452 | h1.addAttribute(new Attribute("align",true)); 453 | h1.addAttribute(new Attribute("class",true)); 454 | h1.addAttribute(new Attribute("dir",true)); 455 | h1.addAttribute(new Attribute("id",true)); 456 | h1.addAttribute(new Attribute("lang",true)); 457 | h1.addAttribute(new Attribute("style",true)); 458 | h1.addAttribute(new Attribute("title",true)); 459 | tagList.add(h1); 460 | 461 | Tag h2 = new Tag("h2",true); 462 | h2.addAttribute(new Attribute("align",true)); 463 | h2.addAttribute(new Attribute("class",true)); 464 | h2.addAttribute(new Attribute("dir",true)); 465 | h2.addAttribute(new Attribute("id",true)); 466 | h2.addAttribute(new Attribute("lang",true)); 467 | h2.addAttribute(new Attribute("style",true)); 468 | h2.addAttribute(new Attribute("title",true)); 469 | tagList.add(h2); 470 | 471 | Tag h3 = new Tag("h3",true); 472 | h3.addAttribute(new Attribute("align",true)); 473 | h3.addAttribute(new Attribute("class",true)); 474 | h3.addAttribute(new Attribute("dir",true)); 475 | h3.addAttribute(new Attribute("id",true)); 476 | h3.addAttribute(new Attribute("lang",true)); 477 | h3.addAttribute(new Attribute("style",true)); 478 | h3.addAttribute(new Attribute("title",true)); 479 | tagList.add(h3); 480 | 481 | Tag h4 = new Tag("h4",true); 482 | h4.addAttribute(new Attribute("align",true)); 483 | h4.addAttribute(new Attribute("class",true)); 484 | h4.addAttribute(new Attribute("dir",true)); 485 | h4.addAttribute(new Attribute("id",true)); 486 | h4.addAttribute(new Attribute("lang",true)); 487 | h4.addAttribute(new Attribute("style",true)); 488 | h4.addAttribute(new Attribute("title",true)); 489 | tagList.add(h4); 490 | 491 | Tag h5 = new Tag("h5",true); 492 | h5.addAttribute(new Attribute("align",true)); 493 | h5.addAttribute(new Attribute("class",true)); 494 | h5.addAttribute(new Attribute("dir",true)); 495 | h5.addAttribute(new Attribute("id",true)); 496 | h5.addAttribute(new Attribute("lang",true)); 497 | h5.addAttribute(new Attribute("style",true)); 498 | h5.addAttribute(new Attribute("title",true)); 499 | tagList.add(h5); 500 | 501 | Tag h6 = new Tag("h6",true); 502 | h6.addAttribute(new Attribute("align",true)); 503 | h6.addAttribute(new Attribute("class",true)); 504 | h6.addAttribute(new Attribute("dir",true)); 505 | h6.addAttribute(new Attribute("id",true)); 506 | h6.addAttribute(new Attribute("lang",true)); 507 | h6.addAttribute(new Attribute("style",true)); 508 | h6.addAttribute(new Attribute("title",true)); 509 | tagList.add(h6); 510 | 511 | Tag head = new Tag("head",true); 512 | head.addAttribute(new Attribute("profile",true)); 513 | head.addAttribute(new Attribute("class",true)); 514 | head.addAttribute(new Attribute("dir",true)); 515 | head.addAttribute(new Attribute("id",true)); 516 | head.addAttribute(new Attribute("lang",true)); 517 | head.addAttribute(new Attribute("title",true)); 518 | tagList.add(head); 519 | 520 | Tag hr = new Tag("hr",true); 521 | hr.addAttribute(new Attribute("align",true)); 522 | hr.addAttribute(new Attribute("color",true)); 523 | hr.addAttribute(new Attribute("nochade",false)); 524 | hr.addAttribute(new Attribute("size",true)); 525 | hr.addAttribute(new Attribute("width",true)); 526 | hr.addAttribute(new Attribute("class",true)); 527 | hr.addAttribute(new Attribute("dir",true)); 528 | hr.addAttribute(new Attribute("id",true)); 529 | hr.addAttribute(new Attribute("lang",true)); 530 | hr.addAttribute(new Attribute("language",true)); 531 | hr.addAttribute(new Attribute("style",true)); 532 | hr.addAttribute(new Attribute("title",true)); 533 | tagList.add(hr); 534 | 535 | Tag html = new Tag("html",true); 536 | html.addAttribute(new Attribute("version",true)); 537 | html.addAttribute(new Attribute("class",true)); 538 | html.addAttribute(new Attribute("dir",true)); 539 | html.addAttribute(new Attribute("id",true)); 540 | html.addAttribute(new Attribute("lang",true)); 541 | html.addAttribute(new Attribute("language",true)); 542 | html.addAttribute(new Attribute("style",true)); 543 | html.addAttribute(new Attribute("title",true)); 544 | tagList.add(html); 545 | 546 | Tag i = new Tag("i",true); 547 | i.addAttribute(new Attribute("class",true)); 548 | i.addAttribute(new Attribute("dir",true)); 549 | i.addAttribute(new Attribute("id",true)); 550 | i.addAttribute(new Attribute("lang",true)); 551 | i.addAttribute(new Attribute("style",true)); 552 | i.addAttribute(new Attribute("title",true)); 553 | tagList.add(i); 554 | 555 | Tag iframe = new Tag("iframe",true); 556 | iframe.addAttribute(new Attribute("src",true)); 557 | iframe.addAttribute(new Attribute("align",true)); 558 | iframe.addAttribute(new Attribute("height",true)); 559 | iframe.addAttribute(new Attribute("width",true)); 560 | iframe.addAttribute(new Attribute("hspace",true)); 561 | iframe.addAttribute(new Attribute("vspace",true)); 562 | iframe.addAttribute(new Attribute("marginheight",true)); 563 | iframe.addAttribute(new Attribute("marginwidth",true)); 564 | iframe.addAttribute(new Attribute("border",true)); 565 | iframe.addAttribute(new Attribute("bordercolor",true)); 566 | iframe.addAttribute(new Attribute("frameborder",true)); 567 | iframe.addAttribute(new Attribute("framespacing",true)); 568 | iframe.addAttribute(new Attribute("scrolling",true)); 569 | iframe.addAttribute(new Attribute("class",true)); 570 | iframe.addAttribute(new Attribute("dir",true)); 571 | iframe.addAttribute(new Attribute("id",true)); 572 | iframe.addAttribute(new Attribute("lang",true)); 573 | iframe.addAttribute(new Attribute("language",true)); 574 | iframe.addAttribute(new Attribute("name",true)); 575 | iframe.addAttribute(new Attribute("style",true)); 576 | iframe.addAttribute(new Attribute("title",true)); 577 | tagList.add(iframe); 578 | 579 | Tag img = new Tag("img",false); 580 | img.addAttribute(new Attribute("src",true)); 581 | img.addAttribute(new Attribute("alt",true)); 582 | img.addAttribute(new Attribute("height",true)); 583 | img.addAttribute(new Attribute("width",true)); 584 | img.addAttribute(new Attribute("align",true)); 585 | img.addAttribute(new Attribute("border",true)); 586 | img.addAttribute(new Attribute("galleryimg",true)); 587 | img.addAttribute(new Attribute("hspace",true)); 588 | img.addAttribute(new Attribute("lowsrc",true)); 589 | img.addAttribute(new Attribute("suppress",true)); 590 | img.addAttribute(new Attribute("vspace",true)); 591 | img.addAttribute(new Attribute("ismap",false)); 592 | img.addAttribute(new Attribute("usemap",true)); 593 | img.addAttribute(new Attribute("class",true)); 594 | img.addAttribute(new Attribute("dir",true)); 595 | img.addAttribute(new Attribute("id",true)); 596 | img.addAttribute(new Attribute("lang",true)); 597 | img.addAttribute(new Attribute("language",true)); 598 | img.addAttribute(new Attribute("name",true)); 599 | img.addAttribute(new Attribute("style",true)); 600 | img.addAttribute(new Attribute("title",true)); 601 | tagList.add(img); 602 | 603 | Tag input = new Tag("input",true); 604 | input.addAttribute(new Attribute("type",true)); 605 | input.addAttribute(new Attribute("value",true)); 606 | input.addAttribute(new Attribute("size",true)); 607 | input.addAttribute(new Attribute("maxlength",true)); 608 | input.addAttribute(new Attribute("disabled",false)); 609 | input.addAttribute(new Attribute("readonly",false)); 610 | input.addAttribute(new Attribute("checked",false)); 611 | input.addAttribute(new Attribute("align",true)); 612 | input.addAttribute(new Attribute("alt",true)); 613 | input.addAttribute(new Attribute("border",true)); 614 | input.addAttribute(new Attribute("dynsrc",true)); 615 | input.addAttribute(new Attribute("height",true)); 616 | input.addAttribute(new Attribute("ismap",false)); 617 | input.addAttribute(new Attribute("lowsrc",true)); 618 | input.addAttribute(new Attribute("src",true)); 619 | input.addAttribute(new Attribute("width",true)); 620 | input.addAttribute(new Attribute("class",true)); 621 | input.addAttribute(new Attribute("dir",true)); 622 | input.addAttribute(new Attribute("id",true)); 623 | input.addAttribute(new Attribute("lang",true)); 624 | input.addAttribute(new Attribute("language",true)); 625 | input.addAttribute(new Attribute("name",true)); 626 | input.addAttribute(new Attribute("style",true)); 627 | input.addAttribute(new Attribute("title",true)); 628 | tagList.add(input); 629 | 630 | Tag ins = new Tag("ins",true); 631 | ins.addAttribute(new Attribute("cite",true)); 632 | ins.addAttribute(new Attribute("datetime",true)); 633 | ins.addAttribute(new Attribute("class",true)); 634 | ins.addAttribute(new Attribute("dir",true)); 635 | ins.addAttribute(new Attribute("id",true)); 636 | ins.addAttribute(new Attribute("lang",true)); 637 | ins.addAttribute(new Attribute("style",true)); 638 | ins.addAttribute(new Attribute("title",true)); 639 | tagList.add(ins); 640 | 641 | Tag isindex = new Tag("isindex",false); 642 | isindex.addAttribute(new Attribute("action",true)); 643 | isindex.addAttribute(new Attribute("prompt",true)); 644 | isindex.addAttribute(new Attribute("class",true)); 645 | isindex.addAttribute(new Attribute("dir",true)); 646 | isindex.addAttribute(new Attribute("id",true)); 647 | isindex.addAttribute(new Attribute("lang",true)); 648 | isindex.addAttribute(new Attribute("style",true)); 649 | isindex.addAttribute(new Attribute("title",true)); 650 | tagList.add(isindex); 651 | 652 | Tag kbd = new Tag("kbd",true); 653 | kbd.addAttribute(new Attribute("class",true)); 654 | kbd.addAttribute(new Attribute("dir",true)); 655 | kbd.addAttribute(new Attribute("id",true)); 656 | kbd.addAttribute(new Attribute("lang",true)); 657 | kbd.addAttribute(new Attribute("style",true)); 658 | kbd.addAttribute(new Attribute("title",true)); 659 | tagList.add(kbd); 660 | 661 | Tag keygen = new Tag("keygen",false); 662 | keygen.addAttribute(new Attribute("name",true)); 663 | keygen.addAttribute(new Attribute("challenge",true)); 664 | tagList.add(keygen); 665 | 666 | Tag label = new Tag("label",true); 667 | label.addAttribute(new Attribute("class",true)); 668 | label.addAttribute(new Attribute("dir",true)); 669 | label.addAttribute(new Attribute("id",true)); 670 | label.addAttribute(new Attribute("lang",true)); 671 | label.addAttribute(new Attribute("style",true)); 672 | label.addAttribute(new Attribute("title",true)); 673 | tagList.add(label); 674 | 675 | Tag legend = new Tag("legend",true); 676 | legend.addAttribute(new Attribute("align",true)); 677 | legend.addAttribute(new Attribute("class",true)); 678 | legend.addAttribute(new Attribute("dir",true)); 679 | legend.addAttribute(new Attribute("id",true)); 680 | legend.addAttribute(new Attribute("lang",true)); 681 | legend.addAttribute(new Attribute("style",true)); 682 | legend.addAttribute(new Attribute("title",true)); 683 | tagList.add(legend); 684 | 685 | Tag li = new Tag("li",true); 686 | li.addAttribute(new Attribute("type",true)); 687 | li.addAttribute(new Attribute("value",true)); 688 | li.addAttribute(new Attribute("class",true)); 689 | li.addAttribute(new Attribute("dir",true)); 690 | li.addAttribute(new Attribute("id",true)); 691 | li.addAttribute(new Attribute("lang",true)); 692 | li.addAttribute(new Attribute("style",true)); 693 | li.addAttribute(new Attribute("title",true)); 694 | tagList.add(li); 695 | 696 | Tag link = new Tag("link",true); 697 | link.addAttribute(new Attribute("rel",true)); 698 | link.addAttribute(new Attribute("href",true)); 699 | link.addAttribute(new Attribute("src",true)); 700 | link.addAttribute(new Attribute("charset",true)); 701 | link.addAttribute(new Attribute("disabled",false)); 702 | link.addAttribute(new Attribute("hreflang",true)); 703 | link.addAttribute(new Attribute("media",true)); 704 | link.addAttribute(new Attribute("methods",true)); 705 | link.addAttribute(new Attribute("rev",true)); 706 | link.addAttribute(new Attribute("target",true)); 707 | link.addAttribute(new Attribute("type",true)); 708 | link.addAttribute(new Attribute("urn",true)); 709 | link.addAttribute(new Attribute("class",true)); 710 | link.addAttribute(new Attribute("dir",true)); 711 | link.addAttribute(new Attribute("id",true)); 712 | link.addAttribute(new Attribute("lang",true)); 713 | link.addAttribute(new Attribute("language",true)); 714 | link.addAttribute(new Attribute("style",true)); 715 | link.addAttribute(new Attribute("title",true)); 716 | tagList.add(link); 717 | 718 | Tag map = new Tag("map",true); 719 | map.addAttribute(new Attribute("name",true)); 720 | map.addAttribute(new Attribute("class",true)); 721 | map.addAttribute(new Attribute("dir",true)); 722 | map.addAttribute(new Attribute("id",true)); 723 | map.addAttribute(new Attribute("lang",true)); 724 | map.addAttribute(new Attribute("language",true)); 725 | map.addAttribute(new Attribute("name",true)); 726 | map.addAttribute(new Attribute("style",true)); 727 | map.addAttribute(new Attribute("title",true)); 728 | tagList.add(map); 729 | 730 | Tag marquee = new Tag("marquee",true); 731 | marquee.addAttribute(new Attribute("behavior",true)); 732 | marquee.addAttribute(new Attribute("bgcolor",true)); 733 | marquee.addAttribute(new Attribute("direction",true)); 734 | marquee.addAttribute(new Attribute("height",true)); 735 | marquee.addAttribute(new Attribute("hspace",true)); 736 | marquee.addAttribute(new Attribute("loop",true)); 737 | marquee.addAttribute(new Attribute("scrollamount",true)); 738 | marquee.addAttribute(new Attribute("scrolldelay",true)); 739 | marquee.addAttribute(new Attribute("truespeed",false)); 740 | marquee.addAttribute(new Attribute("vspace",true)); 741 | marquee.addAttribute(new Attribute("width",true)); 742 | marquee.addAttribute(new Attribute("class",true)); 743 | marquee.addAttribute(new Attribute("dir",true)); 744 | marquee.addAttribute(new Attribute("id",true)); 745 | marquee.addAttribute(new Attribute("lang",true)); 746 | marquee.addAttribute(new Attribute("style",true)); 747 | marquee.addAttribute(new Attribute("title",true)); 748 | tagList.add(marquee); 749 | 750 | Tag menu = new Tag("menu",true); 751 | menu.addAttribute(new Attribute("compact",false)); 752 | menu.addAttribute(new Attribute("type",true)); 753 | menu.addAttribute(new Attribute("class",true)); 754 | menu.addAttribute(new Attribute("dir",true)); 755 | menu.addAttribute(new Attribute("id",true)); 756 | menu.addAttribute(new Attribute("lang",true)); 757 | menu.addAttribute(new Attribute("style",true)); 758 | menu.addAttribute(new Attribute("title",true)); 759 | tagList.add(menu); 760 | 761 | Tag meta = new Tag("meta",false); 762 | meta.addAttribute(new Attribute("name",true)); 763 | meta.addAttribute(new Attribute("http-equiv",true)); 764 | meta.addAttribute(new Attribute("content",true)); 765 | meta.addAttribute(new Attribute("scheme",true)); 766 | meta.addAttribute(new Attribute("dir",true)); 767 | meta.addAttribute(new Attribute("lang",true)); 768 | meta.addAttribute(new Attribute("title",true)); 769 | tagList.add(meta); 770 | 771 | Tag nobr = new Tag("nobr",true); 772 | nobr.addAttribute(new Attribute("class",true)); 773 | nobr.addAttribute(new Attribute("dir",true)); 774 | nobr.addAttribute(new Attribute("id",true)); 775 | nobr.addAttribute(new Attribute("lang",true)); 776 | nobr.addAttribute(new Attribute("style",true)); 777 | nobr.addAttribute(new Attribute("title",true)); 778 | tagList.add(nobr); 779 | 780 | Tag noembed = new Tag("noembed",true); 781 | tagList.add(noembed); 782 | 783 | Tag noframes = new Tag("noframes",true); 784 | noframes.addAttribute(new Attribute("class",true)); 785 | noframes.addAttribute(new Attribute("dir",true)); 786 | noframes.addAttribute(new Attribute("id",true)); 787 | noframes.addAttribute(new Attribute("lang",true)); 788 | noframes.addAttribute(new Attribute("style",true)); 789 | noframes.addAttribute(new Attribute("title",true)); 790 | tagList.add(noframes); 791 | 792 | Tag noscript = new Tag("noscript",true); 793 | noscript.addAttribute(new Attribute("class",true)); 794 | noscript.addAttribute(new Attribute("dir",true)); 795 | noscript.addAttribute(new Attribute("id",true)); 796 | noscript.addAttribute(new Attribute("lang",true)); 797 | noscript.addAttribute(new Attribute("style",true)); 798 | noscript.addAttribute(new Attribute("title",true)); 799 | tagList.add(noscript); 800 | 801 | Tag object = new Tag("object",true); 802 | object.addAttribute(new Attribute("alt",true)); 803 | object.addAttribute(new Attribute("archive",true)); 804 | object.addAttribute(new Attribute("border",true)); 805 | object.addAttribute(new Attribute("classid",true)); 806 | object.addAttribute(new Attribute("code",true)); 807 | object.addAttribute(new Attribute("codebase",true)); 808 | object.addAttribute(new Attribute("codetype",true)); 809 | object.addAttribute(new Attribute("data",true)); 810 | object.addAttribute(new Attribute("declare",false)); 811 | object.addAttribute(new Attribute("name",true)); 812 | object.addAttribute(new Attribute("standby",true)); 813 | object.addAttribute(new Attribute("type",true)); 814 | object.addAttribute(new Attribute("usemap",true)); 815 | object.addAttribute(new Attribute("align",true)); 816 | object.addAttribute(new Attribute("width",true)); 817 | object.addAttribute(new Attribute("height",true)); 818 | object.addAttribute(new Attribute("hspace",true)); 819 | object.addAttribute(new Attribute("vspace",true)); 820 | object.addAttribute(new Attribute("class",true)); 821 | object.addAttribute(new Attribute("dir",true)); 822 | object.addAttribute(new Attribute("id",true)); 823 | object.addAttribute(new Attribute("lang",true)); 824 | object.addAttribute(new Attribute("language",true)); 825 | object.addAttribute(new Attribute("style",true)); 826 | object.addAttribute(new Attribute("title",true)); 827 | tagList.add(object); 828 | 829 | Tag ol = new Tag("ol",true); 830 | ol.addAttribute(new Attribute("compact",false)); 831 | ol.addAttribute(new Attribute("start",true)); 832 | ol.addAttribute(new Attribute("type",true)); 833 | ol.addAttribute(new Attribute("class",true)); 834 | ol.addAttribute(new Attribute("dir",true)); 835 | ol.addAttribute(new Attribute("id",true)); 836 | ol.addAttribute(new Attribute("lang",true)); 837 | ol.addAttribute(new Attribute("style",true)); 838 | ol.addAttribute(new Attribute("title",true)); 839 | tagList.add(ol); 840 | 841 | Tag optgroup = new Tag("optgroup",true); 842 | optgroup.addAttribute(new Attribute("disabled",false)); 843 | optgroup.addAttribute(new Attribute("label",false)); 844 | optgroup.addAttribute(new Attribute("class",true)); 845 | optgroup.addAttribute(new Attribute("dir",true)); 846 | optgroup.addAttribute(new Attribute("id",true)); 847 | optgroup.addAttribute(new Attribute("lang",true)); 848 | optgroup.addAttribute(new Attribute("language",true)); 849 | optgroup.addAttribute(new Attribute("style",true)); 850 | optgroup.addAttribute(new Attribute("title",true)); 851 | tagList.add(optgroup); 852 | 853 | Tag option = new Tag("option",true); 854 | option.addAttribute(new Attribute("disabled",false)); 855 | option.addAttribute(new Attribute("label",false)); 856 | option.addAttribute(new Attribute("selected",false)); 857 | option.addAttribute(new Attribute("value",true)); 858 | option.addAttribute(new Attribute("class",true)); 859 | option.addAttribute(new Attribute("dir",true)); 860 | option.addAttribute(new Attribute("id",true)); 861 | option.addAttribute(new Attribute("lang",true)); 862 | option.addAttribute(new Attribute("language",true)); 863 | option.addAttribute(new Attribute("style",true)); 864 | option.addAttribute(new Attribute("title",true)); 865 | tagList.add(option); 866 | 867 | Tag p = new Tag("p",true); 868 | p.addAttribute(new Attribute("align",true)); 869 | p.addAttribute(new Attribute("class",true)); 870 | p.addAttribute(new Attribute("dir",true)); 871 | p.addAttribute(new Attribute("id",true)); 872 | p.addAttribute(new Attribute("lang",true)); 873 | p.addAttribute(new Attribute("style",true)); 874 | p.addAttribute(new Attribute("title",true)); 875 | tagList.add(p); 876 | 877 | Tag param = new Tag("param",true); 878 | param.addAttribute(new Attribute("name",true)); 879 | param.addAttribute(new Attribute("value",true)); 880 | param.addAttribute(new Attribute("valuetype",true)); 881 | param.addAttribute(new Attribute("type",true)); 882 | param.addAttribute(new Attribute("class",true)); 883 | param.addAttribute(new Attribute("dir",true)); 884 | param.addAttribute(new Attribute("id",true)); 885 | param.addAttribute(new Attribute("lang",true)); 886 | param.addAttribute(new Attribute("language",true)); 887 | param.addAttribute(new Attribute("style",true)); 888 | param.addAttribute(new Attribute("title",true)); 889 | tagList.add(param); 890 | 891 | Tag pre = new Tag("pre",true); 892 | pre.addAttribute(new Attribute("cols",true)); 893 | pre.addAttribute(new Attribute("width",true)); 894 | pre.addAttribute(new Attribute("wrap",false)); 895 | pre.addAttribute(new Attribute("class",true)); 896 | pre.addAttribute(new Attribute("dir",true)); 897 | pre.addAttribute(new Attribute("id",true)); 898 | pre.addAttribute(new Attribute("lang",true)); 899 | pre.addAttribute(new Attribute("style",true)); 900 | pre.addAttribute(new Attribute("title",true)); 901 | tagList.add(pre); 902 | 903 | Tag q = new Tag("q",true); 904 | q.addAttribute(new Attribute("cite",true)); 905 | q.addAttribute(new Attribute("class",true)); 906 | q.addAttribute(new Attribute("dir",true)); 907 | q.addAttribute(new Attribute("id",true)); 908 | q.addAttribute(new Attribute("lang",true)); 909 | q.addAttribute(new Attribute("style",true)); 910 | q.addAttribute(new Attribute("title",true)); 911 | tagList.add(q); 912 | 913 | Tag rb = new Tag("rb",true); 914 | rb.addAttribute(new Attribute("class",true)); 915 | rb.addAttribute(new Attribute("dir",true)); 916 | rb.addAttribute(new Attribute("id",true)); 917 | rb.addAttribute(new Attribute("lang",true)); 918 | rb.addAttribute(new Attribute("language",true)); 919 | rb.addAttribute(new Attribute("style",true)); 920 | rb.addAttribute(new Attribute("title",true)); 921 | tagList.add(rb); 922 | 923 | Tag rp = new Tag("rp",true); 924 | rp.addAttribute(new Attribute("class",true)); 925 | rp.addAttribute(new Attribute("dir",true)); 926 | rp.addAttribute(new Attribute("id",true)); 927 | rp.addAttribute(new Attribute("lang",true)); 928 | rp.addAttribute(new Attribute("language",true)); 929 | rp.addAttribute(new Attribute("style",true)); 930 | rp.addAttribute(new Attribute("title",true)); 931 | tagList.add(rp); 932 | 933 | Tag rt = new Tag("rt",true); 934 | rt.addAttribute(new Attribute("class",true)); 935 | rt.addAttribute(new Attribute("dir",true)); 936 | rt.addAttribute(new Attribute("id",true)); 937 | rt.addAttribute(new Attribute("lang",true)); 938 | rt.addAttribute(new Attribute("style",true)); 939 | rt.addAttribute(new Attribute("title",true)); 940 | tagList.add(rt); 941 | 942 | Tag ruby = new Tag("ruby",true); 943 | ruby.addAttribute(new Attribute("class",true)); 944 | ruby.addAttribute(new Attribute("dir",true)); 945 | ruby.addAttribute(new Attribute("id",true)); 946 | ruby.addAttribute(new Attribute("lang",true)); 947 | ruby.addAttribute(new Attribute("style",true)); 948 | ruby.addAttribute(new Attribute("title",true)); 949 | tagList.add(ruby); 950 | 951 | Tag s = new Tag("s",true); 952 | s.addAttribute(new Attribute("class",true)); 953 | s.addAttribute(new Attribute("dir",true)); 954 | s.addAttribute(new Attribute("id",true)); 955 | s.addAttribute(new Attribute("lang",true)); 956 | s.addAttribute(new Attribute("style",true)); 957 | s.addAttribute(new Attribute("title",true)); 958 | tagList.add(s); 959 | 960 | Tag samp = new Tag("samp",true); 961 | samp.addAttribute(new Attribute("class",true)); 962 | samp.addAttribute(new Attribute("dir",true)); 963 | samp.addAttribute(new Attribute("id",true)); 964 | samp.addAttribute(new Attribute("lang",true)); 965 | samp.addAttribute(new Attribute("style",true)); 966 | samp.addAttribute(new Attribute("title",true)); 967 | tagList.add(samp); 968 | 969 | Tag script = new Tag("script",true); 970 | script.addAttribute(new Attribute("charset",true)); 971 | script.addAttribute(new Attribute("defer",false)); 972 | script.addAttribute(new Attribute("event",true)); 973 | script.addAttribute(new Attribute("for",true)); 974 | script.addAttribute(new Attribute("src",true)); 975 | script.addAttribute(new Attribute("type",true)); 976 | script.addAttribute(new Attribute("class",true)); 977 | script.addAttribute(new Attribute("id",true)); 978 | script.addAttribute(new Attribute("language",true)); 979 | script.addAttribute(new Attribute("title",true)); 980 | tagList.add(script); 981 | 982 | Tag select = new Tag("select",true); 983 | select.addAttribute(new Attribute("align",true)); 984 | select.addAttribute(new Attribute("disabled",false)); 985 | select.addAttribute(new Attribute("multiple",false)); 986 | select.addAttribute(new Attribute("size",true)); 987 | select.addAttribute(new Attribute("class",true)); 988 | select.addAttribute(new Attribute("dir",true)); 989 | select.addAttribute(new Attribute("id",true)); 990 | select.addAttribute(new Attribute("lang",true)); 991 | select.addAttribute(new Attribute("language",true)); 992 | select.addAttribute(new Attribute("name",true)); 993 | select.addAttribute(new Attribute("style",true)); 994 | select.addAttribute(new Attribute("title",true)); 995 | tagList.add(select); 996 | 997 | Tag small = new Tag("small",true); 998 | small.addAttribute(new Attribute("class",true)); 999 | small.addAttribute(new Attribute("dir",true)); 1000 | small.addAttribute(new Attribute("id",true)); 1001 | small.addAttribute(new Attribute("lang",true)); 1002 | small.addAttribute(new Attribute("style",true)); 1003 | small.addAttribute(new Attribute("title",true)); 1004 | tagList.add(small); 1005 | 1006 | Tag span = new Tag("span",true); 1007 | span.addAttribute(new Attribute("class",true)); 1008 | span.addAttribute(new Attribute("dir",true)); 1009 | span.addAttribute(new Attribute("id",true)); 1010 | span.addAttribute(new Attribute("lang",true)); 1011 | span.addAttribute(new Attribute("style",true)); 1012 | span.addAttribute(new Attribute("title",true)); 1013 | tagList.add(span); 1014 | 1015 | Tag strike = new Tag("strike",true); 1016 | strike.addAttribute(new Attribute("class",true)); 1017 | strike.addAttribute(new Attribute("dir",true)); 1018 | strike.addAttribute(new Attribute("id",true)); 1019 | strike.addAttribute(new Attribute("lang",true)); 1020 | strike.addAttribute(new Attribute("style",true)); 1021 | strike.addAttribute(new Attribute("title",true)); 1022 | tagList.add(strike); 1023 | 1024 | Tag strong = new Tag("strong",true); 1025 | strong.addAttribute(new Attribute("class",true)); 1026 | strong.addAttribute(new Attribute("dir",true)); 1027 | strong.addAttribute(new Attribute("id",true)); 1028 | strong.addAttribute(new Attribute("lang",true)); 1029 | strong.addAttribute(new Attribute("style",true)); 1030 | strong.addAttribute(new Attribute("title",true)); 1031 | tagList.add(strong); 1032 | 1033 | Tag style = new Tag("style",true); 1034 | style.addAttribute(new Attribute("disabled",true)); 1035 | style.addAttribute(new Attribute("media",true)); 1036 | style.addAttribute(new Attribute("type",true)); 1037 | style.addAttribute(new Attribute("dir",true)); 1038 | style.addAttribute(new Attribute("lang",true)); 1039 | style.addAttribute(new Attribute("title",true)); 1040 | tagList.add(style); 1041 | 1042 | Tag sub = new Tag("sub",true); 1043 | sub.addAttribute(new Attribute("class",true)); 1044 | sub.addAttribute(new Attribute("dir",true)); 1045 | sub.addAttribute(new Attribute("id",true)); 1046 | sub.addAttribute(new Attribute("lang",true)); 1047 | sub.addAttribute(new Attribute("style",true)); 1048 | sub.addAttribute(new Attribute("title",true)); 1049 | tagList.add(sub); 1050 | 1051 | Tag sup = new Tag("sup",true); 1052 | sup.addAttribute(new Attribute("class",true)); 1053 | sup.addAttribute(new Attribute("dir",true)); 1054 | sup.addAttribute(new Attribute("id",true)); 1055 | sup.addAttribute(new Attribute("lang",true)); 1056 | sup.addAttribute(new Attribute("style",true)); 1057 | sup.addAttribute(new Attribute("title",true)); 1058 | tagList.add(sup); 1059 | 1060 | Tag table = new Tag("table",true); 1061 | table.addAttribute(new Attribute("border",true)); 1062 | table.addAttribute(new Attribute("bordercolor",true)); 1063 | table.addAttribute(new Attribute("bordercolordark",true)); 1064 | table.addAttribute(new Attribute("bordercolorlight",true)); 1065 | table.addAttribute(new Attribute("frame",true)); 1066 | table.addAttribute(new Attribute("rules",true)); 1067 | table.addAttribute(new Attribute("background",true)); 1068 | table.addAttribute(new Attribute("bgcolor",true)); 1069 | table.addAttribute(new Attribute("align",true)); 1070 | table.addAttribute(new Attribute("cellpadding",true)); 1071 | table.addAttribute(new Attribute("cellspacing",true)); 1072 | table.addAttribute(new Attribute("height",true)); 1073 | table.addAttribute(new Attribute("hspace",true)); 1074 | table.addAttribute(new Attribute("vspace",true)); 1075 | table.addAttribute(new Attribute("width",true)); 1076 | table.addAttribute(new Attribute("cols",true)); 1077 | table.addAttribute(new Attribute("class",true)); 1078 | table.addAttribute(new Attribute("dir",true)); 1079 | table.addAttribute(new Attribute("id",true)); 1080 | table.addAttribute(new Attribute("lang",true)); 1081 | table.addAttribute(new Attribute("language",true)); 1082 | table.addAttribute(new Attribute("style",true)); 1083 | table.addAttribute(new Attribute("title",true)); 1084 | tagList.add(table); 1085 | 1086 | Tag tbody = new Tag("tbody",true); 1087 | tbody.addAttribute(new Attribute("align",true)); 1088 | tbody.addAttribute(new Attribute("bgcolor",true)); 1089 | tbody.addAttribute(new Attribute("char",true)); 1090 | tbody.addAttribute(new Attribute("charoff",true)); 1091 | tbody.addAttribute(new Attribute("valign",true)); 1092 | tbody.addAttribute(new Attribute("class",true)); 1093 | tbody.addAttribute(new Attribute("dir",true)); 1094 | tbody.addAttribute(new Attribute("id",true)); 1095 | tbody.addAttribute(new Attribute("lang",true)); 1096 | tbody.addAttribute(new Attribute("language",true)); 1097 | tbody.addAttribute(new Attribute("style",true)); 1098 | tbody.addAttribute(new Attribute("title",true)); 1099 | tagList.add(tbody); 1100 | 1101 | Tag td = new Tag("td",true); 1102 | td.addAttribute(new Attribute("bordercolor",true)); 1103 | td.addAttribute(new Attribute("bordercolordark",true)); 1104 | td.addAttribute(new Attribute("bordercolorlight",true)); 1105 | td.addAttribute(new Attribute("background",true)); 1106 | td.addAttribute(new Attribute("bgcolor",true)); 1107 | td.addAttribute(new Attribute("align",true)); 1108 | td.addAttribute(new Attribute("valign",true)); 1109 | td.addAttribute(new Attribute("height",true)); 1110 | td.addAttribute(new Attribute("width",true)); 1111 | td.addAttribute(new Attribute("nowrap",false)); 1112 | td.addAttribute(new Attribute("char",true)); 1113 | td.addAttribute(new Attribute("charoff",true)); 1114 | td.addAttribute(new Attribute("colspan",true)); 1115 | td.addAttribute(new Attribute("rowspan",true)); 1116 | td.addAttribute(new Attribute("abbr",true)); 1117 | td.addAttribute(new Attribute("axis",true)); 1118 | td.addAttribute(new Attribute("headers",true)); 1119 | td.addAttribute(new Attribute("scope",true)); 1120 | td.addAttribute(new Attribute("class",true)); 1121 | td.addAttribute(new Attribute("dir",true)); 1122 | td.addAttribute(new Attribute("id",true)); 1123 | td.addAttribute(new Attribute("lang",true)); 1124 | td.addAttribute(new Attribute("language",true)); 1125 | td.addAttribute(new Attribute("style",true)); 1126 | td.addAttribute(new Attribute("title",true)); 1127 | tagList.add(td); 1128 | 1129 | Tag textarea = new Tag("textarea",true); 1130 | textarea.addAttribute(new Attribute("align",true)); 1131 | textarea.addAttribute(new Attribute("cols",true)); 1132 | textarea.addAttribute(new Attribute("disabled",false)); 1133 | textarea.addAttribute(new Attribute("istyle",true)); 1134 | textarea.addAttribute(new Attribute("readonly",false)); 1135 | textarea.addAttribute(new Attribute("rows",true)); 1136 | textarea.addAttribute(new Attribute("wrap",true)); 1137 | textarea.addAttribute(new Attribute("class",true)); 1138 | textarea.addAttribute(new Attribute("dir",true)); 1139 | textarea.addAttribute(new Attribute("id",true)); 1140 | textarea.addAttribute(new Attribute("lang",true)); 1141 | textarea.addAttribute(new Attribute("name",true)); 1142 | textarea.addAttribute(new Attribute("style",true)); 1143 | textarea.addAttribute(new Attribute("title",true)); 1144 | tagList.add(textarea); 1145 | 1146 | Tag tfoot = new Tag("tfoot",true); 1147 | tfoot.addAttribute(new Attribute("align",true)); 1148 | tfoot.addAttribute(new Attribute("bgcolor",true)); 1149 | tfoot.addAttribute(new Attribute("char",true)); 1150 | tfoot.addAttribute(new Attribute("charoff",true)); 1151 | tfoot.addAttribute(new Attribute("valign",true)); 1152 | tfoot.addAttribute(new Attribute("class",true)); 1153 | tfoot.addAttribute(new Attribute("dir",true)); 1154 | tfoot.addAttribute(new Attribute("id",true)); 1155 | tfoot.addAttribute(new Attribute("lang",true)); 1156 | tfoot.addAttribute(new Attribute("language",true)); 1157 | tfoot.addAttribute(new Attribute("style",true)); 1158 | tfoot.addAttribute(new Attribute("title",true)); 1159 | tagList.add(tfoot); 1160 | 1161 | Tag th = new Tag("th",true); 1162 | th.addAttribute(new Attribute("bordercolor",true)); 1163 | th.addAttribute(new Attribute("bordercolordark",true)); 1164 | th.addAttribute(new Attribute("bordercolorlight",true)); 1165 | th.addAttribute(new Attribute("background",true)); 1166 | th.addAttribute(new Attribute("bgcolor",true)); 1167 | th.addAttribute(new Attribute("align",true)); 1168 | th.addAttribute(new Attribute("valign",true)); 1169 | th.addAttribute(new Attribute("height",true)); 1170 | th.addAttribute(new Attribute("width",true)); 1171 | th.addAttribute(new Attribute("nowrap",false)); 1172 | th.addAttribute(new Attribute("char",true)); 1173 | th.addAttribute(new Attribute("charoff",true)); 1174 | th.addAttribute(new Attribute("colspan",true)); 1175 | th.addAttribute(new Attribute("rowspan",true)); 1176 | th.addAttribute(new Attribute("abbr",true)); 1177 | th.addAttribute(new Attribute("axis",true)); 1178 | th.addAttribute(new Attribute("headers",true)); 1179 | th.addAttribute(new Attribute("scope",true)); 1180 | th.addAttribute(new Attribute("class",true)); 1181 | th.addAttribute(new Attribute("dir",true)); 1182 | th.addAttribute(new Attribute("id",true)); 1183 | th.addAttribute(new Attribute("lang",true)); 1184 | th.addAttribute(new Attribute("language",true)); 1185 | th.addAttribute(new Attribute("style",true)); 1186 | th.addAttribute(new Attribute("title",true)); 1187 | tagList.add(th); 1188 | 1189 | Tag thead = new Tag("thead",true); 1190 | thead.addAttribute(new Attribute("align",true)); 1191 | thead.addAttribute(new Attribute("bgcolor",true)); 1192 | thead.addAttribute(new Attribute("char",true)); 1193 | thead.addAttribute(new Attribute("charoff",true)); 1194 | thead.addAttribute(new Attribute("valign",true)); 1195 | thead.addAttribute(new Attribute("class",true)); 1196 | thead.addAttribute(new Attribute("dir",true)); 1197 | thead.addAttribute(new Attribute("id",true)); 1198 | thead.addAttribute(new Attribute("lang",true)); 1199 | thead.addAttribute(new Attribute("language",true)); 1200 | thead.addAttribute(new Attribute("style",true)); 1201 | thead.addAttribute(new Attribute("title",true)); 1202 | tagList.add(thead); 1203 | 1204 | Tag title = new Tag("title",true); 1205 | title.addAttribute(new Attribute("dir",true)); 1206 | title.addAttribute(new Attribute("id",true)); 1207 | title.addAttribute(new Attribute("lang",true)); 1208 | title.addAttribute(new Attribute("title",true)); 1209 | tagList.add(title); 1210 | 1211 | Tag tr = new Tag("tr",true); 1212 | tr.addAttribute(new Attribute("bordercolor",true)); 1213 | tr.addAttribute(new Attribute("bordercolordark",true)); 1214 | tr.addAttribute(new Attribute("bordercolorlight",true)); 1215 | tr.addAttribute(new Attribute("background",true)); 1216 | tr.addAttribute(new Attribute("bgcolor",true)); 1217 | tr.addAttribute(new Attribute("align",true)); 1218 | tr.addAttribute(new Attribute("char",true)); 1219 | tr.addAttribute(new Attribute("charoff",true)); 1220 | tr.addAttribute(new Attribute("height",true)); 1221 | tr.addAttribute(new Attribute("valign",true)); 1222 | tr.addAttribute(new Attribute("class",true)); 1223 | tr.addAttribute(new Attribute("dir",true)); 1224 | tr.addAttribute(new Attribute("id",true)); 1225 | tr.addAttribute(new Attribute("lang",true)); 1226 | tr.addAttribute(new Attribute("language",true)); 1227 | tr.addAttribute(new Attribute("style",true)); 1228 | tr.addAttribute(new Attribute("title",true)); 1229 | tagList.add(tr); 1230 | 1231 | Tag tt = new Tag("tt",true); 1232 | tt.addAttribute(new Attribute("class",true)); 1233 | tt.addAttribute(new Attribute("dir",true)); 1234 | tt.addAttribute(new Attribute("id",true)); 1235 | tt.addAttribute(new Attribute("lang",true)); 1236 | tt.addAttribute(new Attribute("style",true)); 1237 | tt.addAttribute(new Attribute("title",true)); 1238 | tagList.add(tt); 1239 | 1240 | Tag u = new Tag("u",true); 1241 | u.addAttribute(new Attribute("class",true)); 1242 | u.addAttribute(new Attribute("dir",true)); 1243 | u.addAttribute(new Attribute("id",true)); 1244 | u.addAttribute(new Attribute("lang",true)); 1245 | u.addAttribute(new Attribute("style",true)); 1246 | u.addAttribute(new Attribute("title",true)); 1247 | tagList.add(u); 1248 | 1249 | Tag ul = new Tag("ul",true); 1250 | ul.addAttribute(new Attribute("compact",false)); 1251 | ul.addAttribute(new Attribute("type",true)); 1252 | ul.addAttribute(new Attribute("class",true)); 1253 | ul.addAttribute(new Attribute("dir",true)); 1254 | ul.addAttribute(new Attribute("id",true)); 1255 | ul.addAttribute(new Attribute("lang",true)); 1256 | ul.addAttribute(new Attribute("style",true)); 1257 | ul.addAttribute(new Attribute("title",true)); 1258 | tagList.add(ul); 1259 | 1260 | Tag var = new Tag("var",true); 1261 | var.addAttribute(new Attribute("class",true)); 1262 | var.addAttribute(new Attribute("dir",true)); 1263 | var.addAttribute(new Attribute("id",true)); 1264 | var.addAttribute(new Attribute("lang",true)); 1265 | var.addAttribute(new Attribute("style",true)); 1266 | var.addAttribute(new Attribute("title",true)); 1267 | tagList.add(var); 1268 | 1269 | Tag wbr = new Tag("wbr",false); 1270 | wbr.addAttribute(new Attribute("class",true)); 1271 | wbr.addAttribute(new Attribute("dir",true)); 1272 | wbr.addAttribute(new Attribute("id",true)); 1273 | wbr.addAttribute(new Attribute("lang",true)); 1274 | wbr.addAttribute(new Attribute("language",true)); 1275 | wbr.addAttribute(new Attribute("style",true)); 1276 | wbr.addAttribute(new Attribute("title",true)); 1277 | tagList.add(wbr); 1278 | 1279 | // -- HTML5 TAGS -- // 1280 | 1281 | 1282 | Tag html5a = new Tag("a",false); 1283 | Tag html5abbr = new Tag("abbr",false); 1284 | Tag html5acronym = new Tag("acronym",false); 1285 | Tag html5address = new Tag("address",false); 1286 | Tag html5applet = new Tag("applet",false); 1287 | Tag html5area = new Tag("area",false); 1288 | Tag html5article = new Tag("article",false); 1289 | Tag html5aside = new Tag("aside",false); 1290 | Tag html5audio = new Tag("audio",false); 1291 | Tag html5b = new Tag("b",false); 1292 | Tag html5base = new Tag("base",false); 1293 | Tag html5basefont = new Tag("basefont",false); 1294 | Tag html5bdi = new Tag("bdi",false); 1295 | Tag html5bdo = new Tag("bdo",false); 1296 | Tag html5big = new Tag("big",false); 1297 | Tag html5blockquote = new Tag("blockquote",false); 1298 | Tag html5body = new Tag("body",false); 1299 | Tag html5br = new Tag("br",false); 1300 | Tag html5button = new Tag("button",false); 1301 | Tag html5canvas = new Tag("canvas",false); 1302 | Tag html5caption = new Tag("caption",false); 1303 | Tag html5center = new Tag("center",false); 1304 | Tag html5cite = new Tag("cite",false); 1305 | Tag html5code = new Tag("code",false); 1306 | Tag html5com = new Tag("col",false); 1307 | Tag html5colgroup = new Tag("colgroup",false); 1308 | Tag html5command = new Tag("command",false); 1309 | Tag html5datalist = new Tag("datalist",false); 1310 | Tag html5dd = new Tag("dd",false); 1311 | Tag html5del = new Tag("del",false); 1312 | Tag html5details = new Tag("details",false); 1313 | Tag html5dfn = new Tag("dfn",false); 1314 | Tag html5dir = new Tag("dir",false); 1315 | Tag html5div = new Tag("div",false); 1316 | Tag html5dl = new Tag("dl",false); 1317 | Tag html5dt = new Tag("dt",false); 1318 | Tag html5em = new Tag("em",false); 1319 | Tag html5embed = new Tag("embed",false); 1320 | Tag html5fieldset = new Tag("fieldset",false); 1321 | Tag html5figcaption = new Tag("figcaption",false); 1322 | Tag html5figure = new Tag("figure",false); 1323 | Tag html5font = new Tag("font",false); 1324 | Tag html5footer = new Tag("footer",false); 1325 | Tag html5form = new Tag("form",false); 1326 | Tag html5frame = new Tag("frame",false); 1327 | Tag html5frameset = new Tag("frameset",false); 1328 | Tag html5h1 = new Tag("h1",false); 1329 | Tag html5h2 = new Tag("h2",false); 1330 | Tag html5h3 = new Tag("h3",false); 1331 | Tag html5h4 = new Tag("h4",false); 1332 | Tag html5h5 = new Tag("h5",false); 1333 | Tag html5h6 = new Tag("h6",false); 1334 | Tag html5head = new Tag("head",false); 1335 | Tag html5header = new Tag("header",false); 1336 | Tag html5hgroup = new Tag("hgroup",false); 1337 | Tag html5hr = new Tag("hr",false); 1338 | Tag html5html = new Tag("html",false); 1339 | Tag html5i = new Tag("i",false); 1340 | Tag html5iframe = new Tag("iframe",false); 1341 | Tag html5img = new Tag("img",false); 1342 | Tag html5input = new Tag("input",false); 1343 | Tag html5ins = new Tag("ins",false); 1344 | Tag html5keygen = new Tag("keygen",false); 1345 | Tag html5kbd= new Tag("kbd",false); 1346 | Tag html5label = new Tag("label",false); 1347 | Tag html5legand = new Tag("legend",false); 1348 | Tag html5li = new Tag("li",false); 1349 | Tag html5link = new Tag("link",false); 1350 | Tag html5map = new Tag("map",false); 1351 | Tag html5mark = new Tag("mark",false); 1352 | Tag html5menu = new Tag("menu",false); 1353 | Tag html5meta = new Tag("meta",false); 1354 | Tag html5meter = new Tag("meter",false); 1355 | Tag html5nav = new Tag("nav",false); 1356 | Tag html5noframes = new Tag("noframes",false); 1357 | Tag html5noscript = new Tag("noscript",false); 1358 | Tag html5object = new Tag("object",false); 1359 | Tag html5ol = new Tag("ol",false); 1360 | Tag html5optgroup = new Tag("optgroup",false); 1361 | Tag html5option = new Tag("option",false); 1362 | Tag html5output = new Tag("output",false); 1363 | Tag html5p = new Tag("p",false); 1364 | Tag html5param = new Tag("param",false); 1365 | Tag html5pre = new Tag("pre",false); 1366 | Tag html5progress = new Tag("progress",false); 1367 | Tag html5q = new Tag("q",false); 1368 | Tag html5rp = new Tag("rp",false); 1369 | Tag html5rt = new Tag("rt",false); 1370 | Tag html5ruby = new Tag("ruby",false); 1371 | Tag html5s = new Tag("s",false); 1372 | Tag html5samp = new Tag("samp",false); 1373 | Tag html5script = new Tag("script",false); 1374 | Tag html5section = new Tag("section",false); 1375 | Tag html5select = new Tag("select",false); 1376 | Tag html5small = new Tag("small",false); 1377 | Tag html5source = new Tag("source",false); 1378 | Tag html5span = new Tag("span",false); 1379 | Tag html5strike = new Tag("strike",false); 1380 | Tag html5strong = new Tag("strong",false); 1381 | Tag html5style = new Tag("style",false); 1382 | Tag html5sub = new Tag("sub",false); 1383 | Tag html5summary = new Tag("summary",false); 1384 | Tag html5sup = new Tag("sup",false); 1385 | Tag html5table = new Tag("table",false); 1386 | Tag html5tbody = new Tag("tbody",false); 1387 | Tag html5td = new Tag("td",false); 1388 | Tag html5textarea = new Tag("textarea",false); 1389 | Tag html5tfoot = new Tag("tfoot",false); 1390 | Tag html5th = new Tag("th",false); 1391 | Tag html5thead = new Tag("thead",false); 1392 | Tag html5time = new Tag("time",false); 1393 | Tag html5title = new Tag("title",false); 1394 | Tag html5tr = new Tag("tr",false); 1395 | Tag html5track = new Tag("track",false); 1396 | Tag html5tt = new Tag("tt",false); 1397 | Tag html5u = new Tag("u",false); 1398 | Tag html5ul = new Tag("ul",false); 1399 | Tag html5var = new Tag("var",false); 1400 | Tag html5video = new Tag("video",false); 1401 | Tag html5wbr = new Tag("wbr",false); 1402 | Tag html5xmp = new Tag("xmp",false); -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/handlers/ContextHelpKeyHandler.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.handlers; 2 | 3 | import java.net.MalformedURLException; 4 | import java.net.URL; 5 | import java.util.List; 6 | 7 | import org.eclipse.core.commands.AbstractHandler; 8 | import org.eclipse.core.commands.ExecutionEvent; 9 | import org.eclipse.core.commands.ExecutionException; 10 | import org.eclipse.jface.text.BadLocationException; 11 | import org.eclipse.jface.text.IDocument; 12 | import org.eclipse.jface.text.IRegion; 13 | import org.eclipse.jface.text.ITextSelection; 14 | import org.eclipse.jface.viewers.ISelectionProvider; 15 | import org.eclipse.ui.IEditorPart; 16 | import org.eclipse.ui.IWorkbench; 17 | import org.eclipse.ui.IWorkbenchPage; 18 | import org.eclipse.ui.IWorkbenchWindow; 19 | import org.eclipse.ui.PartInitException; 20 | import org.eclipse.ui.PlatformUI; 21 | import org.eclipse.ui.browser.IWebBrowser; 22 | import org.eclipse.ui.browser.IWorkbenchBrowserSupport; 23 | import org.eclipse.ui.texteditor.IDocumentProvider; 24 | import org.eclipse.ui.texteditor.ITextEditor; 25 | 26 | import com.vf.apex.editor.assist.Tag; 27 | import com.vf.apex.editor.assist.VisualForceTagDefinition; 28 | 29 | /** 30 | * Our sample handler extends AbstractHandler, an IHandler base class. 31 | * 32 | * @see org.eclipse.core.commands.IHandler 33 | * @see org.eclipse.core.commands.AbstractHandler 34 | */ 35 | public class ContextHelpKeyHandler extends AbstractHandler { 36 | /** 37 | * The constructor. 38 | */ 39 | public ContextHelpKeyHandler() { 40 | } 41 | 42 | /** 43 | * the command has been executed, so extract extract the needed information 44 | * from the application context. 45 | */ 46 | public Object execute(ExecutionEvent event) throws ExecutionException { 47 | // IWorkbenchWindow window = 48 | // HandlerUtil.getActiveWorkbenchWindowChecked(event); 49 | 50 | IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport(); 51 | IWebBrowser browser; 52 | try { 53 | 54 | IWorkbench wb = PlatformUI.getWorkbench(); 55 | IWorkbenchWindow win = wb.getActiveWorkbenchWindow(); 56 | Object data = wb.getDisplay().getActiveShell().getData(); 57 | IWorkbenchPage page = win.getActivePage(); 58 | IEditorPart editorPart = page.getActiveEditor(); 59 | ITextEditor editor = (ITextEditor) editorPart; 60 | ISelectionProvider sp = editor.getSelectionProvider(); 61 | ITextSelection selection = (ITextSelection) sp.getSelection(); 62 | 63 | IDocumentProvider documentProvider = editor.getDocumentProvider(); 64 | IDocument document = documentProvider.getDocument(editorPart 65 | .getEditorInput()); 66 | 67 | 68 | ITextSelection textSelection = (ITextSelection) editorPart 69 | .getSite().getSelectionProvider().getSelection(); 70 | int cursorLocation = textSelection.getOffset(); 71 | int lineNumber = document.getLineOfOffset(cursorLocation); 72 | IRegion lineInformation = document.getLineInformation(lineNumber); 73 | String lineText = document.get().substring( 74 | lineInformation.getOffset(), 75 | lineInformation.getOffset() + lineInformation.getLength()); 76 | String offsetWord = getOffsetWord(lineText, cursorLocation 77 | - lineInformation.getOffset()); 78 | // System.out.println("offsetWord" + offsetWord); 79 | // 80 | String word = offsetWord.substring(offsetWord.lastIndexOf(":") + 1, 81 | offsetWord.length()); 82 | List tagInfoAsList = VisualForceTagDefinition.getTagInfoAsList(); 83 | String tagInEditor = "apex:" + word; 84 | boolean found=false; 85 | for (Tag tag : tagInfoAsList) { 86 | if(tag.getTagName().equalsIgnoreCase(tagInEditor)){ 87 | found = true; 88 | } 89 | } 90 | 91 | 92 | browser = support.createBrowser("" + System.currentTimeMillis()); 93 | 94 | if (found) { 95 | browser.openURL(new URL( 96 | "http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_" 97 | + word + ".htm")); 98 | } else { 99 | browser.openURL(new URL( 100 | "http://www.salesforce.com/us/developer/docs/pages/index.htm?"+word)); 101 | } 102 | 103 | // 104 | 105 | } catch (PartInitException e) { 106 | // TODO Auto-generated catch block 107 | e.printStackTrace(); 108 | } catch (MalformedURLException e) { 109 | // TODO Auto-generated catch block 110 | e.printStackTrace(); 111 | } catch (BadLocationException e) { 112 | // TODO Auto-generated catch block 113 | e.printStackTrace(); 114 | } 115 | return null; 116 | } 117 | 118 | private String getOffsetWord(String str, int offset) { 119 | 120 | int lastBeforWordDelimiter = 0; 121 | int firstAfterWordDelimiter = 0; 122 | for (int i = 0; i < offset; i++) { 123 | char charAt = str.charAt(i); 124 | if (isDelimiter(charAt)) { 125 | lastBeforWordDelimiter = i; 126 | } 127 | 128 | } 129 | for (int i = offset; i < str.length(); i++) { 130 | char charAt = str.charAt(i); 131 | if (isDelimiter(charAt)) { 132 | firstAfterWordDelimiter = i; 133 | break; 134 | } 135 | 136 | } 137 | 138 | return str.substring(lastBeforWordDelimiter, firstAfterWordDelimiter); 139 | 140 | } 141 | 142 | private boolean isDelimiter(char c) { 143 | if (c == ' ' || c == '(' || c == ')' || c == ',' || c == '.' || c == '=' 144 | || c == ';' || c == '\n' || c == '\r' || c == '\t' || c == '+' 145 | || c == '>' || c == '<' || c == '*' || c == '^' || c == '{' 146 | || c == '}' || c == '[' || c == ']' || c == '"' || c == '\'' || c == '/') { 147 | return true; 148 | } else { 149 | return false; 150 | } 151 | } 152 | 153 | } 154 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/helper/Helper.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.helper; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | 10 | public class Helper { 11 | 12 | public static void copyDirectory(File sourceLocation , File targetLocation) throws IOException { 13 | if(sourceLocation.equals(targetLocation)){ 14 | System.out.println("Skipped copying files.. "); 15 | return; // is source and target Locations are same then skip copying files 16 | } 17 | if (sourceLocation.isDirectory()) { 18 | if (!targetLocation.exists()) { 19 | targetLocation.mkdir(); 20 | } 21 | 22 | String[] children = sourceLocation.list(); 23 | for (int i=0; i 0) { 36 | out.write(buf, 0, len); 37 | } 38 | in.close(); 39 | out.close(); 40 | }else{ 41 | //System.out.println("File Skipped because same: " + sourceLocation.getCanonicalPath()); 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/preferences/PreferenceConstants.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.preferences; 2 | 3 | /** 4 | * Constant definitions for plug-in preferences 5 | */ 6 | public class PreferenceConstants { 7 | 8 | public static final String ENABLE_GIT_COMMIT = "EnableAutoCommit"; 9 | 10 | public static final String GIT_REPO_PATH = "GIT_REPO_PATH"; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/preferences/PreferenceInitializer.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.preferences; 2 | 3 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 4 | import org.eclipse.jface.preference.IPreferenceStore; 5 | 6 | import com.vf.apex.Activator; 7 | 8 | /** 9 | * Class used to initialize default preference values. 10 | */ 11 | public class PreferenceInitializer extends AbstractPreferenceInitializer { 12 | 13 | /* 14 | * (non-Javadoc) 15 | * 16 | * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() 17 | */ 18 | public void initializeDefaultPreferences() { 19 | IPreferenceStore store = Activator.getDefault().getPreferenceStore(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/preferences/RichVisualForcePreferencePage.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.preferences; 2 | 3 | 4 | import org.eclipse.core.resources.IProject; 5 | import org.eclipse.core.resources.ResourcesPlugin; 6 | import org.eclipse.jface.preference.BooleanFieldEditor; 7 | import org.eclipse.jface.preference.DirectoryFieldEditor; 8 | import org.eclipse.jface.preference.FieldEditorPreferencePage; 9 | import org.eclipse.swt.SWT; 10 | import org.eclipse.swt.layout.GridData; 11 | import org.eclipse.swt.layout.GridLayout; 12 | import org.eclipse.swt.widgets.Group; 13 | import org.eclipse.swt.widgets.Label; 14 | import org.eclipse.ui.IWorkbench; 15 | import org.eclipse.ui.IWorkbenchPreferencePage; 16 | 17 | import com.vf.apex.Activator; 18 | 19 | /** 20 | * This class represents a preference page that 21 | * is contributed to the Preferences dialog. By 22 | * subclassing FieldEditorPreferencePage, we 23 | * can use the field support built into JFace that allows 24 | * us to create a page that is small and knows how to 25 | * save, restore and apply itself. 26 | *

27 | * This page is used to modify preferences only. They 28 | * are stored in the preference store that belongs to 29 | * the main plug-in class. That way, preferences can 30 | * be accessed directly via the preference store. 31 | */ 32 | 33 | public class RichVisualForcePreferencePage 34 | extends FieldEditorPreferencePage 35 | implements IWorkbenchPreferencePage { 36 | 37 | public RichVisualForcePreferencePage() { 38 | super(GRID); 39 | setPreferenceStore(Activator.getDefault().getPreferenceStore()); 40 | setDescription("Rich VisualForce editor preference"); 41 | } 42 | 43 | /** 44 | * Creates the field editors. Field editors are abstractions of 45 | * the common GUI blocks needed to manipulate various types 46 | * of preferences. Each field editor knows how to save and 47 | * restore itself. 48 | */ 49 | public void createFieldEditors() { 50 | 51 | addField(new BooleanFieldEditor( 52 | PreferenceConstants.ENABLE_GIT_COMMIT, 53 | "Enable git commit on Ctrl+S shortcut", getFieldEditorParent())); 54 | 55 | IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); 56 | System.out.println(projects.toString()); 57 | Label label = new Label(getFieldEditorParent(), SWT.BORDER | SWT.BORDER_SOLID); 58 | label.setText("Please specify repository location for each project, If you want to enable \ncommetting code on \"CTRL+SHIFT+C\" then please dont forget to click on checkbox."); 59 | 60 | for (IProject iProject : projects) { 61 | Group automaticValidationGroup = new Group(getFieldEditorParent(), SWT.NONE); 62 | automaticValidationGroup.setText(iProject.getLocation().toFile().getName() + " Configuration"); 63 | GridLayout gridLayout = new GridLayout(2, false); 64 | GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false); 65 | gridData.horizontalSpan = 3; 66 | 67 | System.out.println("Project : -- " + iProject.getLocation().toFile().getAbsolutePath()); 68 | addField(new BooleanFieldEditor ( 69 | "COMMIT_ENABLE_" + iProject.getLocation().toFile().getName(), 70 | "Enable Code Commit", 71 | automaticValidationGroup)); 72 | 73 | addField(new DirectoryFieldEditor ( 74 | "REPOSITORY_" + iProject.getLocation().toFile().getName(), 75 | "Repository Location", 76 | automaticValidationGroup)); 77 | 78 | automaticValidationGroup.setLayoutData(gridData); 79 | automaticValidationGroup.setLayout(gridLayout); 80 | } 81 | } 82 | 83 | /* (non-Javadoc) 84 | * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) 85 | */ 86 | public void init(IWorkbench workbench) { 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/CDataRule.java: -------------------------------------------------------------------------------- 1 | 2 | package com.vf.apex.editor.rules; 3 | 4 | import org.eclipse.jface.text.rules.ICharacterScanner; 5 | import org.eclipse.jface.text.rules.IRule; 6 | import org.eclipse.jface.text.rules.IToken; 7 | import org.eclipse.jface.text.rules.Token; 8 | /** 9 | * 10 | * @author eclipse and AjayHada 11 | * 12 | */ 13 | public class CDataRule implements IRule 14 | { 15 | 16 | IToken fToken; 17 | StringBuffer buffer = new StringBuffer(); 18 | int charsRead = 0; 19 | 20 | private String matchString; 21 | private static final String START_MATCH_STRING = ""; 23 | 24 | 25 | public CDataRule(IToken token, boolean start) 26 | { 27 | super(); 28 | this.fToken = token; 29 | this.matchString = start?START_MATCH_STRING:END_MATCH_STRING; 30 | } 31 | 32 | /* 33 | * @see IRule#evaluate(ICharacterScanner) 34 | */ 35 | public IToken evaluate(ICharacterScanner scanner) 36 | { 37 | 38 | buffer.setLength(0); 39 | 40 | charsRead = 0; 41 | int c = read(scanner); 42 | 43 | if (c == matchString.charAt(0)) 44 | { 45 | do 46 | { 47 | c = read(scanner); 48 | } 49 | while (isOK((char) c)); 50 | 51 | if (charsRead == matchString.length()) 52 | { 53 | return fToken; 54 | } 55 | else 56 | { 57 | rewind(scanner); 58 | return Token.UNDEFINED; 59 | } 60 | 61 | } 62 | 63 | scanner.unread(); 64 | return Token.UNDEFINED; 65 | } 66 | 67 | private void rewind(ICharacterScanner scanner) 68 | { 69 | int rewindLength = charsRead; 70 | while (rewindLength > 0) 71 | { 72 | scanner.unread(); 73 | rewindLength--; 74 | } 75 | } 76 | 77 | private int read(ICharacterScanner scanner) 78 | { 79 | int c = scanner.read(); 80 | buffer.append((char) c); 81 | charsRead++; 82 | return c; 83 | } 84 | 85 | private boolean isOK(char c) 86 | { 87 | if (charsRead >= matchString.length()) 88 | return false; 89 | if (matchString.charAt(charsRead - 1) == c) 90 | return true; 91 | else 92 | return false; 93 | } 94 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/EscapedCharRule.java: -------------------------------------------------------------------------------- 1 | 2 | package com.vf.apex.editor.rules; 3 | 4 | import org.eclipse.jface.text.rules.ICharacterScanner; 5 | import org.eclipse.jface.text.rules.IRule; 6 | import org.eclipse.jface.text.rules.IToken; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | /** 10 | * 11 | * @author eclipse and AjayHada 12 | * 13 | */ 14 | @Deprecated 15 | public class EscapedCharRule implements IRule 16 | { 17 | 18 | IToken fToken; 19 | StringBuffer buffer = new StringBuffer(); 20 | 21 | public EscapedCharRule(IToken token) 22 | { 23 | super(); 24 | this.fToken = token; 25 | } 26 | 27 | /* 28 | * @see IRule#evaluate(ICharacterScanner) 29 | */ 30 | public IToken evaluate(ICharacterScanner scanner) 31 | { 32 | 33 | buffer.setLength(0); 34 | 35 | int c = read(scanner); 36 | if (c == '&') 37 | { 38 | 39 | int i = 0; 40 | do 41 | { 42 | c = read(scanner); 43 | i++; 44 | 45 | if (c == '<' || c == ']') 46 | { 47 | // System.out.println("Char " + (char)c); 48 | for (int j= i-1; j > 0; j--) 49 | scanner.unread(); 50 | return Token.UNDEFINED; 51 | } 52 | } 53 | while (c != ';'); 54 | return fToken; 55 | } 56 | 57 | scanner.unread(); 58 | return Token.UNDEFINED; 59 | } 60 | 61 | 62 | private int read(ICharacterScanner scanner) 63 | { 64 | int c = scanner.read(); 65 | buffer.append((char) c); 66 | return c; 67 | } 68 | 69 | 70 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/NonMatchingRule.java: -------------------------------------------------------------------------------- 1 | 2 | package com.vf.apex.editor.rules; 3 | 4 | import org.eclipse.jface.text.rules.ICharacterScanner; 5 | import org.eclipse.jface.text.rules.IPredicateRule; 6 | import org.eclipse.jface.text.rules.IToken; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | /** 10 | * 11 | * @author eclipse and AjayHada 12 | * 13 | */ 14 | @Deprecated 15 | public class NonMatchingRule implements IPredicateRule 16 | { 17 | 18 | public NonMatchingRule() 19 | { 20 | super(); 21 | } 22 | 23 | public IToken getSuccessToken() 24 | { 25 | return Token.UNDEFINED; 26 | } 27 | 28 | public IToken evaluate(ICharacterScanner scanner, boolean resume) 29 | { 30 | return Token.UNDEFINED; 31 | } 32 | 33 | public IToken evaluate(ICharacterScanner scanner) 34 | { 35 | return Token.UNDEFINED; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/StartTagRule.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.rules; 2 | 3 | import org.eclipse.jface.text.rules.ICharacterScanner; 4 | import org.eclipse.jface.text.rules.IToken; 5 | import org.eclipse.jface.text.rules.MultiLineRule; 6 | 7 | /** 8 | * 9 | * @author eclipse and AjayHada 10 | * 11 | */ 12 | @Deprecated 13 | public class StartTagRule extends MultiLineRule 14 | { 15 | 16 | public StartTagRule(IToken token) 17 | { 18 | this(token, false); 19 | } 20 | 21 | protected StartTagRule(IToken token, boolean endAsWell) 22 | { 23 | super("<", endAsWell ? "/>" : ">", token); 24 | } 25 | 26 | protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) 27 | { 28 | int c = scanner.read(); 29 | if (sequence[0] == '<') 30 | { 31 | if (c == '?') 32 | { 33 | // processing instruction - abort 34 | scanner.unread(); 35 | return false; 36 | } 37 | if (c == '!') 38 | { 39 | scanner.unread(); 40 | // comment - abort 41 | return false; 42 | } 43 | } 44 | else if (sequence[0] == '>') 45 | { 46 | scanner.unread(); 47 | } 48 | return super.sequenceDetected(scanner, sequence, eofAllowed); 49 | } 50 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/TagRule.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.rules; 2 | 3 | import org.eclipse.jface.text.rules.ICharacterScanner; 4 | import org.eclipse.jface.text.rules.IToken; 5 | import org.eclipse.jface.text.rules.MultiLineRule; 6 | 7 | public class TagRule extends MultiLineRule { 8 | 9 | public TagRule(IToken token) { 10 | super("<", ">", token); 11 | } 12 | protected boolean sequenceDetected( 13 | ICharacterScanner scanner, 14 | char[] sequence, 15 | boolean eofAllowed) { 16 | int c = scanner.read(); 17 | if (sequence[0] == '<') { 18 | if (c == '?') { 19 | // processing instruction - abort 20 | scanner.unread(); 21 | return false; 22 | } 23 | if (c == '!') { 24 | scanner.unread(); 25 | // comment - abort 26 | return false; 27 | } 28 | } else if (sequence[0] == '>') { 29 | scanner.unread(); 30 | } 31 | return super.sequenceDetected(scanner, sequence, eofAllowed); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/rules/XMLTextPredicateRule.java: -------------------------------------------------------------------------------- 1 | 2 | package com.vf.apex.editor.rules; 3 | 4 | import org.eclipse.jface.text.rules.ICharacterScanner; 5 | import org.eclipse.jface.text.rules.IPredicateRule; 6 | import org.eclipse.jface.text.rules.IToken; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | /** 10 | * 11 | * @author eclipse and AjayHada 12 | * 13 | */ 14 | @Deprecated 15 | public class XMLTextPredicateRule implements IPredicateRule 16 | { 17 | 18 | private IToken token; 19 | private int charsRead; 20 | private boolean whiteSpaceOnly; 21 | boolean inCdata; 22 | 23 | public XMLTextPredicateRule(IToken text) 24 | { 25 | this.token = text; 26 | } 27 | 28 | public IToken getSuccessToken() 29 | { 30 | return token; 31 | } 32 | 33 | public IToken evaluate(ICharacterScanner scanner, boolean resume) 34 | { 35 | return evaluate(scanner); 36 | } 37 | 38 | public IToken evaluate(ICharacterScanner scanner) 39 | { 40 | 41 | reinit(); 42 | 43 | int c = 0; 44 | 45 | //carry on reading until we find a bad char 46 | //int chars = 0; 47 | while (isOK(c = read(scanner), scanner)) 48 | { 49 | //add character to buffer 50 | if (c == ICharacterScanner.EOF) 51 | { 52 | return Token.UNDEFINED; 53 | } 54 | 55 | whiteSpaceOnly = whiteSpaceOnly && (Character.isWhitespace((char) c)); 56 | } 57 | 58 | unread(scanner); 59 | 60 | //if we have only read whitespace characters, go back to where evaluation started and return undefined token 61 | if (whiteSpaceOnly) 62 | { 63 | rewind(scanner, charsRead); 64 | return Token.UNDEFINED; 65 | } 66 | 67 | return token; 68 | 69 | } 70 | 71 | 72 | private boolean isOK(int cc, ICharacterScanner scanner) 73 | { 74 | 75 | char c = (char) cc; 76 | 77 | if (!inCdata) 78 | { 79 | if (c == '<') 80 | { 81 | 82 | int cdataCharsRead = 0; 83 | 84 | for (int i = 0; i < "![CDATA[".length(); i++) 85 | { 86 | //whiteSpaceOnly = false; 87 | 88 | c = (char) read(scanner); 89 | cdataCharsRead++; 90 | 91 | if (c != "![CDATA[".charAt(i)) 92 | { 93 | 94 | //we don't have a match - wind back only the cdata characters 95 | rewind(scanner, cdataCharsRead); 96 | inCdata = false; 97 | return false; 98 | } 99 | } 100 | 101 | inCdata = true; 102 | return true; 103 | 104 | //return false; 105 | } 106 | } 107 | else 108 | { 109 | 110 | if (c == ']') 111 | { 112 | 113 | for (int i = 0; i < "]>".length(); i++) 114 | { 115 | 116 | c = (char) read(scanner); 117 | 118 | if (c != "]>".charAt(i)) 119 | { 120 | //we're still in the CData section, so just continue processing 121 | return true; 122 | } 123 | } 124 | 125 | //we found all the matching characters at the end of the CData section, so break out of this 126 | inCdata = false; 127 | 128 | //we're still in XML text 129 | return true; 130 | 131 | } 132 | } 133 | 134 | return true; 135 | 136 | } 137 | 138 | 139 | 140 | private void rewind(ICharacterScanner scanner, int theCharsRead) 141 | { 142 | while (theCharsRead > 0) 143 | { 144 | theCharsRead--; 145 | unread(scanner); 146 | } 147 | } 148 | 149 | private void unread(ICharacterScanner scanner) 150 | { 151 | scanner.unread(); 152 | charsRead--; 153 | } 154 | private int read(ICharacterScanner scanner) 155 | { 156 | int c = scanner.read(); 157 | charsRead++; 158 | return c; 159 | } 160 | 161 | 162 | private void reinit() 163 | { 164 | charsRead = 0; 165 | whiteSpaceOnly = true; 166 | } 167 | 168 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/scanners/CDataScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.scanners; 2 | 3 | import org.eclipse.jface.text.TextAttribute; 4 | import org.eclipse.jface.text.rules.IRule; 5 | import org.eclipse.jface.text.rules.IToken; 6 | import org.eclipse.jface.text.rules.RuleBasedScanner; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | import com.vf.apex.editor.ColorManager; 10 | import com.vf.apex.editor.IXMLColorConstants; 11 | import com.vf.apex.editor.rules.CDataRule; 12 | 13 | 14 | /** 15 | * 16 | * @author eclipse and AjayHada 17 | * 18 | */ 19 | public class CDataScanner extends RuleBasedScanner 20 | { 21 | 22 | public IToken ESCAPED_CHAR; 23 | public IToken CDATA; 24 | 25 | public CDataScanner(ColorManager colorManager) 26 | { 27 | 28 | CDATA = new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.CDATA))); 29 | 30 | IRule[] rules = new IRule[2]; 31 | 32 | // Add rule to pick up start of c section 33 | rules[0] = new CDataRule(CDATA, true); 34 | // Add a rule to pick up end of CDATA sections 35 | rules[1] = new CDataRule(CDATA, false); 36 | 37 | setRules(rules); 38 | } 39 | 40 | 41 | 42 | public IToken nextToken() 43 | { 44 | return super.nextToken(); 45 | } 46 | } -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/scanners/XMLPartitionScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.scanners; 2 | 3 | import org.eclipse.jface.text.rules.IPredicateRule; 4 | import org.eclipse.jface.text.rules.IToken; 5 | import org.eclipse.jface.text.rules.MultiLineRule; 6 | import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | import com.vf.apex.editor.rules.TagRule; 10 | 11 | public class XMLPartitionScanner extends RuleBasedPartitionScanner { 12 | public final static String XML_COMMENT = "__xml_comment"; 13 | public final static String XML_TAG = "__xml_tag"; 14 | 15 | public XMLPartitionScanner() { 16 | 17 | IToken xmlComment = new Token(XML_COMMENT); 18 | IToken tag = new Token(XML_TAG); 19 | 20 | IPredicateRule[] rules = new IPredicateRule[2]; 21 | 22 | rules[0] = new MultiLineRule("", xmlComment); 23 | rules[1] = new TagRule(tag); 24 | 25 | setPredicateRules(rules); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/scanners/XMLScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.scanners; 2 | 3 | import org.eclipse.jface.text.TextAttribute; 4 | import org.eclipse.jface.text.rules.IRule; 5 | import org.eclipse.jface.text.rules.IToken; 6 | import org.eclipse.jface.text.rules.RuleBasedScanner; 7 | import org.eclipse.jface.text.rules.SingleLineRule; 8 | import org.eclipse.jface.text.rules.Token; 9 | import org.eclipse.jface.text.rules.WhitespaceRule; 10 | 11 | import com.vf.apex.editor.ColorManager; 12 | import com.vf.apex.editor.IXMLColorConstants; 13 | import com.vf.apex.editor.XMLWhitespaceDetector; 14 | 15 | public class XMLScanner extends RuleBasedScanner { 16 | 17 | public XMLScanner(ColorManager manager) { 18 | IToken procInstr = 19 | new Token( 20 | new TextAttribute( 21 | manager.getColor(IXMLColorConstants.PROC_INSTR))); 22 | 23 | IRule[] rules = new IRule[2]; 24 | //Add rule for processing instructions 25 | rules[0] = new SingleLineRule("", procInstr); 26 | // Add generic whitespace rule. 27 | rules[1] = new WhitespaceRule(new XMLWhitespaceDetector()); 28 | 29 | setRules(rules); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/scanners/XMLTagScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.scanners; 2 | 3 | import org.eclipse.jface.text.TextAttribute; 4 | import org.eclipse.jface.text.rules.IRule; 5 | import org.eclipse.jface.text.rules.IToken; 6 | import org.eclipse.jface.text.rules.RuleBasedScanner; 7 | import org.eclipse.jface.text.rules.SingleLineRule; 8 | import org.eclipse.jface.text.rules.Token; 9 | import org.eclipse.jface.text.rules.WhitespaceRule; 10 | 11 | import com.vf.apex.editor.ColorManager; 12 | import com.vf.apex.editor.IXMLColorConstants; 13 | import com.vf.apex.editor.XMLWhitespaceDetector; 14 | 15 | public class XMLTagScanner extends RuleBasedScanner { 16 | 17 | public XMLTagScanner(ColorManager manager) { 18 | IToken string = 19 | new Token( 20 | new TextAttribute(manager.getColor(IXMLColorConstants.STRING))); 21 | 22 | IRule[] rules = new IRule[3]; 23 | 24 | // Add rule for double quotes 25 | rules[0] = new SingleLineRule("\"", "\"", string, '\\'); 26 | // Add a rule for single quotes 27 | rules[1] = new SingleLineRule("'", "'", string, '\\'); 28 | // Add generic whitespace rule. 29 | rules[2] = new WhitespaceRule(new XMLWhitespaceDetector()); 30 | 31 | setRules(rules); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RichVisualForceEditor/src/com/vf/apex/editor/scanners/XMLTextScanner.java: -------------------------------------------------------------------------------- 1 | package com.vf.apex.editor.scanners; 2 | 3 | import org.eclipse.jface.text.TextAttribute; 4 | import org.eclipse.jface.text.rules.IRule; 5 | import org.eclipse.jface.text.rules.IToken; 6 | import org.eclipse.jface.text.rules.RuleBasedScanner; 7 | import org.eclipse.jface.text.rules.Token; 8 | 9 | import com.vf.apex.editor.ColorManager; 10 | import com.vf.apex.editor.IXMLColorConstants; 11 | import com.vf.apex.editor.rules.CDataRule; 12 | 13 | /** 14 | * 15 | * @author eclipse and AjayHada 16 | * 17 | */ 18 | public class XMLTextScanner extends RuleBasedScanner 19 | { 20 | 21 | public IToken ESCAPED_CHAR; 22 | public IToken CDATA_START; 23 | public IToken CDATA_END; 24 | public IToken CDATA_TEXT; 25 | 26 | IToken currentToken; 27 | 28 | public XMLTextScanner(ColorManager colorManager) 29 | { 30 | 31 | ESCAPED_CHAR = new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.ESCAPED_CHAR))); 32 | CDATA_START = new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.CDATA))); 33 | CDATA_END = new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.CDATA))); 34 | CDATA_TEXT = new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.CDATA_TEXT))); 35 | IRule[] rules = new IRule[2]; 36 | 37 | // Add rule to pick up escaped chars 38 | // Add rule to pick up start of CDATA section 39 | rules[0] = new CDataRule(CDATA_START, true); 40 | // Add a rule to pick up end of CDATA sections 41 | rules[1] = new CDataRule(CDATA_END, false); 42 | setRules(rules); 43 | 44 | } 45 | 46 | public IToken nextToken() 47 | { 48 | IToken token = super.nextToken(); 49 | if (currentToken == CDATA_START || currentToken == CDATA_TEXT && token != CDATA_END) 50 | { 51 | this.currentToken = CDATA_TEXT; 52 | return CDATA_TEXT; 53 | } 54 | this.currentToken = token; 55 | return token; 56 | } 57 | } -------------------------------------------------------------------------------- /RichVisualForceEditorFeature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | RichVisualForceEditorFeature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /RichVisualForceEditorFeature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml 2 | -------------------------------------------------------------------------------- /RichVisualForceEditorFeature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | *What is Rich VisualForce Editor Plugin ? 10 | 11 | It is an eclipse editor plugin which provides rich text support for visualforce pages and components. Plugin provides code assistance for html and visualforce tags and attributes. It also provide context sensitive help for apex visualforce tags. I am planning to implement more features to simplify visualforce page/component development. 12 | 13 | *Features 14 | 1,provides code assistance for html4 and apex visualforce tags. 15 | 2,provide context sensitive help. 16 | 3,provide easy links to view visualforce and apex developer guide. 17 | 18 | *How to install ? 19 | 1, you can download plugin jar from download section. download location: "https://github.com/ajayhada/Rich-VisualForce-Editor/downloads" after download extract plugin zip to some folder then copy RichVisualForceEditor_X.X.X.X.jar file to "plugin" folder inside eclipse install folder. then restart the eclipse. 20 | 2, you can directly install this plugin from plugin update site. Update site location : "http://dl.dropbox.com/u/12269376/RichVisualForceEditorUpdateSite" 21 | 22 | *How it works ? 23 | Plugin supports ".page", and ".component" extensions. so you can easily open both type of files. to open salesforce page and components just right click on file >> select "open with" menu option >> now select "Rich VisualForce Editor" from sub menu, it will open salesforce page or component in Rich editor. 24 | 25 | Plugin needs atleast one top level element to provide content assistance. so if file is empty then please add one top level tag, after that just type less then "<" and press [ALT+SPACE] key combination for assistance. it also provide attribute assistance. 26 | 27 | 28 | 29 | [Enter Copyright Description here.] 30 | 31 | 32 | 33 | Eclipse Public License - v 1.0 34 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS 35 | ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR 36 | DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE 37 | OF THIS AGREEMENT. 38 | 1. DEFINITIONS 39 | "Contribution" means: 40 | a) in the case of the initial Contributor, the initial code and 41 | documentation distributed under this Agreement, and 42 | b) in the case of each subsequent Contributor: 43 | i) changes to the Program, and 44 | ii) additions to the Program; 45 | where such changes and/or additions to the Program originate 46 | from and are distributed by that particular Contributor. A Contribution 47 | 'originates' from a Contributor if it was added to the Program 48 | by such Contributor itself or anyone acting on such Contributor's 49 | behalf. Contributions do not include additions to the Program 50 | which: (i) are separate modules of software distributed in conjunction 51 | with the Program under their own license agreement, and (ii) 52 | are not derivative works of the Program. 53 | "Contributor" means any person or entity that distributes the 54 | Program. 55 | "Licensed Patents" mean patent claims licensable by a Contributor 56 | which are necessarily infringed by the use or sale of its Contribution 57 | alone or when combined with the Program. 58 | "Program" means the Contributions distributed in accordance with 59 | this Agreement. 60 | "Recipient" means anyone who receives the Program under this 61 | Agreement, including all Contributors. 62 | 2. GRANT OF RIGHTS 63 | a) Subject to the terms of this Agreement, each Contributor hereby 64 | grants Recipient a non-exclusive, worldwide, royalty-free copyright 65 | license to reproduce, prepare derivative works of, publicly display, 66 | publicly perform, distribute and sublicense the Contribution 67 | of such Contributor, if any, and such derivative works, in source 68 | code and object code form. 69 | b) Subject to the terms of this Agreement, each Contributor hereby 70 | grants Recipient a non-exclusive, worldwide, royalty-free patent 71 | license under Licensed Patents to make, use, sell, offer to sell, 72 | import and otherwise transfer the Contribution of such Contributor, 73 | if any, in source code and object code form. This patent license 74 | shall apply to the combination of the Contribution and the Program 75 | if, at the time the Contribution is added by the Contributor, 76 | such addition of the Contribution causes such combination to 77 | be covered by the Licensed Patents. The patent license shall 78 | not apply to any other combinations which include the Contribution. 79 | No hardware per se is licensed hereunder. 80 | c) Recipient understands that although each Contributor grants 81 | the licenses to its Contributions set forth herein, no assurances 82 | are provided by any Contributor that the Program does not infringe 83 | the patent or other intellectual property rights of any other 84 | entity. Each Contributor disclaims any liability to Recipient 85 | for claims brought by any other entity based on infringement 86 | of intellectual property rights or otherwise. As a condition 87 | to exercising the rights and licenses granted hereunder, each 88 | Recipient hereby assumes sole responsibility to secure any other 89 | intellectual property rights needed, if any. For example, if 90 | a third party patent license is required to allow Recipient to 91 | distribute the Program, it is Recipient's responsibility to acquire 92 | that license before distributing the Program. 93 | d) Each Contributor represents that to its knowledge it has sufficient 94 | copyright rights in its Contribution, if any, to grant the copyright 95 | license set forth in this Agreement. 96 | 3. REQUIREMENTS 97 | A Contributor may choose to distribute the Program in object 98 | code form under its own license agreement, provided that: 99 | a) it complies with the terms and conditions of this Agreement; 100 | and 101 | b) its license agreement: 102 | i) effectively disclaims on behalf of all Contributors all warranties 103 | and conditions, express and implied, including warranties or 104 | conditions of title and non-infringement, and implied warranties 105 | or conditions of merchantability and fitness for a particular 106 | purpose; 107 | ii) effectively excludes on behalf of all Contributors all liability 108 | for damages, including direct, indirect, special, incidental 109 | and consequential damages, such as lost profits; 110 | iii) states that any provisions which differ from this Agreement 111 | are offered by that Contributor alone and not by any other party; 112 | and 113 | iv) states that source code for the Program is available from 114 | such Contributor, and informs licensees how to obtain it in a 115 | reasonable manner on or through a medium customarily used for 116 | software exchange. 117 | When the Program is made available in source code form: 118 | a) it must be made available under this Agreement; and 119 | b) a copy of this Agreement must be included with each copy of 120 | the Program. 121 | Contributors may not remove or alter any copyright notices contained 122 | within the Program. 123 | Each Contributor must identify itself as the originator of its 124 | Contribution, if any, in a manner that reasonably allows subsequent 125 | Recipients to identify the originator of the Contribution. 126 | 4. COMMERCIAL DISTRIBUTION 127 | Commercial distributors of software may accept certain responsibilities 128 | with respect to end users, business partners and the like. While 129 | this license is intended to facilitate the commercial use of 130 | the Program, the Contributor who includes the Program in a commercial 131 | product offering should do so in a manner which does not create 132 | potential liability for other Contributors. Therefore, if a Contributor 133 | includes the Program in a commercial product offering, such Contributor 134 | ("Commercial Contributor") hereby agrees to defend and indemnify 135 | every other Contributor ("Indemnified Contributor") against any 136 | losses, damages and costs (collectively "Losses") arising from 137 | claims, lawsuits and other legal actions brought by a third party 138 | against the Indemnified Contributor to the extent caused by the 139 | acts or omissions of such Commercial Contributor in connection 140 | with its distribution of the Program in a commercial product 141 | offering. The obligations in this section do not apply to any 142 | claims or Losses relating to any actual or alleged intellectual 143 | property infringement. In order to qualify, an Indemnified Contributor 144 | must: a) promptly notify the Commercial Contributor in writing 145 | of such claim, and b) allow the Commercial Contributor to control, 146 | and cooperate with the Commercial Contributor in, the defense 147 | and any related settlement negotiations. The Indemnified Contributor 148 | may participate in any such claim at its own expense. 149 | For example, a Contributor might include the Program in a commercial 150 | product offering, Product X. That Contributor is then a Commercial 151 | Contributor. If that Commercial Contributor then makes performance 152 | claims, or offers warranties related to Product X, those performance 153 | claims and warranties are such Commercial Contributor's responsibility 154 | alone. Under this section, the Commercial Contributor would have 155 | to defend claims against the other Contributors related to those 156 | performance claims and warranties, and if a court requires any 157 | other Contributor to pay any damages as a result, the Commercial 158 | Contributor must pay those damages. 159 | 5. NO WARRANTY 160 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM 161 | IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 162 | OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, 163 | ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY 164 | OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely 165 | responsible for determining the appropriateness of using and 166 | distributing the Program and assumes all risks associated with 167 | its exercise of rights under this Agreement , including but not 168 | limited to the risks and costs of program errors, compliance 169 | with applicable laws, damage to or loss of data, programs or 170 | equipment, and unavailability or interruption of operations. 171 | 6. DISCLAIMER OF LIABILITY 172 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT 173 | NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, 174 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 175 | (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND 176 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 177 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 178 | OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE 179 | OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY 180 | OF SUCH DAMAGES. 181 | 7. GENERAL 182 | If any provision of this Agreement is invalid or unenforceable 183 | under applicable law, it shall not affect the validity or enforceability 184 | of the remainder of the terms of this Agreement, and without 185 | further action by the parties hereto, such provision shall be 186 | reformed to the minimum extent necessary to make such provision 187 | valid and enforceable. 188 | If Recipient institutes patent litigation against any entity 189 | (including a cross-claim or counterclaim in a lawsuit) alleging 190 | that the Program itself (excluding combinations of the Program 191 | with other software or hardware) infringes such Recipient's patent(s), 192 | then such Recipient's rights granted under Section 2(b) shall 193 | terminate as of the date such litigation is filed. 194 | All Recipient's rights under this Agreement shall terminate if 195 | it fails to comply with any of the material terms or conditions 196 | of this Agreement and does not cure such failure in a reasonable 197 | period of time after becoming aware of such noncompliance. If 198 | all Recipient's rights under this Agreement terminate, Recipient 199 | agrees to cease use and distribution of the Program as soon as 200 | reasonably practicable. However, Recipient's obligations under 201 | this Agreement and any licenses granted by Recipient relating 202 | to the Program shall continue and survive. 203 | Everyone is permitted to copy and distribute copies of this Agreement, 204 | but in order to avoid inconsistency the Agreement is copyrighted 205 | and may only be modified in the following manner. The Agreement 206 | Steward reserves the right to publish new versions (including 207 | revisions) of this Agreement from time to time. No one other 208 | than the Agreement Steward has the right to modify this Agreement. 209 | The Eclipse Foundation is the initial Agreement Steward. The 210 | Eclipse Foundation may assign the responsibility to serve as 211 | the Agreement Steward to a suitable separate entity. Each new 212 | version of the Agreement will be given a distinguishing version 213 | number. The Program (including Contributions) may always be distributed 214 | subject to the version of the Agreement under which it was received. 215 | In addition, after a new version of the Agreement is published, 216 | Contributor may elect to distribute the Program (including its 217 | Contributions) under the new version. Except as expressly stated 218 | in Sections 2(a) and 2(b) above, Recipient receives no rights 219 | or licenses to the intellectual property of any Contributor under 220 | this Agreement, whether expressly, by implication, estoppel or 221 | otherwise. All rights in the Program not expressly granted under 222 | this Agreement are reserved. 223 | This Agreement is governed by the laws of the State of New York 224 | and the intellectual property laws of the United States of America. 225 | No party to this Agreement will bring a legal action under this 226 | Agreement more than one year after the cause of action arose. 227 | Each party waives its rights to a jury trial in any resulting 228 | litigation. 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 243 | 244 | 245 | -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | RichVisualForceEditorUpdateSite 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.UpdateSiteBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.UpdateSiteNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/artifacts.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/artifacts.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/content.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/content.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.0.201111031623.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.0.201111031623.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.2.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.5.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.6.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/features/RichVisualForceEditorFeature_1.0.3.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | RichVisualForceEditorUpdateSite 4 | 5 | 6 | 55 | 56 | 57 | 58 |

59 | 60 | 61 | -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.0.201111031623.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.0.201111031623.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.2.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.5.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.6.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajayhada/Rich-VisualForce-Editor/07a693aca757aac2958308a9338c3e9485641611/RichVisualForceEditorUpdateSite/plugins/RichVisualForceEditor_1.0.3.jar -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rich VisualForce Editor Update Site 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/web/site.css: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /RichVisualForceEditorUpdateSite/web/site.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | RichVisualForceEditorUpdateSite 9 | 10 | 11 | 12 |

RichVisualForceEditorUpdateSite

13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | dark-row 34 | 35 | 36 | light-row 37 | 38 | 39 | 54 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | dark-row 106 | 107 | 108 | light-row 109 | 110 | 111 | 126 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | dark-row 161 | 162 | 163 | light-row 164 | 165 | 166 | 181 | 205 | 206 | 207 | 208 | 209 |
21 | 22 | 24 | 25 |
40 | 41 | 42 | 43 |
44 |
45 | ( - ) 46 |
47 |
48 | 49 | - 50 | 51 |
52 |
53 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
Operating Systems:
Windows Systems:
Languages:
Architecture:
77 |


86 | Uncategorized 87 |
112 | 113 | 114 | 115 |
116 |
117 | ( - ) 118 |
119 |
120 | 121 | - 122 | 123 |
124 |

125 |
127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 |
Operating Systems:
Windows Systems:
Languages:
Architecture:
149 |
167 | 168 | 169 | 170 |
171 |
172 | ( - ) 173 |
174 |
175 | 176 | - 177 | 178 |
179 |

180 |
182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 |
Operating Systems:
Windows Systems:
Languages:
Architecture:
204 |
210 | 211 | 212 |
213 |
214 |
215 | --------------------------------------------------------------------------------