Community
Participate
Working Groups
Hi all, This patch add coloration and hover support for RPM packages, packages completion are now only showed when the line begin with Requires, BuildRequires, etc... TODO: - add F2 key support on the hover stuff. - use specific color for packages, at the moment it use the same color as macro. - add a derived HTMLTextPresenter into the specfile plugin and use it as hover presenter.
Created attachment 63063 [details] packages coloration, hover and completion support.
Created attachment 63168 [details] packages coloration, hover and completion support - ChangeLog file is no more in patch. - remove already fixed things in RpmMacroProposalsList. 2007-04-05 Alphonse Van Assche <alcapcom@gmail.com> * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePartitionScanner.java Add __spec_packages partition type. (SpecfilePartitionScanner): add new scan rules fo this partition. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileHover.java Add hover support for RPM packages. (findPackages): New method. (getHoverRegion): Add support for findPackages() method. (getHoverInfo): Get RPM package hover informations, rename macroName -> currentSelection to reflect the current code. (getHoverControlCreator): use HTMLTextPresenter as information control presenter. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileConfiguration.java Add support for the RPM packages content type. (getSpecfilePackagesScanner): New method. (getPresentationReconciler): Reconcile packages. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java Add completion support for the __spec_packages partition type. (computeRpmPackageProposals): Show only proposals on lines begining with Requires, BuildRequires, etc... * src/org/eclipse/linuxtools/rpm/ui/editor/RpmPackageProposalsList.java Add a method used by SpecfilePartionScanner.getHoverInfo() to retrive package informations. (getValue): New method. * src/org/eclipse/linuxtools/rpm/ui/editor/RpmMacroProposalsList.java (getProposals): replace prefix.replaceAll by prefix.replace because .replaceAll throw a java.util.regex.PatternSyntaxException: Illegal repetition, with gcj 1.4.2 * src/org/eclipse/linuxtools/rpm/ui/editor/PackageWordDetector.java: Add packages word detection. * src/org/eclipse/linuxtools/rpm/ui/editor/ISpecfileColorConstants.java: Add color const for packages.
Oups, have forgot to remove some lines in the ChangeLog, this one is cleaned. 2007-04-05 Alphonse Van Assche <alcapcom@gmail.com> * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePartitionScanner.java Add __spec_packages partition type. (SpecfilePartitionScanner): add new scan rules for the __spec_packages partition. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileHover.java Add hover support for RPM packages. (findPackages): New method. (getHoverRegion): Add support for findPackages() method. (getHoverInfo): Get RPM package hover informations, rename macroName -> currentSelection to reflect the current code. (getHoverControlCreator): use HTMLTextPresenter as information control presenter. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileConfiguration.java Add support for the RPM packages content type. (getSpecfilePackagesScanner): New method. (getPresentationReconciler): Reconcile packages. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java Add completion support for the __spec_packages partition type. (computeRpmPackageProposals): Show only proposals on lines begining with Requires, BuildRequires, etc... * src/org/eclipse/linuxtools/rpm/ui/editor/RpmPackageProposalsList.java Add a method used by SpecfilePartionScanner.getHoverInfo() to retrive package informations. (getValue): New method. * src/org/eclipse/linuxtools/rpm/ui/editor/PackageWordDetector.java: Add packages word detection. * src/org/eclipse/linuxtools/rpm/ui/editor/ISpecfileColorConstants.java: Add color const for packages.
Thanks for keeping the ChangeLog entry in the bug report - that's perfect so that the patch applies with other changes. A few comments: + String packageDescription = Activator.getDefault().getRpmPackageList().getValue(currentSelection.replace(":","")); This replace method is only in >= J2SE-1.5. I just committed Remy's fixes for required EEs so you wouldn't have seen this. Should it be replaceAll like in the other cases? + // TODO If that work like it must, we can remove + // these tags in SpecfileScanner + private static final String[] PACKAGES_TAGS = { "BuildRequires", "BuildConflicts", + "BuildPreReq", "Requires", "Requires(post)", "Requires(postun)", + "Requires(pre)", "Requires(preun)" }; Let's go ahead and make this public or protected now and use it also in SpecfilePartitionScanner. Otherwise, I think the patch looks good!
(In reply to comment #4) Have set PACKAGES_TAGS as protected and remove all unneeded code, including the no more used tags in SpecfileScanner. Any idea why eclipse don't say me that the replace() method is not include into the configured JVM (the project is also configure to be 1.4 compatible, have try to run eclipse with gcj and use gcj as workbench JVM too without see any warning about this. Thanks to review the patches so quickly, have a nice day! 2007-04-07 Alphonse Van Assche <alcapcom@gmail.com> * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileHover.java: Replace .replace() by .replaceFirst() for 1.4.2 JVM's compatibility * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileScanner.java: Remove unneded RPM tags, these tags are now take in account by SpecfilePartitionScanner * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePartitionScanner.java: Using SpecfilePackagesScanner.PACKAGES_TAGS * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePackagesScanner.java: add some missing "RPM packages" tags.
Created attachment 63208 [details] packages coloration, hover and completion support
Thanks! Committed as rev. 527: 2007-04-08 Alphonse Van Assche <alcapcom@gmail.com> * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileScanner.java: Remove unneeded RPM tags, these tags are now taken into account by SpecfilePartitionScanner. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePackagesScanner.java: New file. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfilePartitionScanner.java: Add __spec_packages partition type. Use SpecfilePackagesScanner.PACKAGES_TAGS. (SpecfilePartitionScanner): Add new scan rules for the__spec_packages partition. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileHover.java: Add hover support for RPM packages. (findPackages): New method. (getHoverRegion): Add support for findPackages() method. (getHoverInfo): Get RPM package hover information. Rename macroName to currentSelection to reflect the current code. (getHoverControlCreator): Use HTMLTextPresenter as information control presenter. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileConfiguration.java: Add support for the RPM packages content type. (getSpecfilePackagesScanner): New method. (getPresentationReconciler): Reconcile packages. (getContentAssistant): Set content assistant for packages content type. * src/org/eclipse/linuxtools/rpm/ui/editor/SpecfileCompletionProcessor.java: Add completion support for the __spec_packages partition type. (computeRpmPackageProposals): Show only proposals on lines begining with Requires, BuildRequires, etc. * src/org/eclipse/linuxtools/rpm/ui/editor/RpmPackageProposalsList.java: Add a method used by SpecfilePartionScanner.getHoverInfo() to retrieve package. information. (getValue): New method. * src/org/eclipse/linuxtools/rpm/ui/editor/PackageWordDetector.java: New file. Add packages word detection. * src/org/eclipse/linuxtools/rpm/ui/editor/ISpecfileColorConstants.java: Add color constant for packages.
Comment on attachment 63063 [details] packages coloration, hover and completion support. Setting iplog flag.
Comment on attachment 63208 [details] packages coloration, hover and completion support Setting iplog flag.
Comment on attachment 63063 [details] packages coloration, hover and completion support. Unsetting iplog for this obsolete attachment.