Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil#getIndent()

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil#getIndent() . 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: JavaEditorCodeMiningConfigurationBlock.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
private void createGitSection(int nColumns, Composite parent) {
		final int defaultIndent = 0;
		int extraIndent = LayoutUtil.getIndent();
		String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_scsm;
		Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_sccm"); //$NON-NLS-1$
		PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey,
				null, false);
		ExpandableComposite excomposite = getExpandableComposite(twistieKey);

		Composite inner = createInnerComposite(excomposite, nColumns, parent.getFont());

		// - Show git recent change
		fFilteredPrefTree.addCheckBox(inner,
				MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChange,
				PREF_SHOW_REVISION_RECENT_CHANGE, TRUE_FALSE, defaultIndent, section);
		fFilteredPrefTree.addCheckBox(inner,
				MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChangeWithAvatar,
				PREF_SHOW_REVISION_RECENT_CHANGE_WITH_AVATAR, TRUE_FALSE, extraIndent, section);
		fFilteredPrefTree.addCheckBox(inner,
				MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChangeWithDate,
				PREF_SHOW_REVISION_RECENT_CHANGE_WITH_DATE, TRUE_FALSE, extraIndent, section);
		// Show authors
		fFilteredPrefTree.addCheckBox(inner,
				MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionAuthors,
				PREF_SHOW_REVISION_AUTHORS, TRUE_FALSE, defaultIndent, section);

		// - Show git changes
//		fFilteredPrefTree.addCheckBox(inner,
//				MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showGitChanges_label,
//				PREF_SHOW_GIT_CHANGES, enabledDisabled, defaultIndent, section);
	}
 
Example 2
Source File: JavaEditorCodeMiningConfigurationBlock.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
private void createGeneralSection(int nColumns, Composite parent) {
	int defaultIndent = 0;
	int extraIndent = LayoutUtil.getIndent();
	String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_general;
	Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_general"); //$NON-NLS-1$
	PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey,
			null, false);
	ExpandableComposite excomposite = getExpandableComposite(twistieKey);

	Composite inner = createInnerComposite(excomposite, nColumns, parent.getFont());

	// - Show references
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_label, PREF_SHOW_REFERENCES,
			TRUE_FALSE, defaultIndent, section);
	// - Show references (for Classes)
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferencesClass_label,
			PREF_SHOW_CLASS_REFERENCES, TRUE_FALSE, extraIndent, section);
	// - Show references (for Methods)
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferencesMethod_label,
			PREF_SHOW_METHOD_REFERENCES, TRUE_FALSE, extraIndent, section);
	// - Show references (Only if there is at least one reference)
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_atLeastOne_label,
			PREF_SHOW_REFERENCES_AT_LEAST_ONE, TRUE_FALSE, extraIndent, section);

	// - Show implementations
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showImplementations_label,
			PREF_SHOW_IMPLEMENTATIONS, TRUE_FALSE, defaultIndent, section);
	// - Show implementations (Only if there is at least one implementation)
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showImplementations_atLeastOne_label,
			PREF_SHOW_IMPLEMENTATIONS_AT_LEAST_ONE, TRUE_FALSE, extraIndent, section);

	// - Show end statement
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showEndStatement_label,
			PREF_SHOW_END_STATEMENT, TRUE_FALSE, defaultIndent, section);
	// - Show end statement min line number
	fFilteredPrefTree.addTextField(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showEndStatement_minLineNumber_label,
			PREF_SHOW_END_STATEMENT_MIN_LINE_NUMBER, extraIndent, 0, section);

	// - Show type of Java9 'var' declaration
	fFilteredPrefTree.addCheckBox(inner,
			MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showJava10VarType_label,
			PREF_SHOW_JAVA10_VAR_TYPE, TRUE_FALSE, defaultIndent, section);
}
 
Example 3
Source File: RenameInputWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void createControl(Composite parent) {
	Composite superComposite= new Composite(parent, SWT.NONE);
	setControl(superComposite);
	initializeDialogUnits(superComposite);
	superComposite.setLayout(new GridLayout());
	Composite composite= new Composite(superComposite, SWT.NONE);
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginHeight= 0;
	layout.marginWidth= 0;

	composite.setLayout(layout);
	RowLayouter layouter= new RowLayouter(2);

	Label label= new Label(composite, SWT.NONE);
	label.setText(getLabelText());

	Text text= createTextInputField(composite);
	text.selectAll();
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	gd.widthHint= convertWidthInCharsToPixels(25);
	text.setLayoutData(gd);

	layouter.perform(label, text, 1);

	Label separator= new Label(composite, SWT.NONE);
	GridData gridData= new GridData(SWT.FILL, SWT.FILL, false, false);
	gridData.heightHint= 2;
	separator.setLayoutData(gridData);


	int indent= LayoutUtil.getIndent();

	addOptionalUpdateReferencesCheckbox(composite, layouter);
	addAdditionalOptions(composite, layouter);
	addOptionalUpdateTextualMatches(composite, layouter);
	addOptionalUpdateQualifiedNameComponent(composite, layouter, indent);
	addOptionalLeaveDelegateCheckbox(composite, layouter);
	addOptionalDeprecateDelegateCheckbox(composite, layouter, indent);
	updateForcePreview();

	Dialog.applyDialogFont(superComposite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), fHelpContextID);
}
 
Example 4
Source File: BracesTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private CheckboxPreference createIndentedCheckboxPref(Composite composite, int numColumns, String message, String key, String [] values) {
	CheckboxPreference pref= createCheckboxPref(composite, numColumns, message, key, values);
	GridData data= (GridData) pref.getControl().getLayoutData();
	data.horizontalIndent= LayoutUtil.getIndent();
	return pref;
}
 
Example 5
Source File: AbstractConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
protected static void indent(Control control) {
	((GridData) control.getLayoutData()).horizontalIndent+= LayoutUtil.getIndent();
}
 
Example 6
Source File: AppearancePreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	initializeDialogUnits(parent);
	int nColumns= 1;

	Composite result= new Composite(parent, SWT.NONE);
	result.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
	layout.marginWidth= 0;
	layout.numColumns= nColumns;
	result.setLayout(layout);

	fShowMethodReturnType.doFillIntoGrid(result, nColumns);
	fShowMethodTypeParameters.doFillIntoGrid(result, nColumns);
	fShowCategory.doFillIntoGrid(result, nColumns);
	fShowMembersInPackageView.doFillIntoGrid(result, nColumns);
	fFoldPackagesInPackageExplorer.doFillIntoGrid(result, nColumns);

	new Separator().doFillIntoGrid(result, nColumns);

	fCompressPackageNames.doFillIntoGrid(result, nColumns);
	fPackageNamePattern.doFillIntoGrid(result, 2);
	LayoutUtil.setHorizontalIndent(fPackageNamePattern.getLabelControl(null));
	Text packageNamePatternControl= fPackageNamePattern.getTextControl(null);
	LayoutUtil.setHorizontalIndent(packageNamePatternControl);
	LayoutUtil.setHorizontalGrabbing(packageNamePatternControl);
	LayoutUtil.setWidthHint(fPackageNamePattern.getLabelControl(null), convertWidthInCharsToPixels(65));

	new Separator().doFillIntoGrid(result, nColumns);
	fAbbreviatePackageNames.doFillIntoGrid(result, nColumns);
	fAbbreviatePackageNamePattern.doFillIntoGrid(result, 2);
	LayoutUtil.setHorizontalIndent(fAbbreviatePackageNamePattern.getLabelControl(null));
	Text abbreviatePackageNamePatternControl= fAbbreviatePackageNamePattern.getTextControl(null);
	LayoutUtil.setHorizontalIndent(abbreviatePackageNamePatternControl);
	LayoutUtil.setHorizontalGrabbing(abbreviatePackageNamePatternControl);
	LayoutUtil.setWidthHint(fAbbreviatePackageNamePattern.getLabelControl(null), convertWidthInCharsToPixels(65));
	LayoutUtil.setVerticalGrabbing(abbreviatePackageNamePatternControl);
	LayoutUtil.setHeightHint(abbreviatePackageNamePatternControl, convertHeightInCharsToPixels(3));

	new Separator().doFillIntoGrid(result, nColumns);
	fStackBrowsingViewsVertically.doFillIntoGrid(result, nColumns);

	String noteTitle= PreferencesMessages.AppearancePreferencePage_note;
	String noteMessage= PreferencesMessages.AppearancePreferencePage_preferenceOnlyEffectiveForNewPerspectives;
	Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), result, noteTitle, noteMessage);
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 2;
	gd.horizontalIndent= LayoutUtil.getIndent();
	noteControl.setLayoutData(gd);

	initFields();

	Dialog.applyDialogFont(result);
	return result;
}