blob: ce0dc48cf4162fd9a458363e4db5f28b756a738a [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 Red Hat Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* - Mickael Istria (Red Hat Inc.)
*******************************************************************************/
package org.eclipse.ui.genericeditor.tests.contributions;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
public class LongRunningBarContentAssistProcessor extends BarContentAssistProcessor {
public static final String PROPOSAL = "bars are also good for soft drink cocktails.";
public static final int DELAY = 2000;
public LongRunningBarContentAssistProcessor() {
super(PROPOSAL);
}
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
try {
Thread.sleep(DELAY);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return super.computeCompletionProposals(viewer, offset);
}
}