Skip to content

Commit

Permalink
Commit lost .metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
huyennguyen-katalon committed Apr 17, 2020
1 parent 595f3f6 commit f788045
Show file tree
Hide file tree
Showing 442 changed files with 21,702 additions and 33 deletions.
34 changes: 1 addition & 33 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,4 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
bin/
*.class
!tools/sonar-scanner/jre/bin/
!tools/sonar-scanner/bin
!tools/sonar-scanner-windows/jre/bin/
!tools/sonar-scanner-windows/bin

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Maven
target/

# Eclipse
.settings
workspace/

# Mac Metadata Files
.DS_Store
.metadata/
.recommenders/
.e4css/
.mvn
mvnw
mvnw.cmd
.mvn/wrapper/maven-wrapper.jar
Empty file added .metadata/.lock
Empty file.
1,805 changes: 1,805 additions & 0 deletions .metadata/.log

Large diffs are not rendered by default.

Binary file added .metadata/.mylyn/repositories.xml.zip
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.kmstechnology.todolist.app.parts;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import com.kmstechnology.todolist.app.handlers.TodoEnterListener;
import com.kmstechnology.todolist.core.model.Todo;
import com.kmstechnology.todolist.core.model.TodoList;

public class TodoAppPart {

private Text txtInput;
private static List<Todo> todoList = new ArrayList<Todo>();
private Composite parent;

public static List<Todo> getTodoList() {
return todoList;
}

public static void addTodo(String todo) {
todoList.add(new Todo(todo));
}

private TableViewer tableViewer;

@Inject
private MDirtyable dirty;

@PostConstruct
public void createComposite(Composite parent) {
todoList.add(new Todo("example 1"));
parent.setLayout(new GridLayout(1, false));
txtInput = new Text(parent, SWT.BORDER);
txtInput.setMessage("Enter new todo...");
// txtInput.addModifyListener(new ModifyListener() {
// @Override
// public void modifyText(ModifyEvent e) {
// dirty.setDirty(true);
// }
// });
txtInput.addKeyListener(new TodoEnterListener(txtInput, this));
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.parent = parent;
this.refreshTodoList(parent);
// tableViewer = new TableViewer(parent, SWT.V_SCROLL);
//
// tableViewer.setContentProvider(ArrayContentProvider.getInstance());
// tableViewer.setInput(createInitialDataModel(parent));
// tableViewer.getTable().setLayoutData(new
// GridData(GridData.FILL_BOTH));
}

@Focus
public void setFocus() {
for (Todo todo : todoList) {
Composite elementRowLayout = new Composite(parent, SWT.BORDER);
elementRowLayout.setLayout(new GridLayout(2, false));
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label label = new Label(elementRowLayout, SWT.NONE);
label.setText(todo.getText());
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button button = new Button(elementRowLayout, SWT.NONE);
button.setText("Delete");
}
}

// @Persist
// public void save() {
// dirty.setDirty(false);
// }

private void refreshTodoList(Composite parent) {
for (Todo todo : todoList) {
Composite elementRowLayout = new Composite(parent, SWT.BORDER);
elementRowLayout.setLayout(new GridLayout(2, false));
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

Label label = new Label(elementRowLayout, SWT.NONE);
label.setText(todo.getText());
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button button = new Button(elementRowLayout, SWT.NONE);
button.setText("Delete");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmi:id="_6wlLcMgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.application" bindingContexts="_6wlLecgZEeSyMNYR5xypkQ">
<children xsi:type="basic:TrimmedWindow" xmi:id="_6wlLccgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.window.main" label="Eclipse 4 RCP Application" width="500" height="400">
<children xsi:type="basic:PartSashContainer" xmi:id="_6wlLksgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.partsashcontainer.sample">
<children xsi:type="basic:PartStack" xmi:id="_6wlLk8gZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.partstack.sample">
<children xsi:type="basic:Part" xmi:id="_6wlLlMgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.part.sample" contributionURI="bundleclass://com.kmstechnology.todolist.app/com.kmstechnology.todolist.app.parts.TodoAppPart" label="Sample Part"/>
</children>
</children>
<trimBars xmi:id="_6wlLlcgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.trimbar.top"/>
</children>
<rootContext xmi:id="_6wlLecgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
<children xmi:id="_6wlLesgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
<children xmi:id="_6wlLe8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
</rootContext>
<commands xmi:id="_6wlLfMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/>
<commands xmi:id="_6wlLgMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.open" commandName="openCommand"/>
<commands xmi:id="_6wlLg8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.save" commandName="saveCommand"/>
<commands xmi:id="_6wlLhsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
<addons xmi:id="_6wlLcsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_6wlLc8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_6wlLdMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
<addons xmi:id="_6wlLdcgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
<addons xmi:id="_6wlLdsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
<addons xmi:id="_6wlLd8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
<addons xmi:id="_6wlLeMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
</application:Application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.kmstechnology.todolist.app.handlers;

import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import com.kmstechnology.todolist.app.parts.TodoAppPart;

public class TodoEnterListener implements KeyListener {
private final TodoAppPart todoAppPart;
private final Text txtTodo;

public TodoEnterListener(Text textTodo, TodoAppPart todoAppPart) {
super();
this.txtTodo = textTodo;
this.todoAppPart = todoAppPart;
}

@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
TodoAppPart.addTodo(this.txtTodo.getText());
}
}

@Override
public void keyReleased(KeyEvent e) {
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
todoAppPart.setFocus();
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.kmstechnology.todolist.core.model;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.swt.widgets.Composite;

public class TodoList {
private List<Todo> todoList;

public TodoList() {
super();
this.todoList = new ArrayList<Todo>();
}

public Todo add(int ID, String todo) {
Todo newTodo = new Todo(ID, todo);
this.todoList.add(newTodo);
return newTodo;
}

public List<Todo> get() {
return this.todoList;
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package com.kmstechnology.todolist.app.parts;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import com.kmstechnology.todolist.app.handlers.TodoEnterListener;
import com.kmstechnology.todolist.core.model.Todo;

public class TodoAppPart {

private Text txtInput;
private List<Todo> todoList = new ArrayList<Todo>();
private Composite parent;

public List<Todo> getTodoList() {
return todoList;
}

public void addTodo(String todo) {
todoList.add(new Todo(todo));
}

public void handleAddTodo(String todo) {
addTodo(todo);
refreshTodoList(todo);
txtInput.setText("");
}

private TableViewer tableViewer;

@Inject
private MDirtyable dirty;

@PostConstruct
public void createComposite(Composite parent) {
this.parent = parent;
parent.setLayout(new GridLayout(1, false));
txtInput = new Text(parent, SWT.BORDER);
txtInput.setMessage("Enter new todo...");
// txtInput.addModifyListener(new ModifyListener() {
// @Override
// public void modifyText(ModifyEvent e) {
// dirty.setDirty(true);
// }
// });

txtInput.addKeyListener(new TodoEnterListener(txtInput, this));
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (Todo todo : todoList) {
Composite elementRowLayout = new Composite(parent, SWT.BORDER);
elementRowLayout.setLayout(new GridLayout(2, false));
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label label = new Label(elementRowLayout, SWT.NONE);
label.setText(todo.getText());
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button button = new Button(elementRowLayout, SWT.NONE);
button.setText("Delete");
}

// tableViewer = new TableViewer(parent, SWT.V_SCROLL);
//
// tableViewer.setContentProvider(ArrayContentProvider.getInstance());
// tableViewer.setInput(createInitialDataModel(parent));
// tableViewer.getTable().setLayoutData(new
// GridData(GridData.FILL_BOTH));
}

@Focus
public void setFocus() {
// for (Todo todo : todoList) {
// Composite elementRowLayout = new Composite(parent, SWT.BORDER);
// elementRowLayout.setLayout(new GridLayout(2, false));
// elementRowLayout.setLayoutData(new
// GridData(GridData.FILL_HORIZONTAL));
// Label label = new Label(elementRowLayout, SWT.NONE);
// label.setText(todo.getText());
// label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Button button = new Button(elementRowLayout, SWT.NONE);
// button.setText("Delete");
// }
}

public void refreshTodoList(String todo) {
if (parent.getChildren().length > 1 && parent.getChildren()[1] != null
&& !parent.getChildren()[1].isDisposed()) {
parent.getChildren()[1].dispose();
}

Composite elementRowLayout = new Composite(parent, SWT.BORDER);
elementRowLayout.setLayout(new GridLayout(2, false));
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

Label label = new Label(elementRowLayout, SWT.NONE);
label.setText(todo);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button button = new Button(elementRowLayout, SWT.NONE);
button.setText("Delete");

// parent.layout(true, true);
// parent.requestLayout();
parent.pack();
}
}
Loading

0 comments on commit f788045

Please sign in to comment.