Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-santos-pt committed Sep 14, 2017
1 parent cc941ce commit 09a5ee5
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
1 change: 0 additions & 1 deletion pt.iscte.pandionj.launcher/bin/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public boolean isEnabled() {
IWorkbenchWindow window = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
IEditorPart editor = page.getActiveEditor();
if(editor == null)
return false;

IEditorInput input = editor.getEditorInput();
return !Activator.isExecutingLaunch() && input instanceof FileEditorInput && input.getName().endsWith(".java");
}
Expand Down
1 change: 0 additions & 1 deletion pt.iscte.pandionj.perspective/bin/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions pt.iscte.pandionj.perspective/src/FileInputDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,4 @@ public void handleEvent(Event event) {
return value;
}

public static void main(String[] args) {
Shell shell = new Shell();
FileInputDialog dialog = new FileInputDialog(shell);
System.out.println(dialog.open());
}
}
2 changes: 0 additions & 2 deletions pt.iscte.pandionj.perspective/src/NewJavaFileCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public class NewJavaFileCommand extends AbstractHandler {

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
System.out.println(selection);

IProject proj = (IProject) ((IStructuredSelection) selection).getFirstElement();
FileInputDialog dialog = new FileInputDialog(Display.getDefault().getActiveShell());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ private void setupPrefs() {
prefs.put("org.eclipse.debug.ui.switch_perspective_on_suspend", "never");
IEclipsePreferences prefsUi = InstanceScope.INSTANCE.getNode("org.eclipse.ui.ide");
prefsUi.put("SWITCH_PERSPECTIVE_ON_PROJECT_CREATION", "never");
// prefsUi.put("org.eclipse.ui.ide.switch_perspective_on_project_creation", "never");

IEclipsePreferences prefsJdt = InstanceScope.INSTANCE.getNode("org.eclipse.jdt.ui");
prefsJdt.put("hoverModifiers", " org.eclipse.jdt.ui.BestMatchHover;!0;org.eclipse.jdt.internal.debug.ui.JavaDebugHover;!0;org.eclipse.jdt.ui.ProblemHover;!0;org.eclipse.jdt.ui.NLSStringHover;Command+Alt;org.eclipse.jdt.ui.JavadocHover;Command+Shift;org.eclipse.jdt.ui.AnnotationHover;!0;org.eclipse.jdt.ui.JavaSourceHover;Shift;");
Expand Down Expand Up @@ -56,6 +55,9 @@ private void setupPrefs() {
prefsJdt.put("content_assist_fill_method_arguments", "false");
prefsJdt.put("editor_folding_enabled", "false");

IEclipsePreferences prefsWb = InstanceScope.INSTANCE.getNode("org.eclipse.ui.workbench");
prefsWb.put("org.eclipse.debug.ui.consoleFont","1|Monaco|14.0|0|COCOA|1|Monaco");


}

Expand Down
1 change: 1 addition & 0 deletions pt.iscte.pandionj/src/pt/iscte/pandionj/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ interface Messages {
String TRASH = "Simulates the behavior of Java's garbage collector, removing all the unferenced objects.";
String RUN_DIALOG = "Do you want to open PandionJ view?";
String COPY_CLIPBOARD = "Copy image to clipboard";
String PRESS_TO_INVOKE = "Press Enter do execute";
}


Expand Down
4 changes: 2 additions & 2 deletions pt.iscte.pandionj/src/pt/iscte/pandionj/ParserManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public static VarParser getVarParserResult(IFile f) {
tagParser.run();
tagParserCache.put(f, tagParser);

System.out.println(r.toText());
System.out.println(tagParser);
// System.out.println(r.toText());
// System.out.println(tagParser);
}
return r;
}
Expand Down
4 changes: 2 additions & 2 deletions pt.iscte.pandionj/src/pt/iscte/pandionj/RuntimeViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void removePointer(IReferenceModel ref) {


private void addMenu() {
Menu menu = new Menu(this);
Menu menu = new Menu(canvas);
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText(Constants.Messages.COPY_CLIPBOARD);
item.setImage(PandionJUI.getImage("clipboard.gif"));
Expand All @@ -198,7 +198,7 @@ public void widgetSelected(SelectionEvent e) {
copyToClipBoard();
}
});
setMenu(menu);
canvas.setMenu(menu);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

import pt.iscte.pandionj.extensibility.PandionJUI.InvocationAction;
import pt.iscte.pandionj.model.PrimitiveType;
Expand Down Expand Up @@ -107,6 +108,9 @@ public void keyPressed(KeyEvent e) {
org.eclipse.swt.widgets.Label close = new org.eclipse.swt.widgets.Label(this, SWT.NONE);
FontManager.setFont(close, Constants.VAR_FONT_SIZE);
close.setText(")");
Label info = new Label(this, SWT.NONE);
info.setText(Constants.Messages.PRESS_TO_INVOKE);
info.setForeground(Constants.Colors.CONSTANT);
}

private void invokeOrNext(InvocationAction action, int i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void update(Object arg) {
for(Object o : array) {
Object[] line = (Object[]) o;
for(Object e : line) {
String text = e instanceof Object[] ? Arrays.deepToString((Object[]) e) : e.toString();
String text = e == null ? "null" : (e instanceof Object[] ? Arrays.deepToString((Object[]) e) : e.toString());
Label label = new Label(text);
add(label);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private RoundedRectangle createPositionsFig() {
fig.setToolTip(new Label("length = " + model.getLength()));
if(N == 0) {
Label empty = new Label("");
GridData layoutData = new GridData(POSITION_WIDTH, POSITION_WIDTH+20);
GridData layoutData = new GridData(POSITION_WIDTH/2, POSITION_WIDTH);
layout.setConstraint(empty, layoutData);
fig.add(empty);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ public void watchEvaluationFinished(IWatchExpressionResult result) {
if(ret instanceof IJavaObject) {

IEntityModel object = getRuntimeModel().getObject((IJavaObject) ret, true, null);
System.out.println(ret + " == " + object);
listener.valueReturn(object);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private IVariableModel<?> createVar(IJavaVariable jv, boolean isInstance, IJavaV
String varName = jv.getName();
boolean isField = !jv.isLocal();
VariableInfo info = varParser != null ? varParser.locateVariable(varName, frame.getLineNumber(), isField) : null;
System.out.println(frame.getDeclaringTypeName() + " -- " + frame.getMethodName() + " " + (jv.isStatic() ? "static " : "") + varName + ": " + info);
// System.out.println(frame.getDeclaringTypeName() + " -- " + frame.getMethodName() + " " + (jv.isStatic() ? "static " : "") + varName + ": " + info);
IVariableModel<?> newVar = null;

if(value instanceof IJavaObject) {
Expand Down

0 comments on commit 09a5ee5

Please sign in to comment.