Skip to content

Commit

Permalink
cleanup and fix codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Nov 17, 2018
1 parent a7ea530 commit 0c8a959
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javafx.scene.control.ToggleGroup;

import org.jabref.gui.util.BaseDialog;
import org.jabref.logic.l10n.Localization;

import com.airhacks.afterburner.views.ViewLoader;

Expand All @@ -30,14 +31,15 @@ public AdvancedCiteDialogView() {
return null;
});

setTitle(Localization.lang("Cite special"));
}

@FXML
private void initialize() {
viewModel = new AdvancedCiteDialogViewModel();

inPar.selectedProperty().bindBidirectional(viewModel.citeInParProperty());
inText.selectedProperty().bindBidirectional(viewModel.citeInTexTProperty());
inText.selectedProperty().bindBidirectional(viewModel.citeInTextProperty());
pageInfo.textProperty().bindBidirectional(viewModel.pageInfoProperty());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public BooleanProperty citeInParProperty() {
return citeInPar;
}

public BooleanProperty citeInTexTProperty() {
public BooleanProperty citeInTextProperty() {
return citeInText;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ private void initialize() throws NoSuchElementException, WrappedTargetException,
viewModel = new ManageCitationsDialogViewModel(ooBase, dialogService);

colCitation.setCellValueFactory(cellData -> cellData.getValue().citationProperty());

new ValueTableCellFactory<ManageCitationsItemViewModel, String>().withGraphic(viewModel::getText).install(colCitation);

colExtraInfo.setCellValueFactory(cellData -> cellData.getValue().extraInformationProperty());
Expand All @@ -66,6 +65,6 @@ private void initialize() throws NoSuchElementException, WrappedTargetException,
cell.getRowValue().setExtraInfo(cell.getNewValue());
});
colExtraInfo.setCellFactory(TextFieldTableCell.forTableColumn());
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public ManageCitationsDialogViewModel(OOBibBase ooBase, DialogService dialogServ

}

//TODO: Call store settings after edit commit
//update reference then and call refresh/sync in the background
public void storeSettings() {
List<CitationEntry> ciationEntries = citations.stream().map(ManageCitationsItemViewModel::toCitationEntry).collect(Collectors.toList());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ private void initialize() {
}

@FXML
void browseOOPath(ActionEvent event) {
private void browseOOPath(ActionEvent event) {
viewModel.browseOOPath();
}

@FXML
void browseOOExec(ActionEvent event) {
private void browseOOExec(ActionEvent event) {
viewModel.browseOOExec();
}

@FXML
void browseOOJars(ActionEvent event) {
private void browseOOJars(ActionEvent event) {
viewModel.browseOOJars();
}

Expand Down
11 changes: 5 additions & 6 deletions src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ private void initPanel() {

try {
ooBase.selectDocument();
frame.output(Localization.lang("Connected to document") + ": "
+ ooBase.getCurrentDocumentTitle().orElse(""));
dialogService.notify(Localization.lang("Connected to document") + ": "
+ ooBase.getCurrentDocumentTitle().orElse(""));
} catch (UnknownPropertyException | WrappedTargetException | IndexOutOfBoundsException |
NoSuchElementException | NoDocumentException ex) {
LOGGER.warn("Problem connecting", ex);
Expand All @@ -174,7 +174,7 @@ private void initPanel() {
} catch (IOException e) {
LOGGER.warn("Unable to reload style file '" + style.getPath() + "'", e);
}
frame.setStatus(Localization.lang("Current style is '%0'", style.getName()));
dialogService.notify(Localization.lang("Current style is '%0'", style.getName()));
});

});
Expand Down Expand Up @@ -303,8 +303,7 @@ private void exportEntries() {

}

Defaults defaults = new Defaults(Globals.prefs.getDefaultBibDatabaseMode());

Defaults defaults = new Defaults(jabRefPreferences.getDefaultBibDatabaseMode());
BibDatabaseContext databaseContext = new BibDatabaseContext(newDatabase, defaults);
this.frame.addTab(databaseContext, true);

Expand Down Expand Up @@ -374,7 +373,7 @@ private void connect() {
this.ooBase = ooBase;

if (ooBase.isConnectedToDocument()) {
frame.output(Localization.lang("Connected to document") + ": " + ooBase.getCurrentDocumentTitle().orElse(""));
dialogService.notify(Localization.lang("Connected to document") + ": " + ooBase.getCurrentDocumentTitle().orElse(""));
}

// Enable actions that depend on Connect:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<DialogPane minHeight="-Infinity" minWidth="-Infinity" prefHeight="470.0" prefWidth="701.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.openoffice.StyleSelectDialogView">
<content>
<BorderPane fx:id="contentPane">
<BorderPane>
<top>
<TableView fx:id="tvStyles" prefHeight="208.0" prefWidth="662.0" BorderPane.alignment="CENTER">
<columns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import javafx.scene.control.MenuItem;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;

import org.jabref.gui.DialogService;
Expand Down Expand Up @@ -38,7 +37,6 @@ public class StyleSelectDialogView extends BaseDialog<OOBibStyle> {
@FXML private TableColumn<StyleSelectItemViewModel, Boolean> colDeleteIcon;
@FXML private Button add;
@FXML private VBox vbox;
@FXML private BorderPane contentPane;
private final MenuItem edit = new MenuItem(Localization.lang("Edit"));
private final MenuItem reload = new MenuItem(Localization.lang("Reload"));
@Inject private PreferencesService preferencesService;
Expand Down

0 comments on commit 0c8a959

Please sign in to comment.