Skip to content

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
Release: com.io7m.jwheatsheaf 1.0.3
Change: Show the full paths of files/directories in tooltips (Ticket: #5)
  • Loading branch information
io7m committed Mar 29, 2020
2 parents 8a524f2 + 6dcd2b0 commit 007d47e
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 30 deletions.
13 changes: 11 additions & 2 deletions README-CHANGES.xml
Expand Up @@ -11,15 +11,24 @@
<c:change date="2020-03-28T00:00:00+00:00" summary="Add missing package exports to module descriptors"/>
</c:changes>
</c:release>
<c:release date="2020-03-28T12:51:49+00:00" ticket-system="com.github.io7m.jwheatsheaf" version="1.0.2">
<c:release date="2020-03-28T00:00:00+00:00" ticket-system="com.github.io7m.jwheatsheaf" version="1.0.2">
<c:changes>
<c:change date="2020-03-28T12:51:49+00:00" summary="Ensure CSS stylesheets are passed to any dialogs opened by the chooser">
<c:change date="2020-03-28T00:00:00+00:00" summary="Ensure CSS stylesheets are passed to any dialogs opened by the chooser">
<c:tickets>
<c:ticket id="4"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
<c:release date="2020-03-29T10:44:47+00:00" ticket-system="com.github.io7m.jwheatsheaf" version="1.0.3">
<c:changes>
<c:change date="2020-03-29T10:44:47+00:00" summary="Show the full paths of files/directories in tooltips">
<c:tickets>
<c:ticket id="5"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
<c:ticket-systems>
<c:ticket-system default="true" id="com.github.io7m.jwheatsheaf" url="https://www.github.com/io7m/jwheatsheaf/issues/"/>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.documentation/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.examples/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.examples</artifactId>
Expand Down
Expand Up @@ -41,7 +41,6 @@
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

public final class ExampleViewController implements Initializable
Expand Down Expand Up @@ -137,15 +136,30 @@ private void onSlowIOChanged()
private void onOpenSelected()
throws IOException
{
final var fileSystem =
this.filesystems.filesystems()
.get(this.filesystem.getValue());
final var imageSet =
this.imageSets.imageSets()
.get(this.imageSetSelection.getValue());

final var recents =
List.of(
fileSystem.getPath("A", "B", "C"),
fileSystem.getPath("D", "E", "F"),
fileSystem.getPath("G", "H", "I")
);

final var configuration =
JWFileChooserConfiguration.builder()
.setAllowDirectoryCreation(this.allowDirectoryCreation.isSelected())
.setFileSystem(this.filesystems.filesystems().get(this.filesystem.getValue()))
.setFileSystem(fileSystem)
.setCssStylesheet(ExampleViewController.class.getResource(this.cssSelection.getValue()))
.setFileImageSet(this.imageSets.imageSets().get(this.imageSetSelection.getValue()))
.setFileImageSet(imageSet)
.setAction(this.action.getValue())
.addFileFilters(new ExampleFilterRejectAll())
.addFileFilters(new ExampleFilterXML())
.addAllRecentFiles(recents)
.build();

final var testingBuilder = JWFileChoosersTesting.builder();
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.oxygen/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.oxygen</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.tests/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.ui/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.ui</artifactId>
Expand Down
Expand Up @@ -586,8 +586,8 @@ private void configureTableView()
this.directoryTable.setPlaceholder(new Label(""));

final var tableColumns = this.directoryTable.getColumns();
final TableColumn<JWFileItem, JWFileKind> tableTypeColumn =
(TableColumn<JWFileItem, JWFileKind>) tableColumns.get(0);
final TableColumn<JWFileItem, JWFileItem> tableTypeColumn =
(TableColumn<JWFileItem, JWFileItem>) tableColumns.get(0);
final TableColumn<JWFileItem, JWFileItem> tableNameColumn =
(TableColumn<JWFileItem, JWFileItem>) tableColumns.get(1);
final TableColumn<JWFileItem, Long> tableSizeColumn =
Expand All @@ -598,11 +598,11 @@ private void configureTableView()
tableTypeColumn.setSortable(false);
tableTypeColumn.setReorderable(false);
tableTypeColumn.setCellFactory(column -> {
final TableCell<JWFileItem, JWFileKind> cell = new TableCell<>()
final TableCell<JWFileItem, JWFileItem> cell = new TableCell<>()
{
@Override
protected void updateItem(
final JWFileKind item,
final JWFileItem item,
final boolean empty)
{
super.updateItem(item, empty);
Expand All @@ -614,9 +614,11 @@ protected void updateItem(
return;
}

this.setGraphic(JWFileChooserViewController.this.imageOfKind(item));
this.setGraphic(
JWFileChooserViewController.this.imageOfKind(item.kind()));
this.setText(null);
this.setTooltip(JWFileChooserViewController.this.tooltipOf(item));
this.setTooltip(
JWFileChooserViewController.this.tooltipOf(item));
}
};

Expand Down Expand Up @@ -645,7 +647,7 @@ protected void updateItem(

this.setGraphic(null);
this.setText(item.name());
this.setTooltip(JWFileChooserViewController.this.tooltipOf(item.kind()));
this.setTooltip(JWFileChooserViewController.this.tooltipOf(item));
}
};
cell.setOnMouseClicked(this::onTableRowClicked);
Expand Down Expand Up @@ -705,7 +707,7 @@ protected void updateItem(
});

tableTypeColumn.setCellValueFactory(
param -> new ReadOnlyObjectWrapper<>(param.getValue().kind()));
param -> new ReadOnlyObjectWrapper<>(param.getValue()));
tableNameColumn.setCellValueFactory(
param -> new ReadOnlyObjectWrapper<>(param.getValue()));
tableSizeColumn.setCellValueFactory(
Expand All @@ -715,15 +717,21 @@ protected void updateItem(
}

private Tooltip tooltipOf(
final JWFileKind kind)
final JWFileItem item)
{
switch (kind) {
switch (item.kind()) {
case REGULAR_FILE:
case SYMBOLIC_LINK:
case UNKNOWN:
return null;
return new Tooltip(
this.choosers.strings()
.tooltipFile(item.path())
);
case DIRECTORY:
return new Tooltip(this.choosers.strings().tooltipNavigateDirectory());
return new Tooltip(
this.choosers.strings()
.tooltipDirectory(item.path())
);
}
throw new UnreachableCodeException();
}
Expand Down
Expand Up @@ -16,6 +16,8 @@

package com.io7m.jwheatsheaf.ui;

import java.nio.file.Path;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;

Expand Down Expand Up @@ -74,6 +76,13 @@ public static JWStrings of(
return new JWStrings(bundle);
}

private String format(
final String idId,
final Object... inArgs)
{
return MessageFormat.format(this.resourceBundle.getString(idId), inArgs);
}

public String createDirectoryTitle()
{
return this.resourceBundle.getString("ui.directoryCreateTitle");
Expand All @@ -99,11 +108,6 @@ public String enterDirectoryName()
return this.resourceBundle.getString("ui.directoryName");
}

public String tooltipNavigateDirectory()
{
return this.resourceBundle.getString("ui.tooltip.directory");
}

public String fileSelect()
{
return this.resourceBundle.getString("ui.fileSelect");
Expand Down Expand Up @@ -133,4 +137,14 @@ public String enterPath()
{
return this.resourceBundle.getString("ui.enterPath");
}

public String tooltipDirectory(final Path path)
{
return this.format("ui.tooltip.directory", path.toAbsolutePath());
}

public String tooltipFile(final Path path)
{
return this.format("ui.tooltip.file", path.toAbsolutePath());
}
}
Expand Up @@ -32,7 +32,8 @@ ui.open=Open
ui.recentItems=Recent items
ui.save=Save
ui.search=Search…
ui.tooltip.directory=Double-click to navigate into this directory.
ui.tooltip.file=Click to select this file ({0})
ui.tooltip.directory=Double-click to navigate into this directory ({0})
ui.tooltip.directoryCreate=Create a new directory…
ui.tooltip.enterDirectly=Enter a full file path directly…
ui.tooltip.goParentDirectory=Go to parent directory
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -15,7 +15,7 @@

<groupId>com.io7m.jwheatsheaf</groupId>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<packaging>pom</packaging>

<name>com.io7m.jwheatsheaf</name>
Expand Down

0 comments on commit 007d47e

Please sign in to comment.