Skip to content

Commit

Permalink
mP1/walkingkooka-environment#29 EnvironmentContext extends HasNow
Browse files Browse the repository at this point in the history
- mP1/walkingkooka-environment#29
- EnvironmentContext extends HasNow
  • Loading branch information
mP1 committed Nov 28, 2024
1 parent ac86ad7 commit 725c6fa
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main/java/walkingkooka/spreadsheet/dominokit/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public void onSpreadsheetMetadata(final SpreadsheetMetadata metadata,
);

final EnvironmentContext environmentContext = metadata.environmentContext(
EnvironmentContexts.empty()
EnvironmentContexts.empty(this)
);
this.providerContext = ProviderContexts.basic(
environmentContext,
Expand Down Expand Up @@ -997,7 +997,6 @@ private void refreshSpreadsheetProvider() {

try {
this.formatterContext = metadata.spreadsheetFormatterContext(
() -> this.now(), // not sure why but method ref fails.
this.viewportCache, // SpreadsheetLabelNameResolver
converterProvider,// ConverterProvider
spreadsheetFormatterProvider, // SpreadsheetFormatterProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import walkingkooka.spreadsheet.format.SpreadsheetFormatterProviderDelegator;
import walkingkooka.spreadsheet.format.SpreadsheetFormatterSelector;

import java.time.LocalDateTime;

/**
* An base class capturing most of the requirements for {@link SpreadsheetFormatterSelectorDialogComponentContext}
*/
Expand Down Expand Up @@ -79,6 +81,11 @@ public final ProviderContext providerContext() {
return this.context;
}

@Override
public final LocalDateTime now() {
return this.context.now();
}

// HistoryTokenContext..............................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import walkingkooka.spreadsheet.parser.SpreadsheetParserProvider;
import walkingkooka.spreadsheet.parser.SpreadsheetParserProviderDelegator;

import java.time.LocalDateTime;

/**
* A mostly complete {@link SpreadsheetParserSelectorDialogComponent}.
*/
Expand Down Expand Up @@ -149,6 +151,11 @@ public final ProviderContext providerContext() {
return this.context;
}

@Override
public final LocalDateTime now() {
return this.context.now();
}

// log..............................................................................................................

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ public Runnable addSpreadsheetMetadataFetcherWatcher(final SpreadsheetMetadataFe

@Override
public LocalDateTime now() {
return NOW.get();
return NOW.now();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ public void giveFocus(final Runnable focus) {

@Override
public LocalDateTime now() {
return NOW.get();
return NOW.now();
}

@Override
Expand Down

0 comments on commit 725c6fa

Please sign in to comment.