VBinary improvement for swing client + bugfix in GridTable

Description

The binary datatype in the swing client is very limited. This can be seen in the System Image window. Once you load an image and save it, the field only allows you to save the image back instead of loading another image. If you accidentally saved a wrong image you are not able to correct it.
I made some little changes to VBinary.java and GridTable.java to solve this problem. The binary datatype now consists of two buttons, an open and a save button.

If no binary is stored, only the open button is active. After a file is opened, the save button becomes active. Now the user can either open another file or save back the stored file to the file system. To delete a file, click the open button and cancel the FileChooser.

Another thing is the bug in GridTable. About line 2110 in the method dataSavePO(int Record_ID) there is an if-statement where a POs value is compared agains the database. The comparison only consists of "==" and ".equals()" but if we have a binary datatype our value is a byte arra (byte[]) which fails if we try to compare it with == or equals. So i added another two or-clauses to the if statement which checks the value class and compares byte arrays with Array.equals(). This change is also necessary for https://idempiere.atlassian.net/browse/IDEMPIERE-612 because otherwise we wouldn't be able to change icons more often than once.

Environment

all

Assignee

Thomas Bayen

Reporter

Jan Thielemann

Tested By

None

Components

Affects versions

Priority

Major
Configure