Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the OpenConsoleFeature #1582

Merged
merged 15 commits into from
Jul 19, 2016

Conversation

obraliar
Copy link
Contributor

@obraliar obraliar commented Jul 15, 2016

Extend the OpenConsoleFeature by offering a selection between default terminal emulator and configurable command execution.

@koppor 's wish (see #462 (comment)) was to have a selection between own terminal emulators. This feature extension provides that.

  • Add:
    • radio selection to the ExternalTab
    • program execution to JabRefDesktop
    • new JabRefPreference entries
    • UI outputs
    • localization keys

Screenshots:
oc_sc3

  • Change in CHANGELOG.md described
  • Screenshots added (for bigger UI changes)

@obraliar obraliar changed the title Extend the OpenConsoleFeature by selection of custom terminal emulator. [WIP] Extend the OpenConsoleFeature by selection of custom terminal emulator. Jul 15, 2016
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 4a862a7 to d433310 Compare July 15, 2016 03:39
@tschechlovdev
Copy link
Contributor

please fix codacy

@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from dcde836 to 47a7c7a Compare July 15, 2016 12:19
@obraliar
Copy link
Contributor Author

Done.

@@ -61,6 +77,39 @@ public AdvancedTab(JabRefPreferences prefs) {
useCaseKeeperOnSearch = new JCheckBox(Localization.lang("Add {} to specified title words on search to keep the correct case"));
useUnitFormatterOnSearch = new JCheckBox(Localization.lang("Format units by adding non-breaking separators and keeping the correct case on search"));

defaultConsole = new JRadioButton(Localization.lang("Use default terminal emulator"));
specifiedConsole = new JRadioButton(Localization.lang("Specify terminal emulator:"));
consoleEmulatorPath = new JTextField(20);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you set the columns to 20? In my opinion you can use more as it seems there is still space to the right in the preference dialog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 25. It should be ok right now.

@boceckts
Copy link
Contributor

Very nice PR, only minor comments from my side 👍

- Add radio selection to the AdvancedTab
- Add new JabRefPreferences
- Add file check and execution commands
- Add localization keys
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 47a7c7a to 78affab Compare July 16, 2016 21:27

Open_console=
Please_type_in_the_absolute_path_to_an_existing_terminal_emulator.=
Specify_terminal_emulator\:=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not include final \: in the language files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -61,6 +79,39 @@ public AdvancedTab(JabRefPreferences prefs) {
useCaseKeeperOnSearch = new JCheckBox(Localization.lang("Add {} to specified title words on search to keep the correct case"));
useUnitFormatterOnSearch = new JCheckBox(Localization.lang("Format units by adding non-breaking separators and keeping the correct case on search"));

defaultConsole = new JRadioButton(Localization.lang("Use default terminal emulator"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preferences should be in "External programs", not in "Advanced", as "Console" is an external program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Moved to ExternalTab.

@koppor
Copy link
Member

koppor commented Jul 17, 2016

Locally, I got following exceptoin

:compileJavaC:\git-repositories\jabref\jabref\src\main\java\net\sf\jabref\BibDatabaseContext.java:1: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
package net.sf.jabref;
^
     Please report this at https://github.com/google/error-prone/issues/new and include the following:

     error-prone version: 2.0.10
     Stack Trace:

After disabling the error prone plugin (just remove the line with errorprone in build.gradle), I could test it.

My preferences look like this:

grabbed_20160717-150310

Why is the space to the right not fully used?

Other categories of the preferences do use it:

grabbed_20160717-150434

Featurewise: Just using C:\Program Files\ConEmu\ConEmu64.exe just starts a new instance. The old instance has to be reused. Thus, my command line is ConEmu64.exe /single /dir "c:\users". As a consequence, the whole parameter string should be configurable with %DIR as placeholder for the directory name.

@obraliar
Copy link
Contributor Author

obraliar commented Jul 17, 2016

Okay, I'm going to add a new option called "execute". Where should I describe that %DIR is a placeholder? Below, as labeled text?


if (!Files.exists(path) || Files.isDirectory(path) || !path.isAbsolute()) {
JOptionPane.showMessageDialog(null,
Localization.lang("Please type in the absolute path to an existing terminal emulator."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I shouldn't interfere at this time, but I think replacing "type in" with "enter" would make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@koppor
Copy link
Member

koppor commented Jul 17, 2016

Labeled text sounds good.

@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch 2 times, most recently from fbb8459 to 9b719bc Compare July 17, 2016 17:44
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 9b719bc to 93d8b2c Compare July 17, 2016 18:10
@@ -88,7 +88,7 @@ public ExternalTab(JabRefFrame frame, PreferencesDialog prefsDiag, JabRefPrefere
JLabel commandDescription = new JLabel(
"<html>" +
Localization.lang("<u>Note</u>: Use the placeholder <i>%0</i>" +
" for the location of the current database file.", "%DIR") +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked "current" more than "opened": There is always one "current" database file (or zero if nothing is opened :)), but possibly more than one opened.

@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from d225f2b to 4f82d2b Compare July 17, 2016 21:44
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 4f82d2b to 1d4dee0 Compare July 17, 2016 21:46
@@ -868,7 +868,12 @@ private JabRefPreferences() {
defaults.put(INDENT, 4);

defaults.put(USE_DEFAULT_CONSOLE_APPLICATION, Boolean.TRUE);
defaults.put(CONSOLE_COMMAND, "");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line here

@obraliar
Copy link
Contributor Author

@koppor

Execute Command only is sufficient. Specify terminal emulator is not necessary IMHO. - Use default terminal emulator is good. That means: Please provide two choices. The Browse button can go to execute command and replace the whole string when it is pressed.

"Specify terminal emulator" option has been removed.

When I press the button, I get no feedback. Typically, JabRef writes "Externel viewer called" or something like that.

Done.

Put C:\Program Files\ConEmu\ConEmu64.exe /single /dir "%DIR" as default value for "execute command" (on Windows).

Done.

@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch 3 times, most recently from 56d79c5 to 4dbe1f2 Compare July 17, 2016 22:21
@koppor koppor changed the title [WIP] Extend the OpenConsoleFeature by selection of custom terminal emulator. Extend the OpenConsoleFeature by selection of custom terminal emulator. Jul 17, 2016
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 4dbe1f2 to 1cd9284 Compare July 17, 2016 22:24
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from c044eef to 119825f Compare July 17, 2016 23:16
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 119825f to d3870fe Compare July 17, 2016 23:19
@koppor
Copy link
Member

koppor commented Jul 17, 2016

LGTM 👍

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 17, 2016
@obraliar obraliar changed the title Extend the OpenConsoleFeature by selection of custom terminal emulator. Extend the OpenConsoleFeature. Jul 17, 2016
@obraliar obraliar changed the title Extend the OpenConsoleFeature. Extend the OpenConsoleFeature Jul 17, 2016
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from c47e6f3 to 5f6130e Compare July 17, 2016 23:52
@obraliar obraliar force-pushed the ExtendOpenConsoleFeature branch from 5f6130e to fc79ef0 Compare July 18, 2016 00:29
@lenhard
Copy link
Member

lenhard commented Jul 19, 2016

I can confirm that this works with ConEmu on my machine. I have a different path to ConEmu than the default, but changing the preferences worked without an issue. Can be merged from my point of view.

@matthiasgeiger
Copy link
Member

Good work!

@matthiasgeiger matthiasgeiger merged commit aa4c035 into JabRef:master Jul 19, 2016
ayanai1 pushed a commit to ayanai1/jabref that referenced this pull request Aug 1, 2016
Move event (JabRef#1601)

* Move event package to model

Update dependencies: postgres 9.4.1208 -> 9.4.1209 and wiremock from 2.1.6 to 2.1.7

Added ISBN integrity checker (JabRef#1586)

 Added ISBN integrity checker

* Extracted ISBN class

Reenable errorprone (see http://errorprone.info/)

Extend the OpenConsoleFeature (JabRef#1582)

* Extend the OpenConsoleFeature by selection of custom terminal emulator.

- Add radio selection to the AdvancedTab
- Add new JabRefPreferences
- Add file check and execution commands
- Add localization keys

* Fix localization key.

* Move console selection to ExternalTab.java

* Change localization entry.

* Add command executor.

* Fix placeholder replacement.

* Fix codacy.

* Update localization key.

* Remove "Specify terminal emulator" option. Add GUI outputs.

* Set default command for Windows. Fix localization entries.

* Remove empty lines in language files.

* Use lambda expressions insead of ActionListeners

* Refactoring.

* Update CHANGELOG.md.

* Small refactorings.

Move preferences (JabRef#1604)

* Move preferences-related classes into separate package

* Rename JabRefPreferencesFilterDialog -> PreferencesFilterDialog and move it to gui

* Fix checkstyle warning

Set user agent to fix 403 status error

Replace getField with getFieldOptional in all of the tests and in som… (JabRef#1591)

* Replace getField with getFieldOptional in all of the tests and in some more code

* Some more conversions

Added filter to not show selected integrity checks (JabRef#1588)

* Added filter to not show selected integrity checks

* Removed unused variable

Some Globals.prefs injection in logic and model (JabRef#1593)

* Some Globals.prefs injection in logic and model

* Some more conversions and some fixes

* More injections

* Even more injections

* Yes, even more injections

* Indeed, even more injections

* Probably the last injections for now

* Removed unrequired dependency and fixed issue

* Dropped support for selecting sub/super to equations

* Added preference classes for LatexFieldFormatter and FieldContentParser

* Removed some left over code

* Added JournalAbbreviationPreferences

* Encapsulated LatexFieldFormatterPreferences in SavePreferences

* Changed getShortDescription to accept boolean argument

* Removed Globals.prefs from tests and removed unused imports

* Unused import

* Unused import

Rewrite MedlineImporter with JAXB and add nbib fields (JabRef#1479)

Add test in BibEntryWriterTest for type change

When clicking on a tab, the first field now has the focus (JabRef#988)

* the first Field does now have focus when clicking on a tab in the entry editor
* Make first field focused when selecting a tab in entry editor

The field list gets the focus as soon as it is focused (JabRef#1541)

Test CustomImporter (JabRef#1501)

* Test CustomImporter

Fixes imports

Added model.entry.FieldName that contains field name constants (JabRef#1602)

* Added model.entry.FieldName that contains field name constants

* More constants

* Renamed and added more constants

* Some more fields and cleanups

* Removed MedlineHandler left from merge conflicts

More fields added to FieldName (JabRef#1614)

* More fields added to FieldName

* Some Medline fixes

[WIP] Create new fetcher infrastructure (JabRef#1594)

* Introduce new Fetcher interfaces

* Refactor arXiv fulltext fetcher

* Add query based arXiv fetcher

* Reformat code

* Add a few tests for the arxiv parser

* Make new arXiv fetcher available

* Fix small problems related to files

* Fix tests

* Rename interface methods

* Add changelog entry

* Mark old EntryFetcher interface as deprecated

* Move fetcher to importer \ fetcher

* Move HelpFile from gui.help to logic.help

* Rename fetchers

* Rename FulltextFinder

* Optimize imports

* Fix failing test

* Ignore failing test

Added LayoutFormatterPreferences (and related files) (JabRef#1608)

* Added LayoutFormatterPreferences (and related files)

* Rebased

* Included JournalAbbreviationLoader in LayoutPreferences

Added more fields and fixed some issues (JabRef#1617)

Resolves JabRef#1613 Use Jabref default icon for uninstaller for now (JabRef#1616)

Always use https for help files (JabRef#1615)

Implemented JabRef#1345 - cleanup ISSN (JabRef#1590)

* Implemented JabRef#1345 - cleanup ISSN

* Fixed comments

* Extracted ISSN class

* Added tests for ISSN and ISBN

Added DateFormatter to LayoutEntry so that it actually works... (JabRef#1619)

Converted a few getField to getFieldOptional (JabRef#1625)

* Converted a few getField to getFieldOptional

Fixed JabRef#636 by using DOICheck and DOIStrip in export filters (JabRef#1624)

Improved LaTeX to Unicode/HTML formatters to output more sensible values for unknown commands (JabRef#1622)

Updated preview entries (JabRef#1606)

* Updated preview entries, which return new entry

Moved, removed, and used String constants (JabRef#1618)

* Moved, removed, and used String constants

* Some more fixes

* Moved NEWLINE, made FILE_SEPARATOR public and used it

* Moved NEWLINE and FILE_SEPARATOR to OS

* Moved ENCODING_PREFIX and SIGNATURE

* Corrected Globals in a few comments...

* Apparently the localization tests find commented out text...

More field names and a method (JabRef#1627)

* Introduced FieldName in ArXiV

* Some more field names

* More field names

Cleanup FindFile and asssociated tests (JabRef#1596)

* Cleanup FindFile and rework it using Streams and nio methods-
* Unignore test for trying on CI
* Use explicit List and Set in findFiles and caller methods
* Use Lazy Stream to find files

changes should be tested manually

Some enhancements and cleanups related to dates (JabRef#1575)

* Some enhancements and cleanups related to dates

* Fixed some time zone issues

* Replaced SimpleDateFormat in ZipFileChooser and replaced arrays with Lists

* Changed EasyDateFormat constructors

* Fixed stupid mistake

* Added CHANGELOG entry

* Maybe tests are passing now?

* Some server side print debugging...

* As it should be

* Tryng LocalDateTime

* No time zone

* Added test for Cookie

* Fixed imports...

* Added a third possible date format as it turns out that the server changed while developing this PR

Builds are now stored via build-upload.jabref.org

Consistent file name casing (and other localization improvements) (JabRef#1629)

* AUX files

* ZIP files

* BIB files

* JAR files

* didn't

* Couldn't what's

* Consistent casing

* AUX apparently is commonly used in French words...

* Fixed the flawed quick-and-dirty find-and-replace failures

define xjc input/ouput dir (subsequent builds will be faster) (JabRef#1628)

Execute task only when input/output dir changed.

Fixed a minor issue and refactored MergeEntries (JabRef#1634)

* Fixed a minor issue and refactored MergeEntries

* Fixed import

* Added CHANGELOG entry

Added LabelPatternPreferences (JabRef#1607)

* Added LabelPatternPreferences

* Removed static initializer

More tests (JabRef#1635)

* Added more tests for Cookie

* Enabled some layout tests and added test for StringUtil.intValueOfWithNull

* Updated a test

* Split tests

Updated Errorprone to 2.0.11 (JabRef#1636)

* Updated Errorprone to 2.0.11

* Corrected test

Keep @comment text in a bib file (JabRef#1638)

* Kep @comment text in a bib file

* Add test for @comment that contains regular entries

Replaced some getField and fixed some bugs (JabRef#1631)

* Replaced some getField and fixed some bugs

* Fixed a few things

* Added CHANGELOG entries

* Improved equals implementation

* Text book equals and hashCode

Fixed JabRef#1639 (JabRef#1641)

* Fixed JabRef#1639

* Removed old code

Export OO/LO citations to new database (JabRef#1630)

* Export OO/LO citations to new database

* Fixed problem with duplicates

* Added some comments

* Fixed spelling in comment

* Removed general Exception

Unified some equals (JabRef#1640)

* Unified some equals

* Imported correct Objects...

Fixed one more NPE which should have been fixed in JabRef#1631 (JabRef#1649)

Finished method to hide visible fields and show hidden fields

- Hide method done
- Show method done
- ToDo repaint hidden field
- ToDo test class

finished field repaint

remove sysouts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants