Skip to content

Commit

Permalink
Merge branch 'dev' into fix-#1955-error-xtext-reconciler-job
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Nov 19, 2020
2 parents 84a4bec + 8ae9ea8 commit ad1d6bc
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,17 @@ class TypeSystemConfigurationBlock extends OptionsConfigurationBlock {
restoreSectionExpansionStates = WollokActivator.getInstance.dialogSettings.addNewSection(SETTINGS_SECTION_NAME)
super.dispose
}

override performApply() {
// Hay que hacer esto para que no se rompa Xtext
savePreferences
true
}

override performOk() {
// Hay que hacer esto para que no se rompa Xtext
savePreferences
true
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,21 @@ class TypeSystemPreferencePage extends PropertyAndPreferencePage implements IWor
}

override performOk() {
if (builderConfigurationBlock !== null) {
scheduleCleanerJobIfNecessary(container)
if (!builderConfigurationBlock.performOk)
return false
}
scheduleCleanerJobIfNecessary(container)
builderConfigurationBlock.performOk
super.performOk
}

override performApply() {
if (builderConfigurationBlock !== null) {
scheduleCleanerJobIfNecessary(null)
builderConfigurationBlock.performApply
}
scheduleCleanerJobIfNecessary(null)
builderConfigurationBlock.performApply
super.performApply
}

def scheduleCleanerJobIfNecessary(IPreferencePageContainer preferencePageContainer) {
//TODO: podría ser inteligente y solo buildear si hubo cambios en ciertas propiedades.
// ver BuilderPreferencePage
val c = container as IWorkbenchPreferenceContainer
c.registerUpdateJob(new Job(Messages.WollokTypeSystemPreference_REBUILD_JOB_TITLE) {
(container as IWorkbenchPreferenceContainer).registerUpdateJob(new Job(Messages.WollokTypeSystemPreference_REBUILD_JOB_TITLE) {
override protected run(IProgressMonitor monitor) {
rebuild(monitor)
Status.OK_STATUS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.io.InvalidClassException
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import java.io.Serializable
import java.net.URLDecoder
import java.util.List
import java.util.Map
import java.util.Observable
Expand All @@ -30,20 +31,16 @@ import static extension org.uqbar.project.wollok.model.WollokModelExtensions.*
import static extension org.uqbar.project.wollok.utils.StringUtils.*

@Accessors
abstract class AbstractDiagramConfiguration extends Observable {
abstract class AbstractDiagramConfiguration extends Observable implements Serializable {

/** Notification Events */
public static String CONFIGURATION_CHANGED = "configuration"

/** Internal state */
boolean rememberLocationsAndSizes = true
Map<String, Point> locations
Map<String, Dimension> sizes
protected Map<String, Point> locations = newHashMap
protected Map<String, Dimension> sizes = newHashMap

new() {
init
}

/**
******************************************************
* STATE INITIALIZATION
Expand Down Expand Up @@ -118,7 +115,7 @@ abstract class AbstractDiagramConfiguration extends Observable {
*
*/
@Accessors
class StaticDiagramConfiguration extends AbstractDiagramConfiguration implements Serializable {
class StaticDiagramConfiguration extends AbstractDiagramConfiguration {

/** Internal state */
boolean showVariables = false
Expand Down Expand Up @@ -369,7 +366,7 @@ class StaticDiagramConfiguration extends AbstractDiagramConfiguration implements
}


/**
/**
******************************************************
* CONFIGURATION LOAD & SAVE TO EXTERNAL FILE
*******************************************************
Expand All @@ -395,11 +392,13 @@ class StaticDiagramConfiguration extends AbstractDiagramConfiguration implements
val file = new FileOutputStream(staticDiagramFile)
val oos = new ObjectOutputStream(file)
oos.writeObject(this)
oos.close
file.close
}
}

def getStaticDiagramFile() {
new File(fullPath, staticDiagramFileName)
new File(URLDecoder.decode(fullPath, "UTF-8"), staticDiagramFileName)
}

def getStaticDiagramFileName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.eclipse.gef.editparts.AbstractGraphicalEditPart
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart
import org.eclipse.gef.editparts.ZoomManager
import org.eclipse.gef.ui.actions.ActionRegistry
import org.eclipse.gef.ui.actions.ZoomComboContributionItem
import org.eclipse.gef.ui.properties.UndoablePropertySheetPage
import org.eclipse.gef.ui.views.palette.PalettePage
import org.eclipse.jface.action.Separator
Expand Down Expand Up @@ -398,7 +397,7 @@ class StaticDiagramView extends AbstractDiagramView implements IDocumentListener
val clazz = model.getComponent
if (clazz !== null) {
this.selection = new StructuredSelection(clazz)
val selectionChangedEvent = new SelectionChangedEvent(this, this.selection)
val selectionChangedEvent = new SelectionChangedEvent(this, selection)
currentListeners.forEach [ listener |
listener.selectionChanged(selectionChangedEvent)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ abstract class AbstractModel extends Shape {

protected val static TOP_POSITION = 10
protected val static DEFAULT_WIDTH = 120
protected val static ELEMENT_WIDTH = 50
protected val static MAX_ELEMENT_WIDTH = 230
protected val static ELEMENT_WIDTH = 150
protected val static MAX_ELEMENT_WIDTH = 400
protected val static MAX_ELEMENT_HEIGHT = 300
protected val static ELEMENT_HEIGHT = 55
protected val static WIDTH_SEPARATION_BETWEEN_ELEMENTS = 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ WollokDslValidator_OBJECT_NAME_MUST_START_LOWERCASE = El nombre del objeto deber

WollokDslValidator_SUPER_INCORRECT_ARGS = N\u00FAmero incorrecto de argumentos a 'super'. Se espera
WollokDslValidator_SUPER_ONLY_IN_CLASSES = S\u00F3lo se puede utilizar 'super' en m\u00E9todos declarados en clases
WollokDslValidator_SUPER_ONLY_OVERRIDING_METHOD = S\u00F3lo se puede utilizar 'super' en un m\u00E9tod que sobrescribe otro
WollokDslValidator_SUPER_ONLY_OVERRIDING_METHOD = S\u00F3lo se puede utilizar 'super' en un m\u00E9todo que sobrescribe otro

WollokDslValidator_INITIALIZATION_VALUE_FOR_VARIABLE_NEVER_USED = El valor inicial definido nunca es utilizado

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ class WMethodContainerExtensions extends WollokModelExtensions {
}

def static void superClassesIncludingYourselfTopDownDo(WClass cl, (WClass)=>void action) {
if (cl.equals(cl.parent)) return; // avoid stack overflow
if (cl.hasCyclicHierarchy) return;
if (cl.parent !== null) cl.parent.superClassesIncludingYourselfTopDownDo(action)
action.apply(cl)
}
Expand Down

0 comments on commit ad1d6bc

Please sign in to comment.