break; case IJavaElement.PACKAGE_FRAGMENT_ROOT : if (containsCompilationUnits((IPackageFragmentRoot) je)) { return je; if (containsCompilationUnits((IPackageFragment) je)) { return je; if (isValidProject(project)) return project;
private static String initJavadocCommandDefault() { IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); String cmd= store.getString(PreferenceConstants.JAVADOC_COMMAND); // old location if (cmd != null && cmd.length() > 0) { store.setToDefault(PreferenceConstants.JAVADOC_COMMAND); return cmd; } File file= findJavaDocCommand(); if (file != null) { return file.getPath(); } return ""; //$NON-NLS-1$ }
String destination= getPathString(Path.fromOSString(store.getDestination())); xmlJavadocDesc.setAttribute(store.VISIBILITY, store.getAccess()); String source= store.getSource(); if (source.length() > 0 && !source.equals("-")) { //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.SOURCE, store.getSource()); xmlJavadocDesc.setAttribute(store.USE, booleanToString(store.getBoolean("use"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.NOTREE, booleanToString(store.getBoolean("notree"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.NONAVBAR, booleanToString(store.getBoolean("nonavbar"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.NOINDEX, booleanToString(store.getBoolean("noindex"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.SPLITINDEX, booleanToString(store.getBoolean("splitindex"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.AUTHOR, booleanToString(store.getBoolean("author"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.VERSION, booleanToString(store.getBoolean("version"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.NODEPRECATEDLIST, booleanToString(store.getBoolean("nodeprecatedlist"))); //$NON-NLS-1$ xmlJavadocDesc.setAttribute(store.NODEPRECATED, booleanToString(store.getBoolean("nodeprecated"))); //$NON-NLS-1$ sortSourceElement(store.getSourceElements(), sourcefiles, packages); if (!packages.isEmpty()) xmlJavadocDesc.setAttribute(store.PACKAGENAMES, toSeparatedList(packages)); xmlJavadocDesc.setAttribute(store.SOURCEPATH, getPathString(store.getSourcepath())); xmlJavadocDesc.setAttribute(store.CLASSPATH, getPathString(store.getClasspath())); String overview= store.getOverview(); if (overview.length() > 0) xmlJavadocDesc.setAttribute(store.OVERVIEW, overview); String styleSheet= store.getStyleSheet();
private void xmlWriteDoclet(JavadocOptionsManager store, Document document, Element xmlJavadocDesc) throws DOMException { //set the packages and source files List<String> packages= new ArrayList<>(); List<String> sourcefiles= new ArrayList<>(); sortSourceElement(store.getSourceElements(), sourcefiles, packages); if (!packages.isEmpty()) xmlJavadocDesc.setAttribute(store.PACKAGENAMES, toSeparatedList(packages)); if (!sourcefiles.isEmpty()) xmlJavadocDesc.setAttribute(store.SOURCEFILES, toSeparatedList(sourcefiles)); xmlJavadocDesc.setAttribute(store.SOURCEPATH, getPathString(store.getSourcepath())); xmlJavadocDesc.setAttribute(store.CLASSPATH, getPathString(store.getClasspath())); xmlJavadocDesc.setAttribute(store.VISIBILITY, store.getAccess()); Element doclet= document.createElement("doclet"); //$NON-NLS-1$ xmlJavadocDesc.appendChild(doclet); doclet.setAttribute(store.NAME, store.getDocletName()); doclet.setAttribute(store.PATH, store.getDocletPath()); String str= store.getOverview(); if (str.length() > 0) xmlJavadocDesc.setAttribute(store.OVERVIEW, str); str= store.getAdditionalParams(); if (str.length() > 0) xmlJavadocDesc.setAttribute(store.EXTRAOPTIONS, str); }
fStore.updateDialogSettings(getDialogSettings(), checkedProjects); fDestination= Path.fromOSString(fStore.getDestination()); fDestination.toFile().mkdirs(); fOpenInBrowser= fStore.doOpenInBrowser(); if (fStore.isFromStandard()) { try { Element javadocXMLElement= fStore.createXML(checkedProjects); if (javadocXMLElement != null) { File file= fStore.writeXML(javadocXMLElement); IFile[] files= fRoot.findFilesForLocationURI(file.toURI()); if (files != null) {
commandHistory= initJavadocCommandDefault(); fJavadocCommandHistory= arrayFromFlatString(commandHistory); Element element= reader.readXML(); if (element != null) { loadFromXML(element); return; loadFromDialogStore(javadocSection, currSelection); } else { loadDefaults(currSelection);
public void updateDialogSettings(IDialogSettings dialogSettings, IJavaProject[] checkedProjects) { IDialogSettings settings= dialogSettings.addNewSection(SECTION_JAVADOC); settings.put(JAVADOC_COMMAND_HISTORY, flatStringList(fJavadocCommandHistory)); if (fJavadocCommandHistory.length > 0) { IPreferenceStore store= PreferenceConstants.getPreferenceStore(); updateRecentSettings(checkedProjects[0]); getRecentSettings().store(settings);
vmArgs.add(getJavadocCommandHistory()[0]); toolArgs.add(flatPathList(fSourcepath)); toolArgs.add(flatPathList(fClasspath)); addProxyOptions(vmArgs);
fAntText.setText(fStore.getAntpath()); fCheckbrowser.setSelection(fStore.doOpenInBrowser());
protected void setVisibilitySettings() { fVisibilitySelection= fStore.getAccess(); fPrivateVisibility.setSelection(fVisibilitySelection.equals(fStore.PRIVATE)); if (fPrivateVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_privatevisibilitydescription_label); fProtectedVisibility.setSelection(fVisibilitySelection.equals(fStore.PROTECTED)); if (fProtectedVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_protectedvisibilitydescription_label); fPackageVisibility.setSelection(fVisibilitySelection.equals(fStore.PACKAGE)); if (fPackageVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_packagevisibledescription_label); fPublicVisibility.setSelection(fVisibilitySelection.equals(fStore.PUBLIC)); if (fPublicVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_publicvisibilitydescription_label); }
private boolean containsCompilationUnits(IPackageFragmentRoot root) throws JavaModelException { if (root.getKind() != IPackageFragmentRoot.K_SOURCE) { return false; } IJavaElement[] elements= root.getChildren(); for (int i= 0; i < elements.length; i++) { if (elements[i] instanceof IPackageFragment) { IPackageFragment fragment= (IPackageFragment) elements[i]; if (containsCompilationUnits(fragment)) { return true; } } } return false; }
public void init(IWorkbench workbench, IStructuredSelection structuredSelection) { IWorkbenchWindow window= workbench.getActiveWorkbenchWindow(); List selected= Collections.EMPTY_LIST; if (window != null) { ISelection selection= window.getSelectionService().getSelection(); if (selection instanceof IStructuredSelection) { selected= ((IStructuredSelection) selection).toList(); } else { IJavaElement element= EditorUtility.getActiveEditorJavaInput(); if (element != null) { selected= new ArrayList(); selected.add(element); } } } fStore= new JavadocOptionsManager(fXmlJavadocFile, getDialogSettings(), selected); }
private void xmlWriteDoclet(JavadocOptionsManager store, Document document, Element xmlJavadocDesc) throws DOMException { //set the packages and source files List<String> packages= new ArrayList<>(); List<String> sourcefiles= new ArrayList<>(); sortSourceElement(store.getSourceElements(), sourcefiles, packages); if (!packages.isEmpty()) xmlJavadocDesc.setAttribute(store.PACKAGENAMES, toSeparatedList(packages)); if (!sourcefiles.isEmpty()) xmlJavadocDesc.setAttribute(store.SOURCEFILES, toSeparatedList(sourcefiles)); xmlJavadocDesc.setAttribute(store.SOURCEPATH, getPathString(store.getSourcepath())); xmlJavadocDesc.setAttribute(store.CLASSPATH, getPathString(store.getClasspath())); xmlJavadocDesc.setAttribute(store.VISIBILITY, store.getAccess()); Element doclet= document.createElement("doclet"); //$NON-NLS-1$ xmlJavadocDesc.appendChild(doclet); doclet.setAttribute(store.NAME, store.getDocletName()); doclet.setAttribute(store.PATH, store.getDocletPath()); String str= store.getOverview(); if (str.length() > 0) xmlJavadocDesc.setAttribute(store.OVERVIEW, str); str= store.getAdditionalParams(); if (str.length() > 0) xmlJavadocDesc.setAttribute(store.EXTRAOPTIONS, str); }
fStore.updateDialogSettings(getDialogSettings(), checkedProjects); fDestination= Path.fromOSString(fStore.getDestination()); fDestination.toFile().mkdirs(); fOpenInBrowser= fStore.doOpenInBrowser(); if (fStore.isFromStandard()) { try { Element javadocXMLElement= fStore.createXML(checkedProjects); if (javadocXMLElement != null) { File file= fStore.writeXML(javadocXMLElement); IFile[] files= fRoot.findFilesForLocationURI(file.toURI()); if (files != null) {
commandHistory= initJavadocCommandDefault(); fJavadocCommandHistory= arrayFromFlatString(commandHistory); Element element= reader.readXML(); if (element != null) { loadFromXML(element); return; loadFromDialogStore(javadocSection, currSelection); } else { loadDefaults(currSelection);
public void updateDialogSettings(IDialogSettings dialogSettings, IJavaProject[] checkedProjects) { IDialogSettings settings= dialogSettings.addNewSection(SECTION_JAVADOC); settings.put(JAVADOC_COMMAND_HISTORY, flatStringList(fJavadocCommandHistory)); if (fJavadocCommandHistory.length > 0) { IPreferenceStore store= PreferenceConstants.getPreferenceStore(); updateRecentSettings(checkedProjects[0]); getRecentSettings().store(settings);
vmArgs.add(getJavadocCommandHistory()[0]); toolArgs.add(flatPathList(fSourcepath)); toolArgs.add(flatPathList(fClasspath)); addProxyOptions(vmArgs);
fAntText.setText(fStore.getAntpath()); fCheckbrowser.setSelection(fStore.doOpenInBrowser());
protected void setVisibilitySettings() { fVisibilitySelection= fStore.getAccess(); fPrivateVisibility.setSelection(fVisibilitySelection.equals(fStore.PRIVATE)); if (fPrivateVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_privatevisibilitydescription_label); fProtectedVisibility.setSelection(fVisibilitySelection.equals(fStore.PROTECTED)); if (fProtectedVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_protectedvisibilitydescription_label); fPackageVisibility.setSelection(fVisibilitySelection.equals(fStore.PACKAGE)); if (fPackageVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_packagevisibledescription_label); fPublicVisibility.setSelection(fVisibilitySelection.equals(fStore.PUBLIC)); if (fPublicVisibility.getSelection()) fDescriptionLabel.setText(JavadocExportMessages.JavadocTreeWizardPage_publicvisibilitydescription_label); }
private boolean containsCompilationUnits(IPackageFragmentRoot root) throws JavaModelException { if (root.getKind() != IPackageFragmentRoot.K_SOURCE) { return false; } IJavaElement[] elements= root.getChildren(); for (int i= 0; i < elements.length; i++) { if (elements[i] instanceof IPackageFragment) { IPackageFragment fragment= (IPackageFragment) elements[i]; if (containsCompilationUnits(fragment)) { return true; } } } return false; }