private void updateUIDescriptionText(IPluginElement parentElement) { IPluginObject pluginObject = parentElement.getChildren()[0]; if (pluginObject instanceof IPluginElement) { IPluginElement element = (IPluginElement) pluginObject; if (element.getName().equals(F_CS_ELEMENT_DESCRIPTION) && PDETextHelper.isDefinedAfterTrim(element.getText())) { // Triggers listener to update data description on load fDescriptionText.setText(element.getText().trim()); } } }
@Override protected UnitCompilerDescriptor createDescriptor(IPluginElement extPointElement) { if (extPointElement.getName().equals("unitcompiler")) { String instrName = extPointElement.getAttribute("name").getValue(); String instrClass = extPointElement.getAttribute("class").getValue(); boolean enabled = Boolean.parseBoolean(extPointElement.getAttribute("defaultEnabled").getValue()); IReportableUnitCompiler.Level defaultLevel = IReportableUnitCompiler.Level.IGNORE; try { String level = extPointElement.getAttribute("report").getValue(); defaultLevel = IReportableUnitCompiler.Level.valueOf(level.toUpperCase()); } catch (Exception e) { // noop } StringBuilder instrDesc = new StringBuilder(); for (IPluginObject child : extPointElement.getChildren()) { IPluginElement childElement = (IPluginElement) child; if (childElement.getName().equals("description")) instrDesc.append(childElement.getText()).append(" "); } if (LOGGER.isDebugEnabled()) LOGGER.debug( "Adding extension of unitcompiler from " + extPointElement.getPluginBase().getId() + " named:" + instrName + " class:" + instrClass + " desc:" + instrDesc); return new UnitCompilerDescriptor( extPointElement.getPluginBase().getId(), instrName, instrClass, instrDesc.toString(), enabled, defaultLevel); } else throw new IllegalArgumentException( "Was expecting unitcompiler tag, got " + extPointElement.getName()); }