Minimum Token Count : 50
public MultiDamagerRepairer(ITokenScanner scanner) {
super(scanner);
}
/**
* @param presentation 評価を反映する先
* @param region 評価する範囲
*/
public void createPresentation(TextPresentation presentation,
ITypedRegion region) {
if (fScanner == null) {
addRange(presentation, region.getOffset(), region.getLength(), fDefaultTextAttribute);
return;
}
fScanner.setRange(fDocument, region.getOffset(), region.getLength());
while (true) {
IToken token = fScanner.nextToken();
if (token.isEOF()) {
break;
}
MultiTextAttribute multiAttribute = getMultiTextAttribute(token);
for (int i = 0; i < multiAttribute.size(); i++) {
int start = fScanner.getTokenOffset() + multiAttribute.getOffset(i);
int length = multiAttribute.getLength(i);
addRange(presentation, start, length, multiAttribute.get(i));
}
}
}
/**
* 属性を取得します。
* @param token トークン
* @return 属性
*/
private MultiTextAttribute getMultiTextAttribute(IToken token) {
Object data = token.getData();
if (data instanceof MultiTextAttribute) {
return (MultiTextAttribute)data;
}
return defaultAttr;
}
protected void addRange(
TextPresentation presentation, int offset, int length, TextAttribute attr) {
if (attr != null) {
presentation.addStyleRange(
new StyleRange(offset, length, attr.getForeground(),
attr.getBackground(), attr.getStyle()));
}
}
}
@Override
public boolean performOk() {
for (Iterator it = fields.iterator(); it.hasNext();) {
FieldEditor editor = it.next();
editor.store();
}
return super.performOk();
}
protected void performDefaults() {
for (Iterator it = fields.iterator(); it.hasNext();) {
FieldEditor editor = it.next();
editor.loadDefault();
}
super.performDefaults();
}
IRegion region, IDocument document)
throws CoreException {
try {
int lineNumber = document.getLineOfOffset(region.getOffset());
Map attrs = new HashMap();
attrs.put(IMarker.CHAR_START, Integer.valueOf(
document.getLineOffset(lineNumber)));
attrs.put(IMarker.CHAR_END, Integer.valueOf(
document.getLineOffset(lineNumber + 1) - 1));
attrs.put(LimyQalabMarker.TEST_NAME, method.getElementName());
public static void createPublicGetter(IField javaField,
IProgressMonitor monitor) throws JavaModelException {
List fields = createLimyClass(
javaField.getDeclaringType()).getFields();
IType javaClass = (IType)javaField.getParent();
for (int i = 0; i < fields.size(); i++) {
LimyFieldObject nowField = fields.get(i);
if (nowField.getField().equals(javaField)) {
IJavaElement sibling = decideSibling(fields, i);
VelocityCodeScanner scanner = new VelocityCodeScanner(provider);
Map colors = getColorsFromProvider(provider);
for (int i = 0; i < colorFieldEditors.length; i++) {
LimyColorFieldEditor editor = colorFieldEditors[i];
RGB color = editor.getColorSelector().getColorValue();
String preferenceName = editor.getPreferenceName();
addColor(colors, color, preferenceName);
scanner.setRules(createRules(colors));
}
sourceViewer.unconfigure();
sourceViewer.configure(new VelocitySourceViewerConfiguration(scanner));
foldingGroup = new FoldingActionGroup(this, getSourceViewer());
}
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
setPreferenceStore(LimyEclipsePlugin.getDefault().getPreferenceStore());
}
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
super.handlePreferenceStoreChanged(event);
ProviderManager.getInstance().updateProviders();
if (getSourceViewer() instanceof SourceViewer) {
((SourceViewer)getSourceViewer()).unconfigure();
getSourceViewer().configure(new VelocitySourceViewerConfiguration(this));
LimyWebConstants.CONTENT_PREVIEW);
IDocument document = new Document(content);
previewViewer.setDocument(document);
previewViewer.setEditable(false);
Font font = JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
previewViewer.getTextWidget().setFont(font);
previewViewer.getTextWidget().setBackground(
LimyEclipsePlugin.getDefault().getColorProvider().getColor(
LimyEclipseConstants.P_BGCOLOR));
Control preview = previewViewer.getControl();
}
if (item instanceof Map) {
Map map = (Map)item;
Object result = privatesearchParentM(map, target);
if (result != null) {
return result;
}
}
if (item instanceof Collection) {
Collection list = (Collection)item;
Object result = privatesearchParentC(root, list, target);
if (result != null) {
return result;
}
}
}
return null;
}
}
/**
* 外部リソースからファイルを選択します。
*/
private void setFromExternal() {
FileDialog dialog = new FileDialog(new Shell(), SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*." + targetExt });
String file = dialog.open();
if (file != null) {
control.setText(file);
if (listener != null) {
PropertyChangeEvent evt = new PropertyChangeEvent(
control, "result", null, file
appendAllElements(root, env);
}
public String[] getQalabClassNames() {
return new String[0];
}
public String[] getReportXmlNames() {
return new String[0];
}
public int getSummaryGroup() {
return 3;
}
public String[] getSummaryTypes() {
return new String[0];
}
public String getTargetName() {
return "umlgraph";
}
// ------------------------ Implement Methods
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (!(selection instanceof IStructuredSelection)) {
return;
}
Object element = ((IStructuredSelection)selection).getFirstElement();
if (!(element instanceof IJavaElement)) {
return;
}
IResource resource = ((IJavaElement)element).getResource();
public class UmlgraphCreator extends AbstractAntCreator {
// ------------------------ Implement Methods
public void exec(XmlElement root, LimyQalabEnvironment env)
throws CoreException, FileNotFoundException {
appendAllElements(root, env);
}
public String[] getQalabClassNames() {
return new String[0];
}
public String[] getReportXmlNames() {
return new String[0];
}
public int getSummaryGroup() {
return 3;
public class CreateReportProcessAction extends AbstractJavaElementAction {
@Override
protected void doAction(IJavaElement javaElement, IProgressMonitor monitor)
throws CoreException {
IProject project = javaElement.getJavaProject().getProject();
LimyQalabEnvironment env = LimyQalabPluginUtils.createEnv(project);
CreateBuildXml builder = new CreateBuildXml();
final BuildWarning warningInfo = builder.prepareBuildFiles(env);
builder.createFiles(env);
public PageTesting(Composite parent, int style, LimyQalabEnvironment env) {
super(parent, style, env.getStore());
this.project = env.getProject();
try {
createContents(this);
} catch (CoreException e) {
LimyEclipsePluginUtils.log(e);
}
}
// ------------------------ Private Methods
/**
* @param comp
* @throws CoreException
*/
private void createContents(Composite comp) throws CoreException {
return "xml".equals(file.getFileExtension());
}
if (element instanceof IProject) {
IProject tempTroject = (IProject)element;
return tempTroject.equals(project);
}
return true;
}
};
dialog.addFilter(filter);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
dialog.setInput(root);
label.setText(Messages.LABEL_TESTENV);
label.setLayoutData(FormDataCreater.maxWidthControlDown(targetComp, 8));
Composite gridComp = new Composite(comp, SWT.NONE);
gridComp.setLayout(new GridLayout(2, false));
gridComp.setLayoutData(FormDataCreater.maxWidthControlBottom(label, 0, 100, 0));
for (FileSet fileSet : fileSets) {
DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
for (String fileStr : scanner.getIncludedFiles()) {
File targetBaseDir = fileSet.getDir(getProject());
File file = new File(targetBaseDir, fileStr);
TodoReport cmd = new TodoReport();
try {
if (fileSets.isEmpty()) {
execWithSrcDir(cmd);
return;
}
if (srcDir != null) {
throw new BuildException(
"srcDir と fileset 要素はどちらか一つだけ記述する必要があります。");
}
execWithFileset(cmd);
} catch (IOException e) {
throw new BuildException(e);
}
}
return AbstractUIPlugin.imageDescriptorFromPlugin("org.limy.eclipse.web", path);
}
// ------------------------ Public Methods
/**
* リソース文字列を返します。
* @param key リソースキー
* @return リソース文字列
*/
public static String getResourceString(String key) {
ResourceBundle bundle = getDefault().getResourceBundle();
try {
return (bundle != null) ? bundle.getString(key) : key;
} catch (MissingResourceException e) {
return key;
}
}
/**
* リソースバンドルを返します。
* @return リソースバンドル
*/
public ResourceBundle getResourceBundle() {