Java Code Examples for org.eclipse.jdt.core.JavaCore#VERSION_1_3

The following examples show how to use org.eclipse.jdt.core.JavaCore#VERSION_1_3 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaModelUtil.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public static String getCompilerCompliance(IVMInstall2 vMInstall, String defaultCompliance) {
	String version= vMInstall.getJavaVersion();
	if (version == null) {
		return defaultCompliance;
	} else if (version.startsWith(JavaCore.VERSION_1_8)) {
		return JavaCore.VERSION_1_8;
	} else if (version.startsWith(JavaCore.VERSION_1_7)) {
		return JavaCore.VERSION_1_7;
	} else if (version.startsWith(JavaCore.VERSION_1_6)) {
		return JavaCore.VERSION_1_6;
	} else if (version.startsWith(JavaCore.VERSION_1_5)) {
		return JavaCore.VERSION_1_5;
	} else if (version.startsWith(JavaCore.VERSION_1_4)) {
		return JavaCore.VERSION_1_4;
	} else if (version.startsWith(JavaCore.VERSION_1_3)) {
		return JavaCore.VERSION_1_3;
	} else if (version.startsWith(JavaCore.VERSION_1_2)) {
		return JavaCore.VERSION_1_3;
	} else if (version.startsWith(JavaCore.VERSION_1_1)) {
		return JavaCore.VERSION_1_3;
	}
	return defaultCompliance;
}
 
Example 2
Source File: JavaModelUtil.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public static String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
	Map<String, String> complianceOptions= executionEnvironment.getComplianceOptions();
	if (complianceOptions != null) {
		Object compliance= complianceOptions.get(JavaCore.COMPILER_COMPLIANCE);
		if (compliance instanceof String)
			return (String)compliance;
	}
	
	// fallback:
	String desc= executionEnvironment.getId();
	if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
		return JavaCore.VERSION_1_8;
	} else if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
		return JavaCore.VERSION_1_7;
	} else if (desc.indexOf(JavaCore.VERSION_1_6) != -1) {
		return JavaCore.VERSION_1_6;
	} else if (desc.indexOf(JavaCore.VERSION_1_5) != -1) {
		return JavaCore.VERSION_1_5;
	} else if (desc.indexOf(JavaCore.VERSION_1_4) != -1) {
		return JavaCore.VERSION_1_4;
	}
	return JavaCore.VERSION_1_3;
}
 
Example 3
Source File: JavadocSpecificsWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void createExtraOptionsGroup(Composite composite) {
	Composite c= new Composite(composite, SWT.NONE);
	c.setLayout(createGridLayout(3));
	c.setLayoutData(createGridData(GridData.FILL_HORIZONTAL, 3, 0));
	((GridLayout) c.getLayout()).marginWidth= 0;

	fOverViewButton= createButton(c, SWT.CHECK, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbutton_label, createGridData(1));
	fOverViewText= createText(c, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 1, 0));
	SWTUtil.setAccessibilityText(fOverViewText, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbutton_description);
	//there really aught to be a way to specify this
	 ((GridData) fOverViewText.getLayoutData()).widthHint= 200;
	fOverViewBrowseButton= createButton(c, SWT.PUSH, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbrowse_label, createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 0));
	SWTUtil.setButtonDimensionHint(fOverViewBrowseButton);

	String str= fStore.getOverview();
	if (str.length() == 0) {
		//default
		fOverViewText.setEnabled(false);
		fOverViewBrowseButton.setEnabled(false);
	} else {
		fOverViewButton.setSelection(true);
		fOverViewText.setText(str);
	}

	createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_vmoptionsfield_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 3, 0));
	fVMOptionsText= createText(composite, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.HORIZONTAL_ALIGN_FILL, 3, 0));
	fVMOptionsText.setText(fStore.getVMParams());


	createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_extraoptionsfield_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 3, 0));
	fExtraOptionsText= createText(composite, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL, null, createGridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL, 3, 0));
	//fExtraOptionsText.setSize(convertWidthInCharsToPixels(60), convertHeightInCharsToPixels(10));

	fExtraOptionsText.setText(fStore.getAdditionalParams());

	Composite inner= new Composite(composite, SWT.NONE);
	inner.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3, 1));
	GridLayout layout= new GridLayout(2, false);
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	inner.setLayout(layout);

	createLabel(inner, SWT.NONE, JavadocExportMessages.JavadocSpecificsWizardPage_sourcecompatibility_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, 1, 0));

	fSourceCombo= createCombo(inner, SWT.NONE, fStore.getSource(), createGridData(1));
	String[] versions= { "-", //$NON-NLS-1$
			JavaCore.VERSION_1_3, JavaCore.VERSION_1_4, JavaCore.VERSION_1_5, JavaCore.VERSION_1_6, JavaCore.VERSION_1_7, JavaCore.VERSION_1_8 };
	fSourceCombo.setItems(versions);
	fSourceCombo.setText(fStore.getSource());


	//Listeners
	fOverViewButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fOverViewBrowseButton, fOverViewText }) {
		@Override
		public void validate() {
			doValidation(OVERVIEWSTATUS);
		}
	});

	fOverViewText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			doValidation(OVERVIEWSTATUS);
		}
	});

	fOverViewBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent event) {
			handleFileBrowseButtonPressed(fOverViewText, new String[] { "*.html" }, JavadocExportMessages.JavadocSpecificsWizardPage_overviewbrowsedialog_title);  //$NON-NLS-1$
		}
	});

}