private void jdocDialogFieldChanged(DialogField field) { if (field == fURLField) { fURLStatus= updateURLStatus(); statusChanged(); } else if (field == fArchiveField) { fArchiveStatus= updateArchiveStatus(); statusChanged(); } else if (field == fArchivePathField) { fArchivePathStatus= updateArchivePathStatus(); statusChanged(); } else if (field == fValidateURLButton || field == fValidateArchiveButton) { EntryValidator validator= new EntryValidator(); BusyIndicator.showWhile(fShell.getDisplay(), validator); } else if (field == fBrowseFolder) { String url= chooseJavaDocFolder(); if (url != null) { fURLField.setText(url); String jarPath= chooseArchive(); if (jarPath != null) { fArchiveField.setText(jarPath); fArchiveStatus= updateArchiveStatus(); statusChanged(); } else if (field == fBrowseArchivePath) { String archivePath= chooseArchivePath(); if (archivePath != null) { fArchivePathField.setText(archivePath); statusChanged();
private URL getArchiveURL() throws MalformedURLException { String jarLoc= fArchiveField.getText(); String innerPath= fArchivePathField.getText().trim(); StringBuffer buf= new StringBuffer(); buf.append("jar:"); //$NON-NLS-1$ if (fWorkspaceRadio.isSelected()) { IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); IResource res= root.findMember(new Path(jarLoc)); if (res != null) { buf.append("platform:/resource").append(encodeExclamationMarks(res.getFullPath().toString())); //$NON-NLS-1$ } } else { buf.append(encodeExclamationMarks(new File(jarLoc).toURL().toExternalForm())); } buf.append('!'); if (innerPath.length() > 0) { if (innerPath.charAt(0) != '/') { buf.append('/'); } buf.append(innerPath); } else { buf.append('/'); } return new URL(buf.toString()); }
/** * Returns the configured Javadoc location. The result is only valid after the dialog * has been opened and has not been cancelled by the user. * @return The configured javadoc location */ public URL getResult() { return fJavadocConfigurationBlock.getJavadocLocation(); }
protected Control createContents(Composite parent) { if (!fIsValidElement) { return new Composite(parent, SWT.NONE); } IJavaElement elem= getJavaElement(); fInitalLocation= null; if (elem != null) { try { fInitalLocation= JavaUI.getJavadocBaseLocation(elem); } catch (JavaModelException e) { JavaPlugin.log(e); } } boolean isProject= (elem instanceof IJavaProject); fJavadocConfigurationBlock= new JavadocConfigurationBlock(getShell(), this, fInitalLocation, isProject); Control control= fJavadocConfigurationBlock.createContents(parent); control.setVisible(elem != null); Dialog.applyDialogFont(control); return control; }
protected Control createDialogArea(Composite parent) { Composite composite= (Composite) super.createDialogArea(parent); Control inner= fJavadocConfigurationBlock.createContents(composite); inner.setLayoutData(new GridData(GridData.FILL_BOTH)); applyDialogFont(composite); return composite; }
/** * Shows the UI for configuring a javadoc location. * Use {@link org.eclipse.jdt.ui.JavaUI} to access and configure Javadoc locations. * * @param parent The parent shell for the dialog. * @param libraryName Name of of the library to which configured javadoc location belongs. * @param initialURL The initial URL or <code>null</code>. */ public JavadocLocationDialog(Shell parent, String libraryName, URL initialURL) { super(parent); IStatusChangeListener listener= new IStatusChangeListener() { @Override public void statusChanged(IStatus status) { updateStatus(status); } }; setTitle(Messages.format(NewWizardMessages.LibrariesWorkbookPage_JavadocPropertyDialog_title, libraryName)); fJavadocConfigurationBlock= new JavadocConfigurationBlock(parent, listener, initialURL, false); }
private IStatus updateArchivePathStatus() { // no validation yet try { fArchiveURLResult= getArchiveURL(); } catch (MalformedURLException e) { fArchiveURLResult= null; StatusInfo status= new StatusInfo(); status.setError(e.getMessage()); //status.setError(PreferencesMessages.getString("JavadocConfigurationBlock.MalformedURL.error")); //$NON-NLS-1$ return status; } return new StatusInfo(); }
public void performDefaults() { initializeSelections(); }
private String chooseArchive() { if (fWorkspaceRadio.isSelected()) { return chooseWorkspaceArchive(); } IPath currPath= new Path(fArchiveField.getText()); if (ArchiveFileFilter.isArchivePath(currPath, true)) { currPath= currPath.removeLastSegments(1); } FileDialog dialog= new FileDialog(fShell, SWT.OPEN | SWT.SHEET); dialog.setFilterExtensions(ArchiveFileFilter.JAR_ZIP_FILTER_EXTENSIONS); dialog.setText(PreferencesMessages.JavadocConfigurationBlock_zipImportSource_title); dialog.setFilterPath(currPath.toOSString()); return dialog.open(); }
fJavadocConfigurationBlock= new JavadocConfigurationBlock(getShell(), this, fInitalLocation, isProject); Control control= fJavadocConfigurationBlock.createContents(parent); control.setVisible(elem != null);
@Override protected Control createDialogArea(Composite parent) { Composite composite= (Composite) super.createDialogArea(parent); Control inner= fJavadocConfigurationBlock.createContents(composite); inner.setLayoutData(new GridData(GridData.FILL_BOTH)); applyDialogFont(composite); return composite; }
/** * Shows the UI for configuring a javadoc location. * Use {@link org.eclipse.jdt.ui.JavaUI} to access and configure Javadoc locations. * * @param parent The parent shell for the dialog. * @param libraryName Name of of the library to which configured javadoc location belongs. * @param initialURL The initial URL or <code>null</code>. */ public JavadocLocationDialog(Shell parent, String libraryName, URL initialURL) { super(parent); IStatusChangeListener listener= new IStatusChangeListener() { @Override public void statusChanged(IStatus status) { updateStatus(status); } }; setTitle(Messages.format(NewWizardMessages.LibrariesWorkbookPage_JavadocPropertyDialog_title, libraryName)); fJavadocConfigurationBlock= new JavadocConfigurationBlock(parent, listener, initialURL, false); }
private IStatus updateArchivePathStatus() { // no validation yet try { fArchiveURLResult= getArchiveURL(); } catch (MalformedURLException e) { fArchiveURLResult= null; StatusInfo status= new StatusInfo(); status.setError(e.getMessage()); //status.setError(PreferencesMessages.getString("JavadocConfigurationBlock.MalformedURL.error")); //$NON-NLS-1$ return status; } return new StatusInfo(); }
public void performDefaults() { initializeSelections(); }
private String chooseArchive() { if (fWorkspaceRadio.isSelected()) { return chooseWorkspaceArchive(); } IPath currPath= new Path(fArchiveField.getText()); if (ArchiveFileFilter.isArchivePath(currPath)) { currPath= currPath.removeLastSegments(1); } FileDialog dialog= new FileDialog(fShell, SWT.OPEN); dialog.setFilterExtensions(new String[] { FILE_IMPORT_MASK }); dialog.setText(PreferencesMessages.JavadocConfigurationBlock_zipImportSource_title); dialog.setFilterPath(currPath.toOSString()); return dialog.open(); }
private void jdocDialogFieldChanged(DialogField field) { if (field == fURLField) { fURLStatus= updateURLStatus(); statusChanged(); } else if (field == fArchiveField) { fArchiveStatus= updateArchiveStatus(); statusChanged(); } else if (field == fArchivePathField) { fArchivePathStatus= updateArchivePathStatus(); statusChanged(); } else if (field == fValidateURLButton || field == fValidateArchiveButton) { EntryValidator validator= new EntryValidator(); BusyIndicator.showWhile(fShell.getDisplay(), validator); } else if (field == fBrowseFolder) { String url= chooseJavaDocFolder(); if (url != null) { fURLField.setText(url); String jarPath= chooseArchive(); if (jarPath != null) { fArchiveField.setText(jarPath); fArchiveStatus= updateArchiveStatus(); statusChanged(); } else if (field == fBrowseArchivePath) { String archivePath= chooseArchivePath(); if (archivePath != null) { fArchivePathField.setText(archivePath); statusChanged();
fJavadocConfigurationBlock= new JavadocConfigurationBlock(getShell(), this, fInitalLocation, isProject); Control control= fJavadocConfigurationBlock.createContents(parent); control.setVisible(elem != null);
@Override protected Control createDialogArea(Composite parent) { Composite composite= (Composite) super.createDialogArea(parent); Control inner= fJavadocConfigurationBlock.createContents(composite); inner.setLayoutData(new GridData(GridData.FILL_BOTH)); applyDialogFont(composite); return composite; }
public JavadocPropertyDialog(Shell parent, JavadocLinkRef selection) { super(parent); setTitle(JavadocExportMessages.JavadocStandardWizardPage_javadocpropertydialog_title); fElement= selection; URL initialLocation= selection.getURL(); fJavadocConfigurationBlock= new JavadocConfigurationBlock(parent, this, initialLocation, selection.isProjectRef()); }
/** * Returns the configured Javadoc location. The result is only valid after the dialog * has been opened and has not been cancelled by the user. * @return The configured javadoc location */ public URL getResult() { return fJavadocConfigurationBlock.getJavadocLocation(); }