Skip to content

Commit

Permalink
TEIIDDES-3044 (cntd)
Browse files Browse the repository at this point in the history
 * fixed new object actions to properly set the target model resource
  • Loading branch information
blafond committed Jun 8, 2017
1 parent 60e21e2 commit 268d276
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void run(ModelResource mr) {
RelationalIndex index = new RelationalIndex();

// Hand the table off to the generic edit dialog
RelationalDialogModel dialogModel = new RelationalDialogModel(index, selectedModel);
RelationalDialogModel dialogModel = new RelationalDialogModel(index, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void run(ModelResource mr) {
}

// Hand the table off to the generic edit dialog
RelationalDialogModel dialogModel = new RelationalDialogModel(procedure, selectedModel);
RelationalDialogModel dialogModel = new RelationalDialogModel(procedure, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void run(ModelResource mr) {
table.setSupportsUpdate(true);

// Hand the table off to the generic edit dialog
RelationalDialogModel dialogModel = new RelationalDialogModel(table, selectedModel);
RelationalDialogModel dialogModel = new RelationalDialogModel(table, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void run(ModelResource mr) {
table.setSupportsUpdate(true);

// Hand the table off to the generic edit dialog
RelationalDialogModel dialogModel = new RelationalDialogModel(table, selectedModel);
RelationalDialogModel dialogModel = new RelationalDialogModel(table, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void run(ModelResource mr) {
relationalViewIndex = new RelationalViewIndex();

// Hand the table off to the generic edit dialog
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewIndex, selectedModel);
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewIndex, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void run(ModelResource mr) {
procedureTypeDialog.open();

if (procedureTypeDialog.getReturnCode() == Window.OK) {
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewProcedure, selectedModel);
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewProcedure, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog dialog = new EditRelationalObjectDialog(shell, dialogModel);

dialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void run(ModelResource mr) {
relationalViewTable.setSupportsUpdate(true);

// Hand the table off to the generic edit dialog
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewTable, selectedModel);
TransformationDialogModel dialogModel = new TransformationDialogModel(relationalViewTable, (IFile)ModelUtilities.getIResource(mr));
EditRelationalObjectDialog editDialog = new EditRelationalObjectDialog(shell, dialogModel);

editDialog.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,19 @@ public static ModelResource getModelResource( Object object ) {
return null;
}

public static IResource getIResource(ModelResource modelResource) {
IResource resource = null;

try {
resource = modelResource.getUnderlyingResource();
} catch (ModelWorkspaceException ex) {
String message = "[ModelUtilities.getIResource()] ERROR: exception finding Resource for model"; //$NON-NLS-1$
UiConstants.Util.log(IStatus.ERROR, ex, message);
}

return resource;
}

public static IProject getProject(Object object) {
ModelResource mr = getModelResource(object);

Expand Down

0 comments on commit 268d276

Please sign in to comment.