Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JDT - MarkerResolution - How to show HTML content in Proposal window(JDT - MarkerResolution - How to show HTML content in Proposal window)
JDT - MarkerResolution - How to show HTML content in Proposal window [message #1755406] Fri, 03 March 2017 05:06
Suresh P is currently offline Suresh PFriend
Messages: 27
Registered: May 2013
Junior Member
Hi
Im creating custom Marker solution using JDT/AST.

I have additional data about the resolution that is in HTML format. I would like to show this HTML data in Marker Proposal window (see Attached file).

I have given below the code from getResolutions() method of IMarkerResolutionGenerator2 class. IN this method, the cariable 'resolutionDescription' has the HTML content that need to displayed as additional property of marker resolution.

Can you let me know what changes I have to to do to get the HTML content?

@Override
		public IMarkerResolution[] getResolutions(IMarker paramIMarker) {
			IMarkerResolution2[] markerResolutions = null;		
			ArrayList<IMarkerResolution2> markerResolutionsList = new ArrayList<IMarkerResolution2>();
			List<ResolutionType> resolutionTypes = registry.getResolutions();
			Map<String, Set<Integer>> resolutionIndicesMap = registry
					.getRulewiseResolutions();
			String markerRuleName = paramIMarker.getAttribute(
					MarkerFactory.VIOLATED_RULE_NAME, MarkerFactory.STRING_NA);
	        
			// Handling multiple resolutions for same Rule
			for (Integer resolutionIndex : resolutionIndicesMap.get(markerRuleName)) {
				IConfigurationElement resolutionElement = resolutionTypes.get(
						resolutionIndex).getResolutionElement();
				String resolutionClassName = resolutionElement
						.getAttribute(ResolutionType.ATTR_CLASS);
				String resolutionRuleInfo = resolutionElement
						.getAttribute(ResolutionType.ATTR_INFO);

				String markerRuleDesc= paramIMarker.getAttribute(
						MarkerFactory.VIOLATED_RULE_DESC, MarkerFactory.STRING_NA);

				if (MarkerFactory.STRING_NA.equals(resolutionClassName)
						|| MarkerFactory.STRING_NA.equals(resolutionRuleInfo)) {
					continue;
				}

	
					Constructor<?> constructor = (Constructor<?>) Class.forName(
							resolutionClassName).getDeclaredConstructor(
							String.class, String.class);

					if (null == constructor) {
						continue;
					}
					String resolutionDescription = null;
					
					if (!MarkerFactory.STRING_NA.equals(markerRuleDesc)) {	       
						resolutionDescription.append(markerRuleDesc);		
					}

					Object resolutionClass = constructor.newInstance(
							resolutionRuleInfo, resolutionDescription);


					if (null == resolutionClass
							|| !(resolutionClass instanceof IMarkerResolution2)) {
						continue;
					}

					markerResolutionsList.add((IMarkerResolution2) resolutionClass);					
			}
			if (!markerResolutionsList.isEmpty()) {
				// Set the fetched results
				markerResolutions = markerResolutionsList
						.toArray(new IMarkerResolution2[markerResolutionsList
								.size()]);
			}

			return markerResolutions;
		}



Previous Topic:Debugging: source lookup for dynamically compiled & loaded classes
Next Topic:JDT - Find Length of IF Statement
Goto Forum:
  


Current Time: Thu Sep 26 02:42:10 GMT 2024

Powered by FUDForum. Page generated in 0.03000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top