code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private static String getXtextKey(String preferenceContainerID, String preferenceName) {
return GENERATOR_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + preferenceContainerID
+ PreferenceConstants.SEPARATOR + preferenceName;
} | java |
public static String getPrefixedKey(String preferenceContainerID, String preferenceName) {
return getXtextKey(getPropertyPrefix(preferenceContainerID), preferenceName);
} | java |
public boolean hasProjectSpecificOptions(String preferenceContainerID, IProject project) {
final IPreferenceStore store = getWritablePreferenceStore(project);
// Compute the key
String key = IS_PROJECT_SPECIFIC;
if (preferenceContainerID != null) {
key = getPropertyPrefix(preferenceContainerID) + "." + IS_PR... | java |
public IProject ifSpecificConfiguration(String preferenceContainerID, IProject project) {
if (project != null && hasProjectSpecificOptions(preferenceContainerID, project)) {
return project;
}
return null;
} | java |
public static boolean parseConverterPreferenceValue(String input, Procedure2<? super String, ? super String> output) {
final StringTokenizer tokenizer = new StringTokenizer(input, PREFERENCE_SEPARATOR);
String key = null;
boolean foundValue = false;
while (tokenizer.hasMoreTokens()) {
final String token = to... | java |
private boolean markAsDeadCode(XExpression expression) {
if (expression instanceof XBlockExpression) {
final XBlockExpression block = (XBlockExpression) expression;
final EList<XExpression> expressions = block.getExpressions();
if (!expressions.isEmpty()) {
markAsDeadCode(expressions.get(0));
return ... | java |
public void addForbiddenInjectionPrefix(String prefix) {
if (!Strings.isEmpty(prefix)) {
final String real = prefix.endsWith(".") ? prefix.substring(0, prefix.length() - 1) : prefix; //$NON-NLS-1$
this.forbiddenInjectionPrefixes.add(real);
}
} | java |
public void addForbiddenInjectionPostfixes(String postfix) {
if (!Strings.isEmpty(postfix)) {
final String real = postfix.startsWith(".") ? postfix.substring(1) : postfix; //$NON-NLS-1$
this.forbiddenInjectionPrefixes.add(real);
}
} | java |
public void addModifier(Modifier modifier) {
if (modifier != null) {
final String ruleName = modifier.getType();
if (!Strings.isEmpty(ruleName)) {
List<String> modifiers = this.modifiers.get(ruleName);
if (modifiers == null) {
modifiers = new ArrayList<>();
this.modifiers.put(ruleName, modifie... | java |
public void addDefaultSuper(SuperTypeMapping mapping) {
if (mapping != null) {
this.superTypeMapping.put(mapping.getType(), mapping.getSuper());
}
} | java |
public static <T> T getField(Object obj, String string, Class<?> clazz, Class<T> fieldType) {
try {
final Field field = clazz.getDeclaredField(string);
field.setAccessible(true);
final Object value = field.get(obj);
return fieldType.cast(value);
} catch (Exception exception) {
throw new Error(excepti... | java |
public static <T> void copyFields(Class<T> type, T dest, T source) {
Class<?> clazz = type;
while (clazz != null && !Object.class.equals(clazz)) {
for (final Field field : clazz.getDeclaredFields()) {
if (!Modifier.isStatic(field.getModifiers())) {
field.setAccessible(true);
try {
field.set(d... | java |
public Control createControl(Composite parent) {
this.control = SWTFactory.createComposite(
parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
final int nbColumns = this.enableSystemWideSelector ? 3 : 2;
final Group group = SWTFactory.createGroup(this.control,
MoreObjects.firstNonNull(this.title,... | java |
public void updateExternalSREButtonLabels() {
if (this.enableSystemWideSelector) {
final ISREInstall wideSystemSRE = SARLRuntime.getDefaultSREInstall();
final String wideSystemSRELabel;
if (wideSystemSRE == null) {
wideSystemSRELabel = Messages.SREConfigurationBlock_0;
} else {
wideSystemSRELabel ... | java |
@SuppressWarnings("checkstyle:npathcomplexity")
public boolean selectSpecificSRE(ISREInstall sre) {
ISREInstall theSRE = sre;
if (theSRE == null) {
theSRE = SARLRuntime.getDefaultSREInstall();
}
if (theSRE != null) {
boolean changed = false;
final boolean oldNotify = this.notify;
try {
this.not... | java |
public ISREInstall getSelectedSRE() {
if (this.enableSystemWideSelector && this.systemSREButton.getSelection()) {
return SARLRuntime.getDefaultSREInstall();
}
if (!this.projectProviderFactories.isEmpty() && this.projectSREButton.getSelection()) {
return retreiveProjectSRE();
}
return getSpecificSRE();
... | java |
public ISREInstall getSpecificSRE() {
final int index = this.runtimeEnvironmentCombo.getSelectionIndex();
if (index >= 0 && index < this.runtimeEnvironments.size()) {
return this.runtimeEnvironments.get(index);
}
return null;
} | java |
public void updateEnableState() {
boolean comboEnabled = !this.runtimeEnvironments.isEmpty();
boolean searchEnabled = true;
if (isSystemWideDefaultSRE() || isProjectSRE()) {
comboEnabled = false;
searchEnabled = false;
}
this.runtimeEnvironmentCombo.setEnabled(comboEnabled);
this.runtimeEnvironmentSea... | java |
public void initialize() {
// Initialize the SRE list
this.runtimeEnvironments.clear();
final ISREInstall[] sres = SARLRuntime.getSREInstalls();
Arrays.sort(sres, new Comparator<ISREInstall>() {
@Override
public int compare(ISREInstall o1, ISREInstall o2) {
return o1.getName().compareTo(o2.getName());... | java |
protected void handleInstalledSREsButtonSelected() {
PreferencesUtil.createPreferenceDialogOn(
getControl().getShell(),
SREsPreferencePage.ID,
new String[] {SREsPreferencePage.ID},
null).open();
} | java |
public IStatus validate(ISREInstall sre) {
final IStatus status;
if (this.enableSystemWideSelector && this.systemSREButton.getSelection()) {
if (SARLRuntime.getDefaultSREInstall() == null) {
status = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, Messages.SREConfigurationBlock_5);
} else {
... | java |
protected static void closeWelcomePage() {
final IIntroManager introManager = PlatformUI.getWorkbench().getIntroManager();
if (introManager != null) {
final IIntroPart intro = introManager.getIntro();
if (intro != null) {
introManager.closeIntro(intro);
}
}
} | java |
public void destroy() {
// Unregister from Hazelcast layer.
synchronized (getSpaceIDsMutex()) {
if (this.internalListener != null) {
this.spaceIDs.removeDMapListener(this.internalListener);
}
// Delete the spaces. If this function is called, it
// means that the spaces seems to have no more particip... | java |
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void ensureLocalSpaceDefinition(SpaceID id, Object[] initializationParameters) {
synchronized (getSpaceRepositoryMutex()) {
if (!this.spaces.containsKey(id)) {
createSpaceInstance((Class) id.getSpaceSpecification(), id, false, initializationParameters);... | java |
protected void removeLocalSpaceDefinition(SpaceID id, boolean isLocalDestruction) {
final Space space;
synchronized (getSpaceRepositoryMutex()) {
space = this.spaces.remove(id);
if (space != null) {
this.spacesBySpec.remove(id.getSpaceSpecification(), id);
}
}
if (space != null) {
fireSpaceRemov... | java |
protected void removeLocalSpaceDefinitions(boolean isLocalDestruction) {
List<Space> removedSpaces = null;
synchronized (getSpaceRepositoryMutex()) {
if (!this.spaces.isEmpty()) {
removedSpaces = new ArrayList<>(this.spaces.size());
final Iterator<Entry<SpaceID, Space>> iterator = this.spaces.entrySet().... | java |
public <S extends io.sarl.lang.core.Space> S createSpace(SpaceID spaceID,
Class<? extends SpaceSpecification<S>> spec, Object... creationParams) {
synchronized (getSpaceRepositoryMutex()) {
if (!this.spaces.containsKey(spaceID)) {
return createSpaceInstance(spec, spaceID, true, creationParams);
}
}
r... | java |
@SuppressWarnings("unchecked")
public <S extends io.sarl.lang.core.Space> S getOrCreateSpaceWithSpec(SpaceID spaceID,
Class<? extends SpaceSpecification<S>> spec, Object... creationParams) {
synchronized (getSpaceRepositoryMutex()) {
final Collection<SpaceID> ispaces = this.spacesBySpec.get(spec);
final S f... | java |
@SuppressWarnings("unchecked")
public <S extends io.sarl.lang.core.Space> S getOrCreateSpaceWithID(SpaceID spaceID,
Class<? extends SpaceSpecification<S>> spec, Object... creationParams) {
synchronized (getSpaceRepositoryMutex()) {
Space space = this.spaces.get(spaceID);
if (space == null) {
space = cre... | java |
public SynchronizedCollection<? extends Space> getSpaces() {
synchronized (getSpaceRepositoryMutex()) {
return Collections3.synchronizedCollection(Collections.unmodifiableCollection(this.spaces.values()),
getSpaceRepositoryMutex());
}
} | java |
protected IStatus revalidate(int ignoreCauses) {
try {
setDirty(false);
resolveDirtyFields(false);
return getValidity(ignoreCauses);
} catch (Throwable e) {
if ((ignoreCauses & CODE_GENERAL) == 0) {
return SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, CODE_GENERAL, e);
}
return SA... | java |
@Override
public void setClassPathEntries(List<IRuntimeClasspathEntry> libraries) {
if (isDirty()) {
setDirty(false);
resolveDirtyFields(true);
}
if ((libraries == null && this.classPathEntries != null)
|| (libraries != null
&& (this.classPathEntries == null
|| libraries != this.classPathEnt... | java |
protected static String formatCommandLineOption(String name, String value) {
final StringBuilder str = new StringBuilder();
str.append("--"); //$NON-NLS-1$
if (!Strings.isNullOrEmpty(name)) {
str.append(name);
if (!Strings.isNullOrEmpty(value)) {
str.append("="); //$NON-NLS-1$
str.append(value);
... | java |
public boolean isCastOperatorLinkingEnabled(SarlCastedExpression cast) {
final LightweightTypeReference sourceType = getStackedResolvedTypes().getReturnType(cast.getTarget());
final LightweightTypeReference destinationType = getReferenceOwner().toLightweightTypeReference(cast.getType());
if (sourceType.isPrimitiv... | java |
public List<? extends ILinkingCandidate> getLinkingCandidates(SarlCastedExpression cast) {
// Prepare the type resolver.
final StackedResolvedTypes demandComputedTypes = pushTypes();
final AbstractTypeComputationState forked = withNonVoidExpectation(demandComputedTypes);
final ForwardingResolvedTypes demandReso... | java |
protected ILinkingCandidate createCandidate(SarlCastedExpression cast,
ExpressionTypeComputationState state,
IIdentifiableElementDescription description) {
return new CastOperatorLinkingCandidate(cast, description,
getSingleExpectation(state),
state);
} | java |
@SuppressWarnings("static-method")
public void resetFeature(SarlCastedExpression object) {
setStructuralFeature(object, SarlPackage.Literals.SARL_CASTED_EXPRESSION__FEATURE, null);
setStructuralFeature(object, SarlPackage.Literals.SARL_CASTED_EXPRESSION__RECEIVER, null);
setStructuralFeature(object, SarlPackage.... | java |
public IDocumentAutoFormatter getDocumentAutoFormatter() {
final IDocument document = getDocument();
if (document instanceof IXtextDocument) {
final IDocumentAutoFormatter formatter = this.autoFormatterProvider.get();
formatter.bind((IXtextDocument) document, this.fContentFormatter);
return formatter;
}
... | java |
@Pure
public IExpressionBuilder getInitialValue() {
IExpressionBuilder exprBuilder = this.expressionProvider.get();
exprBuilder.eInit(getSarlField(), new Procedures.Procedure1<XExpression>() {
public void apply(XExpression expr) {
getSarlField().setInitialValue(expr);
}
}, getTypeResolutionContext(... | java |
public void setOutlineEntryFormat(String formatWithoutNumbers, String formatWithNumbers) {
if (!Strings.isEmpty(formatWithoutNumbers)) {
this.outlineEntryWithoutNumberFormat = formatWithoutNumbers;
}
if (!Strings.isEmpty(formatWithNumbers)) {
this.outlineEntryWithNumberFormat = formatWithNumbers;
}
} | java |
public void setOutlineDepthRange(IntegerRange level) {
if (level == null) {
this.outlineDepthRange = new IntegerRange(DEFAULT_OUTLINE_TOP_LEVEL, DEFAULT_OUTLINE_TOP_LEVEL);
} else {
this.outlineDepthRange = level;
}
} | java |
@SuppressWarnings("static-method")
protected ReferenceContext extractReferencableElements(String text) {
final ReferenceContext context = new ReferenceContext();
// Visit the links and record the transformations
final MutableDataSet options = new MutableDataSet();
final Parser parser = Parser.builder(options)... | java |
protected String transformHtmlLinks(String content, ReferenceContext references) {
if (!isPureHtmlReferenceTransformation()) {
return content;
}
// Prepare replacement data structures
final Map<String, String> replacements = new TreeMap<>();
// Visit the links and record the transformations
final org.j... | java |
protected String transformMardownLinks(String content, ReferenceContext references) {
if (!isMarkdownToHtmlReferenceTransformation()) {
return content;
}
// Prepare replacement data structures
final Map<BasedSequence, String> replacements = new TreeMap<>((cmp1, cmp2) -> {
final int cmp = Integer.compare(... | java |
static String convertURLToString(URL url) {
if (URISchemeType.FILE.isURL(url)) {
final StringBuilder externalForm = new StringBuilder();
externalForm.append(url.getPath());
final String ref = url.getRef();
if (!Strings.isEmpty(ref)) {
externalForm.append("#").append(ref); //$NON-NLS-1$
}
return ... | java |
protected URL transformURL(URL link, ReferenceContext references) {
if (URISchemeType.FILE.isURL(link)) {
File filename = FileSystem.convertURLToFile(link);
if (Strings.isEmpty(filename.getName())) {
// This is a link to the local document.
final String anchor = transformURLAnchor(filename, link.getRef(... | java |
@SuppressWarnings("static-method")
protected String transformURLAnchor(File file, String anchor, ReferenceContext references) {
String anc = anchor;
if (references != null) {
anc = references.validateAnchor(anc);
}
return anc;
} | java |
public static boolean isMarkdownFileExtension(String extension) {
for (final String ext : MARKDOWN_FILE_EXTENSIONS) {
if (Strings.equal(ext, extension)) {
return true;
}
}
return false;
} | java |
protected void addOutlineEntry(StringBuilder outline, int level, String sectionNumber, String title,
String sectionId, boolean htmlOutput) {
if (htmlOutput) {
indent(outline, level - 1, " "); //$NON-NLS-1$
outline.append("<li><a href=\"#"); //$NON-NLS-1$
outline.append(sectionId);
outline.append("\">"... | java |
protected String formatSectionTitle(String prefix, String sectionNumber, String title, String sectionId) {
return MessageFormat.format(getSectionTitleFormat(), prefix, sectionNumber, title, sectionId) + "\n"; //$NON-NLS-1$
} | java |
protected static void indent(StringBuilder buffer, int number, String character) {
for (int i = 0; i < number; ++i) {
buffer.append(character);
}
} | java |
protected static int computeLineNo(Node node) {
final int offset = node.getStartOffset();
final BasedSequence seq = node.getDocument().getChars();
int tmpOffset = seq.endOfLine(0);
int lineno = 1;
while (tmpOffset < offset) {
++lineno;
tmpOffset = seq.endOfLineAnyEOL(tmpOffset + seq.eolLength(tmpOffset)... | java |
protected Iterable<DynamicValidationComponent> createValidatorComponents(Image it, File currentFile,
DynamicValidationContext context) {
final Collection<DynamicValidationComponent> components = new ArrayList<>();
if (isLocalImageReferenceValidation()) {
final int lineno = computeLineNo(it);
final URL url ... | java |
protected Iterable<DynamicValidationComponent> createValidatorComponents(Link it, File currentFile,
DynamicValidationContext context) {
final Collection<DynamicValidationComponent> components = new ArrayList<>();
if (isLocalFileReferenceValidation() || isRemoteReferenceValidation()) {
final int lineno = compu... | java |
@SuppressWarnings("static-method")
protected DynamicValidationComponent createLocalImageValidatorComponent(Image it, URL url, int lineno,
File currentFile, DynamicValidationContext context) {
File fn = FileSystem.convertURLToFile(url);
if (!fn.isAbsolute()) {
fn = FileSystem.join(currentFile.getParentFile(),... | java |
@SuppressWarnings("static-method")
protected Collection<DynamicValidationComponent> createLocalFileValidatorComponents(Link it, URL url, int lineno,
File currentFile, DynamicValidationContext context) {
File fn = FileSystem.convertURLToFile(url);
if (Strings.isEmpty(fn.getName())) {
// Special case: the URL ... | java |
@SuppressWarnings("static-method")
protected Collection<DynamicValidationComponent> createRemoteReferenceValidatorComponents(Link it, URL url, int lineno,
File currentFile, DynamicValidationContext context) {
return Collections.singleton(new DynamicValidationComponent() {
@Override
public String functionNam... | java |
public JvmParameterizedTypeReference newTypeRef(Notifier context, String typeName) {
JvmTypeReference typeReference;
try {
typeReference = findType(context, typeName);
getImportManager().addImportFor(typeReference.getType());
return (JvmParameterizedTypeReference) typeReference;
} catch (TypeNotPresentEx... | java |
@Pure
protected boolean isSubTypeOf(EObject context, JvmTypeReference subType, JvmTypeReference superType) {
if (isTypeReference(superType) && isTypeReference(subType)) {
StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, context);
LightweightTypeReferenceFactory factory = new Lightwei... | java |
@Pure
protected boolean isTypeReference(JvmTypeReference typeReference) {
return (typeReference != null && !typeReference.eIsProxy()
&& typeReference.getType() != null && !typeReference.getType().eIsProxy());
} | java |
@Pure
protected boolean isActionBodyAllowed(XtendTypeDeclaration type) {
return !(type instanceof SarlAnnotationType
|| type instanceof SarlCapacity
|| type instanceof SarlEvent
|| type instanceof SarlInterface);
} | java |
protected void recommendFrom(String label, Set<BindingElement> source, Set<Binding> current) {
this.bindingFactory.setName(getName());
boolean hasRecommend = false;
for (final BindingElement sourceElement : source) {
final Binding wrapElement = this.bindingFactory.toBinding(sourceElement);
if (!current.cont... | java |
protected void recommend(Class<?> superModule, GuiceModuleAccess currentModuleAccess) {
LOG.info(MessageFormat.format("Building injection configuration from {0}", //$NON-NLS-1$
superModule.getName()));
final Set<BindingElement> superBindings = new LinkedHashSet<>();
fillFrom(superBindings, superModule.getSupe... | java |
public ConversionType getConversionTypeFor(XAbstractFeatureCall featureCall) {
if (this.conversions == null) {
this.conversions = initMapping();
}
final List<Object> receiver = new ArrayList<>();
AbstractExpressionGenerator.buildCallReceiver(
featureCall,
this.keywords.getThisKeywordLambda(),
thi... | java |
public ConversionResult convertFeatureCall(String simpleName, JvmIdentifiableElement calledFeature, List<Object> leftOperand,
List<Object> receiver, List<XExpression> arguments) {
if (this.conversions == null) {
this.conversions = initMapping();
}
final List<Pair<FeaturePattern, FeatureReplacement>> struct ... | java |
public String convertDeclarationName(String simpleName, SarlAction feature) {
assert simpleName != null;
assert feature != null;
final JvmOperation operation = this.associations.getDirectlyInferredOperation(feature);
if (operation != null) {
if (this.conversions == null) {
this.conversions = initMapping(... | java |
public static IExtraLanguageConversionInitializer getTypeConverterInitializer() {
return it -> {
final List<Pair<String, String>> properties = loadPropertyFile(TYPE_CONVERSION_FILENAME);
if (!properties.isEmpty()) {
for (final Pair<String, String> entry : properties) {
final String source = Objects.toS... | java |
public static IExtraLanguageConversionInitializer getFeatureNameConverterInitializer() {
return it -> {
final List<Pair<String, String>> properties = loadPropertyFile(FEATURE_CONVERSION_FILENAME);
if (!properties.isEmpty()) {
for (final Pair<String, String> entry : properties) {
final String source = O... | java |
public static void install(ResourceSet rs, MavenProject project) {
final Iterator<Adapter> iterator = rs.eAdapters().iterator();
while (iterator.hasNext()) {
if (iterator.next() instanceof MavenProjectAdapter) {
iterator.remove();
}
}
rs.eAdapters().add(new MavenProjectAdapter(project));
} | java |
public static ProgressBarConfig getConfiguration(ConfigurationFactory configFactory) {
assert configFactory != null;
return configFactory.config(ProgressBarConfig.class, PREFIX);
} | java |
@SuppressWarnings("static-method")
@Pure
protected String getGeneratedTypeAccessor(TypeReference generatedType) {
return "get" //$NON-NLS-1$
+ Strings.toFirstUpper(generatedType.getSimpleName())
+ "()"; //$NON-NLS-1$
} | java |
protected List<StringConcatenationClient> generateMembers(
Collection<CodeElementExtractor.ElementDescription> grammarContainers,
TopElementDescription description, boolean forInterface, boolean forAppender, boolean namedMembers) {
final List<StringConcatenationClient> clients = new ArrayList<>();
for (final ... | java |
protected List<StringConcatenationClient> generateMember(CodeElementExtractor.ElementDescription memberDescription,
TopElementDescription topElementDescription, boolean forInterface, boolean forAppender, boolean namedMember) {
if (namedMember) {
return generateNamedMember(memberDescription, topElementDescriptio... | java |
@SuppressWarnings("unlikely-arg-type")
protected List<TopElementDescription> generateTopElements(boolean forInterface, boolean forAppender) {
final Set<String> memberElements = determineMemberElements();
final Collection<EObject> topElementContainers = new ArrayList<>();
final List<TopElementDescription> topElem... | java |
@SuppressWarnings("static-method")
protected boolean isUnpureOperationPrototype(XtendFunction operation) {
if (operation == null
|| operation.isAbstract() || operation.isDispatch() || operation.isNative()
|| operation.getExpression() == null) {
return true;
}
final XtendTypeDeclaration declaringType =... | java |
boolean isPurableOperation(XtendFunction operation, ISideEffectContext context) {
if (isUnpureOperationPrototype(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForNotPureOperation(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForPureOperation(operation)) {
retur... | java |
protected boolean isReassignmentOperator(XBinaryOperation operator) {
if (operator.isReassignFirstArgument()) {
return true;
}
final QualifiedName operatorName = this.operatorMapping.getOperator(
QualifiedName.create(operator.getFeature().getSimpleName()));
final QualifiedName compboundOperatorName = thi... | java |
boolean evaluatePureAnnotationAdapters(org.eclipse.xtext.common.types.JvmOperation operation, ISideEffectContext context) {
int index = -1;
int i = 0;
for (final Adapter adapter : operation.eAdapters()) {
if (adapter.isAdapterForType(AnnotationJavaGenerationAdapter.class)) {
index = i;
break;
}
+... | java |
protected ImageDescriptor handleImageDescriptorError(Object[] params, Throwable exception) {
if (exception instanceof NullPointerException) {
final Object defaultImage = getDefaultImage();
if (defaultImage instanceof ImageDescriptor) {
return (ImageDescriptor) defaultImage;
}
if (defaultImage instance... | java |
protected StyledString signatureWithoutReturnType(StyledString simpleName, JvmExecutable element) {
return simpleName.append(this.uiStrings.styledParameters(element));
} | java |
protected StyledString getHumanReadableName(JvmTypeReference reference) {
if (reference == null) {
return new StyledString("Object"); //$NON-NLS-1$
}
final String name = this.uiStrings.referenceToString(reference, "Object"); //$NON-NLS-1$
return convertToStyledString(name);
} | java |
protected AbstractCreateMavenProjectsOperation createOperation() {
return new AbstractCreateMavenProjectsOperation() {
@SuppressWarnings("synthetic-access")
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor progressMonitor) throws CoreException {
final SubMonitor monitor = SubMoni... | java |
protected void createSREArgsBlock(Composite parent, Font font) {
// Create the block for the SRE
final Group group = new Group(parent, SWT.NONE);
group.setFont(font);
final GridLayout layout = new GridLayout();
group.setLayout(layout);
group.setLayoutData(new GridData(GridData.FILL_BOTH));
// Move the SRE... | java |
private void resetPackageList() {
final Set<PackageDoc> set = new TreeSet<>();
for (final PackageDoc pack : this.root.specifiedPackages()) {
set.add(pack);
}
for (final ClassDoc clazz : this.root.specifiedClasses()) {
set.add(clazz.containingPackage());
}
... | java |
protected OutputConfiguration getOutputConfiguration() {
final Set<OutputConfiguration> outputConfigurations = this.configurationProvider.getOutputConfigurations(getProject());
final String expectedName = ExtraLanguageOutputConfigurations.createOutputConfigurationName(getPreferenceID());
return Iterables.find(out... | java |
protected void createTypeConversionSectionItems(Composite parentComposite) {
final TypeConversionTable typeConversionTable = new TypeConversionTable(
this, getTargetLanguageImage(),
getPreferenceStore(), getPreferenceID());
typeConversionTable.doCreate(parentComposite, getDialogSettings());
makeScrollable... | java |
protected static void makeScrollableCompositeAware(Control control) {
final ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
if (parentScrolledComposite != null) {
parentScrolledComposite.adaptChild(control);
}
} | java |
protected void createFeatureConversionSectionItems(Composite parentComposite) {
final FeatureNameConversionTable typeConversionTable = new FeatureNameConversionTable(
this, getTargetLanguageImage(),
getPreferenceStore(), getPreferenceID());
typeConversionTable.doCreate(parentComposite, getDialogSettings());... | java |
protected void createExperimentalWarningMessage(Composite composite) {
final Label dangerIcon = new Label(composite, SWT.WRAP);
dangerIcon.setImage(getImage(IMAGE));
final GridData labelLayoutData = new GridData();
labelLayoutData.horizontalIndent = 0;
dangerIcon.setLayoutData(labelLayoutData);
} | java |
protected final Image getImage(String imagePath) {
final ImageDescriptor descriptor = getImageDescriptor(imagePath);
if (descriptor == null) {
return null;
}
return descriptor.createImage();
} | java |
@SuppressWarnings("static-method")
protected ImageDescriptor getImageDescriptor(String imagePath) {
final LangActivator activator = LangActivator.getInstance();
final ImageRegistry registry = activator.getImageRegistry();
ImageDescriptor descriptor = registry.getDescriptor(imagePath);
if (descriptor == null) {... | java |
protected void createGeneralSectionItems(Composite composite) {
addCheckBox(composite, getActivationText(),
ExtraLanguagePreferenceAccess.getPrefixedKey(getPreferenceID(),
ExtraLanguagePreferenceAccess.ENABLED_PROPERTY),
BOOLEAN_VALUES, 0);
} | java |
protected void createOutputSectionItems(Composite composite, OutputConfiguration outputConfiguration) {
final Text defaultDirectoryField = addTextField(composite,
org.eclipse.xtext.builder.preferences.Messages.OutputConfigurationPage_Directory,
BuilderPreferenceAccess.getKey(outputConfiguration,
Eclipse... | java |
protected IDialogSettings getDialogSettings() {
try {
return (IDialogSettings) this.reflect.get(this, "fDialogSettings"); //$NON-NLS-1$
} catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
throw new Error(e);
}
} | java |
protected void restoreFilterAndSorter() {
final ProblemTreeViewer viewer = getViewer();
viewer.addFilter(new EmptyInnerPackageFilter());
viewer.addFilter(new HiddenFileFilter());
} | java |
protected void internalResetLabelProvider() {
try {
final PackageExplorerLabelProvider provider = createLabelProvider();
this.reflect.set(this, "fLabelProvider", provider); //$NON-NLS-1$
provider.setIsFlatLayout(isFlatLayout());
final DecoratingJavaLabelProvider decoratingProvider = new DecoratingJavaLabe... | java |
protected ProblemTreeViewer getViewer() {
try {
return (ProblemTreeViewer) this.reflect.get(this, "fViewer"); //$NON-NLS-1$
} catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
throw new Error(e);
}
} | java |
public ISarlEnumLiteralBuilder addSarlEnumLiteral(String name) {
ISarlEnumLiteralBuilder builder = this.iSarlEnumLiteralBuilderProvider.get();
builder.eInit(getSarlEnumeration(), name, getTypeResolutionContext());
return builder;
} | java |
public ClassDoc wrap(ClassDoc source) {
if (source == null || source instanceof Proxy<?> || !(source instanceof ClassDocImpl)) {
return source;
}
return new ClassDocWrapper((ClassDocImpl) source);
} | java |
public FieldDoc wrap(FieldDoc source) {
if (source == null || source instanceof Proxy<?> || !(source instanceof FieldDocImpl)) {
return source;
}
return new FieldDocWrapper((FieldDocImpl) source);
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.